Documentation ¶
Index ¶
- type Command
- type DiscordClient
- func (c *DiscordClient) Command(name string) Command
- func (c *DiscordClient) Connect() error
- func (c *DiscordClient) Connection() *discordgo.Session
- func (c *DiscordClient) HasCommand(name string) bool
- func (c *DiscordClient) HasMenuCommand(id string) bool
- func (c *DiscordClient) MenuCommand(id string) MenuCommand
- func (c *DiscordClient) RegisterCommand(name string, command Command)
- func (c *DiscordClient) RegisterMenuCommand(id string, command MenuCommand)
- func (c *DiscordClient) UnregisterMenuCommand(id string)
- type MenuCommand
- type MenuCommandData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiscordClient ¶
type DiscordClient struct {
// contains filtered or unexported fields
}
DiscordClient is the main interface of the bot.
func NewClient ¶
func NewClient(token string) (*DiscordClient, error)
NewClient creates a new instance of the Discord client.
func (*DiscordClient) Command ¶
func (c *DiscordClient) Command(name string) Command
Command gets the specified command.
func (*DiscordClient) Connect ¶
func (c *DiscordClient) Connect() error
Connect opens the connection to the Discord gateway.
func (*DiscordClient) Connection ¶
func (c *DiscordClient) Connection() *discordgo.Session
Connection gets the Discord connection.
func (*DiscordClient) HasCommand ¶
func (c *DiscordClient) HasCommand(name string) bool
HasCommand returns whether the specified command is registered.
func (*DiscordClient) HasMenuCommand ¶
func (c *DiscordClient) HasMenuCommand(id string) bool
HasMenuCommand returns whether a menu command is registered.
func (*DiscordClient) MenuCommand ¶
func (c *DiscordClient) MenuCommand(id string) MenuCommand
MenuCommand gets a menu command with the specified ID.
func (*DiscordClient) RegisterCommand ¶
func (c *DiscordClient) RegisterCommand(name string, command Command)
RegisterCommand registers a bot command.
func (*DiscordClient) RegisterMenuCommand ¶
func (c *DiscordClient) RegisterMenuCommand(id string, command MenuCommand)
RegisterMenuCommand registeres a menu command.
func (*DiscordClient) UnregisterMenuCommand ¶
func (c *DiscordClient) UnregisterMenuCommand(id string)
UnregisterMenuCommand unregisters a menu command.
type MenuCommand ¶
MenuCommand is the handler for a menu command.
type MenuCommandData ¶
MenuCommandData stores data to be used between different stages of a menu command.