core

package
v0.0.0-...-e28099a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command func(connection *discordgo.Session, message *discordgo.Message, args []string)

Command is the handler for a bot command.

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 func(message *discordgo.Message, args []string)

MenuCommand is the handler for a menu command.

type MenuCommandData struct {
	Log     []string
	Message *discordgo.Message
}

MenuCommandData stores data to be used between different stages of a menu command.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL