bocto

package module
v0.9.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2021 License: BSD-3-Clause Imports: 3 Imported by: 3

README

Bocto

Discord bot library to abstract all the shared plumbing between Jadebot and Vriska8ot.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreditsEmbed

func CreditsEmbed(botName, url string,
	color int, usesMutantStandard bool, artists ...Contributor) *discordgo.MessageEmbed

CreditsEmbed is used for accreditation of all people involved in making the bot possible. or at least, most of them.

func ImageEmbed

func ImageEmbed(title string, url string, image string,
	footer string, color int) *discordgo.MessageEmbed

ImageEmbed returns an embeded image.

func TextEmbed

func TextEmbed(title, name, text, url,
	footer string, color int) *discordgo.MessageEmbed

TextEmbed returns an embeded Text.

Types

type Bot

type Bot struct {
	Color     int
	Name      string
	Prefix    string
	Mentioned func(Bot, *discordgo.MessageCreate, []string)
	Confused  func(Bot, *discordgo.MessageCreate, []string)
	Self      *discordgo.User
	Session   *discordgo.Session
	// contains filtered or unexported fields
}

Bot is a representation of a discord chatbot.

func (*Bot) AddCommand

func (b *Bot) AddCommand(key string,
	value func(
		Bot,
		*discordgo.MessageCreate,
		[]string),
	prefix bool)

AddCommand adds a Command to a Bot.

func (Bot) MessageCreate

func (b Bot) MessageCreate(session *discordgo.Session,
	message *discordgo.MessageCreate)

MessageCreate occurs every time the bot recieves a message. this is the heart and soul of your discord bot, MessageCreate is run every time your bot can read a message in a channel. I

func (*Bot) New

func (b *Bot) New(name, prefix, token string, color int) error

New initializes a new Bot.

- Name is the name of your bot.

- Prefix is what must be prepended to a command to inform your bot that this message is a command.

- Token is your bot token.

- Color designates what color an embed should have by default.

func (*Bot) ReadyEvent

func (b *Bot) ReadyEvent(session *discordgo.Session,
	rdy *discordgo.Ready)

ReadyEvent occurs when the bot recieves a ready event.

func (Bot) String

func (b Bot) String() string

String is a debug command.

type Contributor

type Contributor struct {
	Name    string
	Message string
	URL     string
	Type    string
}

Contributor represents metadata about an Contributor, used for accreditation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL