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) InteractionCreate(ic *gateway.InteractionCreateEvent)
- func (bot *Bot) MessageCreate(m *gateway.MessageCreateEvent)
- func (bot *Bot) Prefixer(m discord.Message) (n int)
- func (bot *Bot) PrefixesFor(id discord.GuildID) (s []string)
- func (bot *Bot) Report(ctx *bcr.Context, err error) *sentry.EventID
- type StatsClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot struct { *bcrbot.Bot Config common.Config DB *db.DB Sentry *sentry.Hub UseSentry bool Guilds map[discord.GuildID]discord.Guild GuildsMu sync.Mutex Stats *StatsClient Helper *helper.Helper StartStopLog *webhook.Client // contains filtered or unexported fields }
Bot is the main bot struct
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) InteractionCreate ¶
func (bot *Bot) InteractionCreate(ic *gateway.InteractionCreateEvent)
InteractionCreate is called when an interaction create event is received.
func (*Bot) MessageCreate ¶
func (bot *Bot) MessageCreate(m *gateway.MessageCreateEvent)
MessageCreate is run when a message is created and handles commands
func (*Bot) PrefixesFor ¶
PrefixesFor returns the prefixes for the given server
type StatsClient ¶
StatsClient is an InfluxDB client
func (*StatsClient) IncAPICall ¶
func (c *StatsClient) IncAPICall()
IncAPICall increments the API call count by one
func (*StatsClient) IncCommand ¶
func (c *StatsClient) IncCommand()
IncCommand increments the command count by one
func (*StatsClient) IncQuery ¶
func (c *StatsClient) IncQuery()
IncQuery increments the query count by one
Source Files
¶
Click to show internal directories.
Click to hide internal directories.