Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct { Name string `json:"name"` Description string `json:"description"` Method string `json:"method"` URL string `json:"url"` Body Params `json:"body,omitempty"` BodyTemplate string `json:"body_template,omitempty"` Query Params `json:"query,omitempty"` Form Params `json:"form,omitempty"` Headers Headers `json:"headers,omitempty"` ParseJSON ParseJSONResponse `json:"parse_json,omitempty"` ResponseTemplate string `json:"response_template,omitempty"` }
func (*Command) ToApplicationCommand ¶
func (c *Command) ToApplicationCommand() (*discordgo.ApplicationCommand, error)
type Commands ¶
type Commands []Command
func LoadConfigs ¶
LoadConfigs loads all .json files in the given directory and returns them as a list of Command structs.
func (Commands) FindByName ¶
func (Commands) ToApplicationCommands ¶
func (c Commands) ToApplicationCommands() ([]*discordgo.ApplicationCommand, error)
type Param ¶
type Param struct { Name string `json:"name"` Description string `json:"description"` Type string `json:"type"` Required bool `json:"required,omitempty"` Options []string `json:"options,omitempty"` Default any `json:"default,omitempty"` }
func (*Param) ToApplicationCommandOption ¶
func (p *Param) ToApplicationCommandOption() (*discordgo.ApplicationCommandOption, error)
type Params ¶
type Params []Param
func (Params) ToApplicationCommandOptions ¶
func (p Params) ToApplicationCommandOptions() ([]*discordgo.ApplicationCommandOption, error)
Click to show internal directories.
Click to hide internal directories.