Documentation ¶
Overview ¶
Package commandhelper provides tools for creating command-based Discord bots
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotInitialized = errors.New("bot not yet initialized, use AddHandler on Bot.ReadyHandler") // HelpCommand the prints the help menu // // It is bundled by default by NewBot(). HelpCommand = Command{ Usage: "[command]", Description: "prints the help menu or given command's usage", Action: HelpAction, } )
Functions ¶
Types ¶
type Bot ¶
type Bot struct { Name string // Name shown in help menu Description string // Description shown in help menu Commands map[string]Command // Mapping of command name to Command // contains filtered or unexported fields }
Bot is the main structure of a discord bot. It is recommended to create these using NewBot
func (*Bot) MessageHandler ¶
func (bot *Bot) MessageHandler(s *discordgo.Session, m *discordgo.MessageCreate)
MessageHandler reads the configuration of bot to determine how to parse input. Feed this into AddHandler after configuring your bot.
func (*Bot) ReadyHandler ¶
ReadyHandler gives the bot data made available after opening the discordgo.Session.
Feed this into AddHandler after configuring your bot.
Click to show internal directories.
Click to hide internal directories.