Documentation ¶
Index ¶
- func ArgsSplitter(in string) []string
- type CCConfig
- type Command
- type CommandGroup
- type CommandGroupContainer
- type CommandHandler
- type Commander
- func (c *Commander) Close()
- func (c *Commander) GetPlugin(name string) (interface{}, error)
- func (c *Commander) HandleError(f func(error))
- func (c *Commander) Help(m *MessageContext, args []string) error
- func (c *Commander) LoadPlugin(name string) error
- func (c *Commander) Open() error
- func (c *Commander) RegisterCommand(groupName string) func(activator string, handler CommandHandler, help string) error
- func (c *Commander) SetupPlugin(...)
- type GetPlugin
- type MessageContext
- type RegisterCommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArgsSplitter ¶
Types ¶
type Command ¶ added in v1.1.0
type Command struct { Handler CommandHandler Help string }
type CommandGroup ¶
type CommandGroupContainer ¶ added in v1.1.0
type CommandGroupContainer struct {
// contains filtered or unexported fields
}
type CommandHandler ¶
type CommandHandler func(*MessageContext, []string) error
type Commander ¶
type Commander struct { OnError func(error) // contains filtered or unexported fields }
func NewCommander ¶
Make a new instance of a commander, which will contain a connection to discord.
func (*Commander) HandleError ¶
func (*Commander) LoadPlugin ¶
Attempt to load a .so plugin from the disk and set it up
func (*Commander) RegisterCommand ¶
func (*Commander) SetupPlugin ¶
func (c *Commander) SetupPlugin(setup func(RegisterCommand, GetPlugin, *discordgo.Session) (CommandGroup, string), name string)
Register the plugin into the list of 'groups' (read: plugins)
type MessageContext ¶
type MessageContext struct { *discordgo.MessageCreate // contains filtered or unexported fields }
type RegisterCommand ¶
type RegisterCommand func(string, CommandHandler, string) error
Click to show internal directories.
Click to hide internal directories.