Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot struct { Session *discordgo.Session Cfg *config.Config Repo repository.Repository Svc service.Service Cron *cron.Cron }
type Command ¶
type Command interface { // Invokes returns a list of strings that can be used to invoke the command, all of which are case-insensitive. Invokes() []string // Description returns a short description of the command. Description() string // Exec executes the command. Exec(ctx *Context) error // Is required admin permission to execute the command. IsAdminRequired() bool }
type CommandHandler ¶
type CommandHandler struct { OnError func(ctx *Context, err error) // contains filtered or unexported fields }
func NewCommandHandler ¶
func NewCommandHandler(prefix string) *CommandHandler
NewCommandHandler creates a new CommandHandler.
func (*CommandHandler) GetCommands ¶
func (c *CommandHandler) GetCommands() []Command
func (*CommandHandler) HandleMessage ¶
func (c *CommandHandler) HandleMessage(s *discordgo.Session, e *discordgo.MessageCreate)
func (*CommandHandler) RegisterCommand ¶
func (c *CommandHandler) RegisterCommand(cmd Command)
func (*CommandHandler) RegisterMiddleware ¶
func (c *CommandHandler) RegisterMiddleware(mw Middleware)
Click to show internal directories.
Click to hide internal directories.