Documentation
¶
Index ¶
- type Command
- func (c Command) Build() *discordgo.ApplicationCommand
- func (c Command) HandleCommand(ctx context.Context, session *discordgo.Session, ...) error
- func (c Command) HandleInteractions(ctx context.Context, session *discordgo.Session, ...) error
- func (c Command) MatchInteraction(id string) bool
- func (c Command) Name() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct { OverriderRole string PlayerCounter interface { CountPlayers(ctx context.Context) (int, error) } Restarter interface { Restart(ctx context.Context) error } MessageSender interface { SendMessage(ctx context.Context, msg string) error } }
Command for restarting a server on user requests
func (Command) Build ¶
func (c Command) Build() *discordgo.ApplicationCommand
Build the Command for installing
func (Command) HandleCommand ¶
func (c Command) HandleCommand(ctx context.Context, session *discordgo.Session, i *discordgo.InteractionCreate) error
HandleCommand handles the initial event
func (Command) HandleInteractions ¶
func (c Command) HandleInteractions(ctx context.Context, session *discordgo.Session, i *discordgo.InteractionCreate) error
HandleInteractions handles follow-up interactions with the original message
func (Command) MatchInteraction ¶
MatchInteraction returns if the Command can handle the interaction
Click to show internal directories.
Click to hide internal directories.