Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RegexArguments = regexp.MustCompile("(\"[^\"]+\"|[^\\s]+)") RegexUserMention = regexp.MustCompile("<@!?(\\d+)>") RegexRoleMention = regexp.MustCompile("<@&(\\d+)>") RegexChannelMention = regexp.MustCompile("<#(\\d+)>") RegexSnowflakeID = regexp.MustCompile("[\\d]{18}") )
Functions ¶
This section is empty.
Types ¶
type ApplicationCommandOption ¶
type ApplicationCommandOption struct {
Type discordgo.ApplicationCommandOptionType `json:"type"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
// NOTE: This feature was on the API, but at some point developers decided to remove it.
// So I commented it, until it will be officially on the docs.
// Default bool `json:"default"`
Required bool `json:"required"`
Choices []*discordgo.ApplicationCommandOptionChoice `json:"choices"`
Options []*ApplicationCommandOption `json:"options"`
Handler func(*Ctx)
}
type Category ¶
type Category struct {
Name string
ID string
Description string
HelpEmoji string
Commands []*Command
RegisterCmds func(c *Category)
}
func (*Category) AddCommand ¶
func (*Category) GetCommand ¶
type Command ¶
type Command struct {
ID string
ApplicationID string
Type discordgo.ApplicationCommandType
Name string
Description string
Version string
Options []*ApplicationCommandOption
Handler func(*Ctx)
}
func (*Command) ToApplicationCommand ¶
func (c *Command) ToApplicationCommand() *discordgo.ApplicationCommand
type Ctx ¶
type Ctx struct {
Options []*discordgo.ApplicationCommandInteractionDataOption
Session *discordgo.Session
Interaction *discordgo.InteractionCreate
Router *Router
Guild *discordgo.Guild
Channel *discordgo.Channel
User *discordgo.User
}
func (*Ctx) EditResponse ¶
func (ctx *Ctx) EditResponse(newrsp *discordgo.WebhookEdit)
func (*Ctx) Respond ¶
func (ctx *Ctx) Respond(itype discordgo.InteractionResponseType, data *discordgo.InteractionResponseData)
func (*Ctx) WaitForResponse ¶
func (ctx *Ctx) WaitForResponse() *discordgo.MessageCreate
type Router ¶
type Router struct {
Cateories []*Category
Uncategorized []*Command
AllCommands []*Command
Session *discordgo.Session
}
func (*Router) AddCategory ¶
func (*Router) AddCommand ¶
func (*Router) GetCategory ¶
func (*Router) GetCommand ¶
func (*Router) RegisterAllCommands ¶
Click to show internal directories.
Click to hide internal directories.