Documentation ¶
Overview ¶
Package bot contains the bot's core functionality.
Index ¶
- type Bot
- func (bot *Bot) Add(f func(*Bot) (string, []*bcr.Command))
- func (bot *Bot) GuildCreate(g *gateway.GuildCreateEvent)
- func (bot *Bot) GuildDelete(g *gateway.GuildDeleteEvent)
- func (bot *Bot) MessageCreate(m *gateway.MessageCreateEvent)
- func (bot *Bot) Report(ctx *bcr.Context, err error) *sentry.EventID
- func (bot *Bot) UpdateStatus(name string, s gateway.Status) (err error)
- type Module
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot struct { *bcrbot.Bot Sugar *zap.SugaredLogger Config *structs.BotConfig DB *db.Db Sentry *sentry.Hub UseSentry bool }
Bot is the main bot struct
func New ¶
func New( bot *bcrbot.Bot, s *zap.SugaredLogger, config *structs.BotConfig, db *db.Db, hub *sentry.Hub) *Bot
New creates a new instance of Bot
func (*Bot) GuildCreate ¶
func (bot *Bot) GuildCreate(g *gateway.GuildCreateEvent)
GuildCreate logs the bot joining a server, and creates a database entry if one doesn't exist
func (*Bot) GuildDelete ¶
func (bot *Bot) GuildDelete(g *gateway.GuildDeleteEvent)
GuildDelete logs the bot leaving a server and deletes the database entry
func (*Bot) MessageCreate ¶
func (bot *Bot) MessageCreate(m *gateway.MessageCreateEvent)
MessageCreate is run when a message is created and handles commands
Click to show internal directories.
Click to hide internal directories.