Documentation
¶
Index ¶
- func MatchesCommandPath(commandData discordgo.ApplicationCommandInteractionData, path []string) bool
- type InteractionResponder
- type SlashCommandHandler
- type SlashCommandMiddleware
- type SlashCommandRegistry
- func (r *SlashCommandRegistry) AttachToDiscord(discord *discordgo.Session) (removeHandler func())
- func (r *SlashCommandRegistry) OnInteraction(responder InteractionResponder, i *discordgo.InteractionCreate)
- func (r *SlashCommandRegistry) RegisterCommand(path []string, handler SlashCommandHandler)
- func (r *SlashCommandRegistry) RegisterMidleware(middleware SlashCommandMiddleware)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MatchesCommandPath ¶
func MatchesCommandPath(commandData discordgo.ApplicationCommandInteractionData, path []string) bool
Types ¶
type InteractionResponder ¶
type InteractionResponder interface {
InteractionRespond(interaction *discordgo.Interaction, resp *discordgo.InteractionResponse) error
}
type SlashCommandHandler ¶
type SlashCommandHandler = SlashCommandMiddleware
type SlashCommandMiddleware ¶
type SlashCommandMiddleware func( interaction *discordgo.InteractionCreate, options map[string]*discordgo.ApplicationCommandInteractionDataOption, ) (*discordgo.InteractionResponse, error)
type SlashCommandRegistry ¶
func NewSlashCommandRegistry ¶
func NewSlashCommandRegistry() *SlashCommandRegistry
func (*SlashCommandRegistry) AttachToDiscord ¶
func (r *SlashCommandRegistry) AttachToDiscord(discord *discordgo.Session) (removeHandler func())
func (*SlashCommandRegistry) OnInteraction ¶
func (r *SlashCommandRegistry) OnInteraction(responder InteractionResponder, i *discordgo.InteractionCreate)
func (*SlashCommandRegistry) RegisterCommand ¶
func (r *SlashCommandRegistry) RegisterCommand(path []string, handler SlashCommandHandler)
func (*SlashCommandRegistry) RegisterMidleware ¶
func (r *SlashCommandRegistry) RegisterMidleware(middleware SlashCommandMiddleware)
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package mock_slash_commands is a generated GoMock package.
|
Package mock_slash_commands is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.