Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Discord ¶
Discord represents a thin wrapper around a Discord client.
func NewDiscord ¶
NewDiscord initializes the Discord client with a given token and guild identifier. It validates that the bot has the access it needs to function within the guild.
func (*Discord) Listen ¶
Listen executes the core components of the Discord bot. It waits for interactions and subsequently acts on them.
func (*Discord) RegisterSlashCommand ¶
func (d *Discord) RegisterSlashCommand(cmd *SlashCommand) error
RegisterSlashCommand associates a command with the server, ensuring it is created and subsequently deleted whenever the application stops.
type SlashCommand ¶
type SlashCommand struct { Name string Description string Options []*discordgo.ApplicationCommandOption Handler func(d *Discord, i *discordgo.InteractionCreate) error }
SlashCommand is a custom struct definition for all slash command based interactions.
Click to show internal directories.
Click to hide internal directories.