Documentation ¶
Index ¶
- type Feature
- type SCM
- func (s *SCM) AddFeature(f *Feature) error
- func (s *SCM) AddFeatures(ff []*Feature) error
- func (s *SCM) CreateCommands(c *discordgo.Session, guildID string) error
- func (s *SCM) DeleteCommands(c *discordgo.Session, guildID string) error
- func (s *SCM) HandleInteractionCreate(c *discordgo.Session, i *discordgo.InteractionCreate)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Feature ¶
type Feature struct { Type discordgo.InteractionType // Handler function for feature interactions Handler func(*discordgo.Session, *discordgo.InteractionCreate) // ApplicationCommand if Type is discordgo.InteractionApplicationCommand // or discordgo.InteractionApplicationCommandAutocomplete. // Not needed for Type discordgo.InteractionMessageComponent. ApplicationCommand *discordgo.ApplicationCommand // CustomID if Type is discordgo.InteractionMessageComponent. // It is in glob format. Use "" (zero string) or "*" to match all CustomIDs CustomID string // contains filtered or unexported fields }
Feature is a handler for various events
type SCM ¶
type SCM struct { Features []*Feature // contains filtered or unexported fields }
func (*SCM) AddFeature ¶
AddFeature adds a Feature to the SCM.
func (*SCM) AddFeatures ¶
func (*SCM) CreateCommands ¶
CreateCommands registers any commands (Features with Type discordgo.InteractionApplicationCommand or discordgo.InteractionApplicationCommandAutocomplete) with the API. Leave guildID as empty string for global commands. Session must already be connected beforehand.
func (*SCM) DeleteCommands ¶
DeleteCommands deregisters any commands registered using CreateCommands with the API.
func (*SCM) HandleInteractionCreate ¶
func (s *SCM) HandleInteractionCreate(c *discordgo.Session, i *discordgo.InteractionCreate)
Click to show internal directories.
Click to hide internal directories.