Documentation
¶
Index ¶
- type Command
- type Context
- type Ctx
- func (c *Ctx) Channel() (channel *discordgo.Channel, err error)
- func (c *Ctx) Command() Command
- func (r *Ctx) GetEphemeral() bool
- func (r *Ctx) GetEvent() *discordgo.InteractionCreate
- func (r *Ctx) GetKommando() *Kommando
- func (r *Ctx) GetSession() *discordgo.Session
- func (c *Ctx) Guild() (guild *discordgo.Guild, err error)
- func (c *Ctx) Options() []*discordgo.ApplicationCommandInteractionDataOption
- func (r *Ctx) Respond(res *discordgo.InteractionResponse) (err error)
- func (r *Ctx) RespondEmbed(embed *discordgo.MessageEmbed) (err error)
- func (r *Ctx) RespondError(content, title string) (err error)
- func (r *Ctx) RespondMessage(content string) (err error)
- func (r *Ctx) SetEphemeral(v bool)
- func (c *Ctx) SlashCommand() SlashCommand
- func (c *Ctx) User() (user *discordgo.User, err error)
- type EmbedColors
- type Kommando
- type Options
- type Responder
- type SlashCommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command interface {
// Name returns the name of the command
Name() string
// Description returns the description of the command
Description() string
// Exec executes the command, pass the discordgo.Interaction
Exec(ctx Context) (err error)
}
Command is an interface that all commands must implement
type Context ¶
type Context interface {
Responder
Channel() (channel *discordgo.Channel, err error)
Guild() (guild *discordgo.Guild, err error)
User() (user *discordgo.User, err error)
Options() []*discordgo.ApplicationCommandInteractionDataOption
Command() Command
SlashCommand() SlashCommand
}
Context holds our data from the interaction neatly in one object
type Ctx ¶
type Ctx struct {
// contains filtered or unexported fields
}
func (*Ctx) GetEphemeral ¶
func (r *Ctx) GetEphemeral() bool
func (*Ctx) GetEvent ¶
func (r *Ctx) GetEvent() *discordgo.InteractionCreate
func (*Ctx) GetKommando ¶
func (r *Ctx) GetKommando() *Kommando
func (*Ctx) GetSession ¶
func (*Ctx) Options ¶
func (c *Ctx) Options() []*discordgo.ApplicationCommandInteractionDataOption
func (*Ctx) Respond ¶
func (r *Ctx) Respond(res *discordgo.InteractionResponse) (err error)
func (*Ctx) RespondEmbed ¶
func (r *Ctx) RespondEmbed(embed *discordgo.MessageEmbed) (err error)
func (*Ctx) RespondError ¶
func (*Ctx) RespondMessage ¶
func (*Ctx) SetEphemeral ¶
func (r *Ctx) SetEphemeral(v bool)
func (*Ctx) SlashCommand ¶
func (c *Ctx) SlashCommand() SlashCommand
type EmbedColors ¶
type Kommando ¶
type Kommando struct {
// contains filtered or unexported fields
}
func (*Kommando) RegisterCommands ¶
func (*Kommando) UnregisterCommands ¶
func (c *Kommando) UnregisterCommands()
type Options ¶
type Options struct {
State state.State
CommandStore store.CommandStore
EmbedColors EmbedColors
OnSystemError func(err error)
OnCommandError func(ctx Context, err error)
}
type Responder ¶
type Responder interface {
Respond(r *discordgo.InteractionResponse) (err error)
RespondMessage(content string) (err error)
RespondEmbed(embed *discordgo.MessageEmbed) (err error)
RespondError(content, title string) (err error)
GetSession() *discordgo.Session
GetEvent() *discordgo.InteractionCreate
GetKommando() *Kommando
GetEphemeral() bool
SetEphemeral(v bool)
}
Responder handles responding and follow up messages
type SlashCommand ¶
type SlashCommand interface {
Command
Version() string
Options() []*discordgo.ApplicationCommandOption
}
Click to show internal directories.
Click to hide internal directories.