Documentation
¶
Index ¶
- Constants
- Variables
- func CheckRole(roles []string, requiredRole string) bool
- func DeferredMessage() (discordgo.InteractionResponse, error)
- func SendDeferredMessage(appID string, token string, content string, opts ...Option) error
- func SendDeferredMessageWithComponents(appID string, token string, content string, opts ...Option) error
- type Command
- type Option
Constants ¶
View Source
const ( DiscordBaseURL = "https://discord.com/api" ErrMissingRole = "You don't have the required role to use this command!" )
Variables ¶
View Source
var ( Commands = map[string]Command{ "coinflip": { Command: discordgo.ApplicationCommand{ Name: "coinflip", Description: "Flip a coin", }, Handler: coinflip, Options: nil, }, "ping": { Command: discordgo.ApplicationCommand{ Name: "ping", Description: "Pong!", }, Handler: ping, Options: nil, }, "roll": { Command: discordgo.ApplicationCommand{ Name: "roll", Description: "Roll the dice", Options: []*discordgo.ApplicationCommandOption{ { Type: discordgo.ApplicationCommandOptionString, Name: "dice", Description: "Amount of dice to roll plus modifiers", Required: true, }, }, }, Handler: roll, Options: nil, }, } )
Functions ¶
func DeferredMessage ¶
func DeferredMessage() (discordgo.InteractionResponse, error)
func SendDeferredMessage ¶
Types ¶
type Command ¶
type Command struct { Command discordgo.ApplicationCommand Handler func(*discordgo.Interaction, ...Option) (string, error) Options map[string]func(*discordgo.Interaction, ...Option) (string, error) }
Click to show internal directories.
Click to hide internal directories.