Versions in this module Expand all Collapse all v1 v1.3.8 Mar 29, 2020 v1.3.7 Mar 25, 2020 Changes in this version type Argument + func (arg *Argument) AsInt64() int64 v1.3.6 Mar 25, 2020 v1.3.5 Mar 24, 2020 Changes in this version type Paginator + func (p *Paginator) Delete() v1.3.4 Mar 22, 2020 v1.3.3 Mar 22, 2020 v1.3.2 Mar 22, 2020 v1.3.1 Mar 22, 2020 v1.3.0 Mar 22, 2020 v1.2.0 Mar 22, 2020 Changes in this version type Bot + ListHandler ListHandler + func (bot *Bot) SetListHandler(list ListHandler) *Bot + type ListHandler func(b *Bot, m *discordgo.Message) bool v1.1.0 Mar 16, 2020 v1.0.0 Mar 13, 2020 Changes in this version + const COLOR + const EmbedLimit + const EmbedLimitDescription + const EmbedLimitField + const EmbedLimitFieldName + const EmbedLimitFieldValue + const EmbedLimitFooter + const EmbedLimitTitle + const EmojiFirst + const EmojiLast + const EmojiLeft + const EmojiRight + const EmojiStop + const VERSION + var ChannelMentionRegex = regexp.MustCompile("^(?:<#)?(\\d{17,19})>?$") + var English = ...("COMMAND_MISSING_PERMS", ...) + var HumanizeUsageRegex = regexp.MustCompile("(<|\\[)(\\w+):[^.]+?(\\.\\.\\.)?(>|\\])") + var MentionRegex = regexp.MustCompile("^(?:<@!?)?(\\d{17,19})>?$") + func CommandHandlerMonitor(bot *Bot, ctx *MonitorContext) + func Escape(input string) string + func HumanizeUsage(usage string) string + type Argument struct + Value interface{} + func ParseArgument(ctx *CommandContext, tag *UsageTag, raw string) (*Argument, error) + func (arg *Argument) AsBool() bool + func (arg *Argument) AsChannel() *discordgo.Channel + func (arg *Argument) AsFloat() float64 + func (arg *Argument) AsGuild() *discordgo.Guild + func (arg *Argument) AsInt() int + func (arg *Argument) AsMember() *discordgo.Member + func (arg *Argument) AsMessage() *discordgo.Message + func (arg *Argument) AsRole() *discordgo.Role + func (arg *Argument) AsString() string + func (arg *Argument) AsUser() *discordgo.User + func (arg *Argument) IsProvided() bool + type Bot struct + Application *discordgo.Application + Color int + CommandCooldowns map[string]map[string]time.Time + CommandEdits map[string]string + CommandTyping bool + Commands map[string]*Command + CommandsRan int + DefaultLocale *Language + ErrorHandler ErrorHandler + InvitePerms int + Language LocaleHandler + Languages map[string]*Language + MentionPrefix bool + Monitors map[string]*Monitor + OwnerID string + Prefix PrefixHandler + Session *discordgo.Session + Uptime time.Time + func New(s *discordgo.Session) *Bot + func (bot *Bot) AddCommand(cmd *Command) *Bot + func (bot *Bot) AddLanguage(lang *Language) *Bot + func (bot *Bot) AddMonitor(m *Monitor) *Bot + func (bot *Bot) CheckCooldown(userID, command string, cooldownSec int) (bool, int) + func (bot *Bot) Connect() error + func (bot *Bot) GetCommand(name string) *Command + func (bot *Bot) LoadBuiltins() *Bot + func (bot *Bot) MustConnect() + func (bot *Bot) SetDefaultLocale(locale string) *Bot + func (bot *Bot) SetErrorHandler(fn ErrorHandler) *Bot + func (bot *Bot) SetInvitePerms(bits int) *Bot + func (bot *Bot) SetLocaleHandler(handler LocaleHandler) *Bot + func (bot *Bot) SetMentionPrefix(toggle bool) *Bot + func (bot *Bot) SetPrefix(prefix string) *Bot + func (bot *Bot) SetPrefixHandler(prefix PrefixHandler) *Bot + func (bot *Bot) Wait() + type Command struct + Aliases []string + AvailableTags string + BotPermissions int + Category string + Cooldown int + DeleteAfter bool + Description string + Editable bool + Enabled bool + GuildOnly bool + Name string + Override bool + OwnerOnly bool + RequiredPermissions int + Run CommandHandler + Usage []*UsageTag + UsageString string + func NewCommand(name string, category string, run CommandHandler) *Command + func (c *Command) AddAliases(aliases ...string) *Command + func (c *Command) Delete() *Command + func (c *Command) Disable() *Command + func (c *Command) Enable() *Command + func (c *Command) NoOverride(status bool) *Command + func (c *Command) SetCooldown(cooldown int) *Command + func (c *Command) SetDescription(description string) *Command + func (c *Command) SetEditable(toggle bool) *Command + func (c *Command) SetGuildOnly(toggle bool) *Command + func (c *Command) SetOwnerOnly(toggle bool) *Command + func (c *Command) SetPermission(permbit int) *Command + func (c *Command) SetUsage(usage string) *Command + type CommandContext struct + Args []*Argument + Author *discordgo.User + Bot *Bot + Channel *discordgo.Channel + Command *Command + Flags map[string]string + Guild *discordgo.Guild + InvokedName string + Locale *Language + Message *discordgo.Message + Prefix string + RawArgs []string + Session *discordgo.Session + func (ctx *CommandContext) Arg(idx int) *Argument + func (ctx *CommandContext) BuildEmbed(embed *Embed) (*discordgo.Message, error) + func (ctx *CommandContext) BuildEmbedNoEdit(embed *Embed) (*discordgo.Message, error) + func (ctx *CommandContext) CodeBlock(lang, content string, args ...interface{}) (*discordgo.Message, error) + func (ctx *CommandContext) Edit(msg *discordgo.Message, content string, args ...interface{}) (*discordgo.Message, error) + func (ctx *CommandContext) EditLocale(msg *discordgo.Message, key string, args ...interface{}) (*discordgo.Message, error) + func (ctx *CommandContext) Error(err interface{}, args ...interface{}) + func (ctx *CommandContext) FetchUser(id string) (*discordgo.User, error) + func (ctx *CommandContext) Flag(flag string) string + func (ctx *CommandContext) GetFirstMentionedUser() *discordgo.User + func (ctx *CommandContext) HasArgs() bool + func (ctx *CommandContext) HasFlag(flag string) bool + func (ctx *CommandContext) JoinedArgs(sliced ...int) string + func (ctx *CommandContext) Member(id string) *discordgo.Member + func (ctx *CommandContext) ParseArgs() bool + func (ctx *CommandContext) React(emoji string) error + func (ctx *CommandContext) Reply(content string, args ...interface{}) (*discordgo.Message, error) + func (ctx *CommandContext) ReplyEmbed(embed *discordgo.MessageEmbed) (*discordgo.Message, error) + func (ctx *CommandContext) ReplyEmbedNoEdit(embed *discordgo.MessageEmbed) (*discordgo.Message, error) + func (ctx *CommandContext) ReplyLocale(key string, args ...interface{}) (*discordgo.Message, error) + func (ctx *CommandContext) ReplyNoEdit(content string, args ...interface{}) (*discordgo.Message, error) + func (ctx *CommandContext) SendFile(name string, file io.Reader, content string, args ...interface{}) (*discordgo.Message, error) + func (ctx *CommandContext) User(id string) *discordgo.User + type CommandError struct + Context *CommandContext + Err interface{} + File string + Line int + func (err *CommandError) Error() string + type CommandHandler func(ctx *CommandContext) + type Embed struct + func NewEmbed() *Embed + func (e *Embed) AddField(name, value string, args ...interface{}) *Embed + func (e *Embed) AddInlineField(name, value string, args ...interface{}) *Embed + func (e *Embed) Build() *discordgo.MessageEmbed + func (e *Embed) InlineAllFields() *Embed + func (e *Embed) SetAuthor(args ...string) *Embed + func (e *Embed) SetColor(clr int) *Embed + func (e *Embed) SetDescription(description string) *Embed + func (e *Embed) SetFooter(args ...string) *Embed + func (e *Embed) SetImage(args ...string) *Embed + func (e *Embed) SetThumbnail(args ...string) *Embed + func (e *Embed) SetTitle(name string) *Embed + func (e *Embed) SetURL(URL string) *Embed + func (e *Embed) Truncate() *Embed + func (e *Embed) TruncateDescription() *Embed + func (e *Embed) TruncateFields() *Embed + func (e *Embed) TruncateFooter() *Embed + func (e *Embed) TruncateTitle() *Embed + type ErrorHandler func(b *Bot, err interface{}) + type Language struct + Keys map[string]string + Name string + func NewLanguage(name string) *Language + func (l *Language) Get(key string, args ...interface{}) string + func (l *Language) GetDefault(key string, def string, args ...interface{}) string + func (l *Language) Merge(other *Language) *Language + func (l *Language) Set(key string, value string) *Language + type LocaleHandler func(b *Bot, m *discordgo.Message, dm bool) string + type Monitor struct + Enabled bool + GuildOnly bool + IgnoreBots bool + IgnoreEdits bool + IgnoreSelf bool + IgnoreWebhooks bool + Name string + Run MonitorHandler + func NewMonitor(name string, monitor MonitorHandler) *Monitor + func (m *Monitor) AllowBots() *Monitor + func (m *Monitor) AllowEdits() *Monitor + func (m *Monitor) AllowSelf() *Monitor + func (m *Monitor) AllowWebhooks() *Monitor + func (m *Monitor) SetGuildOnly(toggle bool) *Monitor + type MonitorContext struct + Author *discordgo.User + Bot *Bot + Channel *discordgo.Channel + Guild *discordgo.Guild + Message *discordgo.Message + Monitor *Monitor + Session *discordgo.Session + type MonitorHandler func(bot *Bot, ctx *MonitorContext) + type Paginator struct + AuthorID string + ChannelID string + Extra string + Message *discordgo.Message + Pages []*discordgo.MessageEmbed + Running bool + Session *discordgo.Session + StopChan chan bool + Template func() *Embed + Timeout time.Duration + func NewPaginator(session *discordgo.Session, channel, author string) *Paginator + func NewPaginatorForContext(ctx *CommandContext) *Paginator + func (p *Paginator) AddPage(fn func(em *Embed) *Embed) + func (p *Paginator) AddPageString(str string) + func (p *Paginator) GetIndex() int + func (p *Paginator) Goto(index int) + func (p *Paginator) NextPage() + func (p *Paginator) PreviousPage() + func (p *Paginator) Run() + func (p *Paginator) SetExtra(extra string) + func (p *Paginator) SetFooter() + func (p *Paginator) SetTemplate(em func() *Embed) + func (p *Paginator) Stop() + type Permissions int + func PermissionsForMember(guild *discordgo.Guild, member *discordgo.Member) Permissions + func PermissionsForRole(role *discordgo.Role) Permissions + func (perms Permissions) Has(bits int) bool + type PrefixHandler func(b *Bot, m *discordgo.Message, dm bool) string + type UsageTag struct + Name string + Required bool + Rest bool + Type string + func ParseUsage(usage string) ([]*UsageTag, error)