Documentation ¶
Overview ¶
Package bot contains the general workings of a Snart Bot.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Log = minori.GetLogger("bot")
Log is the logger for the bot package.
View Source
var Plugins = make(map[string]Plugin)
Plugins holds the plugins to be loaded into a Bot on startup.
Functions ¶
func GamerUptime ¶
GamerUptime is an example Gamer that shows the Bot's uptime.
Types ¶
type Bot ¶
type Bot struct { DB *db.DB Session *dg.Session Router *route.Router Gamers []Gamer Interrupt chan Interrupt Startup time.Time }
Bot holds all the internal workings of a Snart bot.
func (*Bot) Admin ¶
Admin checks if the author has bot-wide admin privileges. (implements route.Okay)
func (*Bot) CycleGamers ¶
func (b *Bot) CycleGamers()
CycleGamers cycles through displaying the Gamers registered on the Bot.
func (*Bot) NotifyInterrupt ¶
NotifyInterrupt uses signal.Notify and a pipe goroutine to send OS-level interrupts on the Bot's Interrupt.
func (*Bot) Route ¶
func (b *Bot) Route(s *dg.Session, m *dg.MessageCreate)
Route is an event handler for dispatching a *dg.MessageCreate to the Bot's Router.
Click to show internal directories.
Click to hide internal directories.