Documentation
¶
Index ¶
- func NewEmbedFields(name string, value string, isInline bool) *discordgo.MessageEmbedField
- func NewEmbedFooter(text string, iconUrl string) *discordgo.MessageEmbedFooter
- func NewEmbedImage(url string, width int, height int) *discordgo.MessageEmbedImage
- func NewEmbedProvider(url string, name string) *discordgo.MessageEmbedProvider
- func NewEmbedThumbnail(url string, width int, height int) *discordgo.MessageEmbedThumbnail
- func NewEmbedVideo(url string, width int, height int) *discordgo.MessageEmbedVideo
- type ActionRow
- type Bot
- type Button
- func (b *Button) AnyEmoji(emoji Emoji) *Button
- func (b *Button) GetComponent() interface{}
- func (b *Button) SetDisabled() *Button
- func (b *Button) SetID(id string) *Button
- func (b *Button) SetLabel(label string) *Button
- func (b *Button) SetStyle(style discordgo.ButtonStyle) *Button
- func (b *Button) SetURL(url string) *Button
- type CommandGroup
- type CommandManager
- type Component
- type Ctx
- func (c *Ctx) FlagEphemeral() *Ctx
- func (c *Ctx) FlagReply(flag discordgo.MessageFlags) *Ctx
- func (c *Ctx) Send() error
- func (c *Ctx) SetComponents(actionRows []Component) (*Ctx, error)
- func (c *Ctx) SetContent(content string) *Ctx
- func (c *Ctx) SetCustomID(id string) *Ctx
- func (c *Ctx) SetFiles(files []*discordgo.File) *Ctx
- func (c *Ctx) SetMessageEmbeds(embeds []*discordgo.MessageEmbed)
- func (c *Ctx) SetResponseType(responseType discordgo.InteractionResponseType) *Ctx
- func (c *Ctx) SetTTS() *Ctx
- func (c *Ctx) SetTitle(title string) *Ctx
- type Emoji
- type MessageEmbed
- func (m *MessageEmbed) GetComponent() *discordgo.MessageEmbed
- func (m *MessageEmbed) SetAuthor(author *discordgo.MessageEmbedAuthor) *MessageEmbed
- func (m *MessageEmbed) SetColor(color int) *MessageEmbed
- func (m *MessageEmbed) SetDescription(description string) *MessageEmbed
- func (m *MessageEmbed) SetFields(fields []*discordgo.MessageEmbedField) *MessageEmbed
- func (m *MessageEmbed) SetFooter(footer *discordgo.MessageEmbedFooter) *MessageEmbed
- func (m *MessageEmbed) SetImage(image *discordgo.MessageEmbedImage) *MessageEmbed
- func (m *MessageEmbed) SetProvider(provider *discordgo.MessageEmbedProvider) *MessageEmbed
- func (m *MessageEmbed) SetThumbnail(thumbnail *discordgo.MessageEmbedThumbnail) *MessageEmbed
- func (m *MessageEmbed) SetTimestamp(timestamp string) *MessageEmbed
- func (m *MessageEmbed) SetTitle(title string) *MessageEmbed
- func (m *MessageEmbed) SetType(embedType discordgo.EmbedType) *MessageEmbed
- func (m *MessageEmbed) SetURL(url string) *MessageEmbed
- func (m *MessageEmbed) SetVideo(video *discordgo.MessageEmbedVideo) *MessageEmbed
- type MessageEmbedAuthor
- type SelectMenu
- func (sm *SelectMenu) AddChannelTypes(channelTypes []discordgo.ChannelType) *SelectMenu
- func (sm *SelectMenu) AddDefaultValue(id string, valueType discordgo.SelectMenuDefaultValueType) *SelectMenu
- func (sm *SelectMenu) AddID(id string) *SelectMenu
- func (sm *SelectMenu) AddOptions(options []SelectMenuOption) *SelectMenu
- func (sm *SelectMenu) GetComponent() interface{}
- func (sm *SelectMenu) PlaceHolder(placeholder string)
- func (sm *SelectMenu) SetMinMax(min int, max int) *SelectMenu
- type SelectMenuOption
- type SlashCommand
- type TextInput
- func (t *TextInput) GetComponent() interface{}
- func (t *TextInput) Required() *TextInput
- func (t *TextInput) SetLabel(label string) *TextInput
- func (t *TextInput) SetMinMax(min int, max int) *TextInput
- func (t *TextInput) SetPlaceholder(placeholder string) *TextInput
- func (t *TextInput) SetStyle(style discordgo.TextInputStyle) *TextInput
- func (t *TextInput) SetValue(value string) *TextInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEmbedFields ¶
func NewEmbedFields(name string, value string, isInline bool) *discordgo.MessageEmbedField
Returns the Field for the MessageEmbed
func NewEmbedFooter ¶
func NewEmbedFooter(text string, iconUrl string) *discordgo.MessageEmbedFooter
Returns the Footer for the MessageEmbed
func NewEmbedImage ¶
func NewEmbedImage(url string, width int, height int) *discordgo.MessageEmbedImage
Returns the Image for the MessageEmbed
func NewEmbedProvider ¶
func NewEmbedProvider(url string, name string) *discordgo.MessageEmbedProvider
Returns the Provider for the MessageEmbed
func NewEmbedThumbnail ¶
func NewEmbedThumbnail(url string, width int, height int) *discordgo.MessageEmbedThumbnail
Returns the Thumbnail for the MessageEmbed
func NewEmbedVideo ¶
func NewEmbedVideo(url string, width int, height int) *discordgo.MessageEmbedVideo
Returns the Video for the MessageEmbed
Types ¶
type ActionRow ¶
type ActionRow struct {
// contains filtered or unexported fields
}
Represent a ActionRow
func (*ActionRow) AddComponent ¶
Adds a component to the ActionRow
func (*ActionRow) GetComponent ¶
func (r *ActionRow) GetComponent() interface{}
Method used to get the ActionRow components which represent a discordgo.ActionsRow structure
type Bot ¶
type Bot struct {
CommandManager *CommandManager
Session *discordgo.Session
// contains filtered or unexported fields
}
Bot is the main struct for interacting with Discord. It holds the bot's token and command manager.
func NewBot ¶
func NewBot(token string, manager *CommandManager) (*Bot, error)
NewBot creates a new Bot with the provided token and command manager.
type Button ¶
type Button struct {
// contains filtered or unexported fields
}
Represents a Button Component
func (*Button) GetComponent ¶
func (b *Button) GetComponent() interface{}
Returns the Button Component
type CommandGroup ¶
type CommandGroup struct {
Name string
Description string
GuildId string
SlashCommands []*SlashCommand
// contains filtered or unexported fields
}
Command Group to manage related commands like grouping a set of commands for a guild,moderation, utils, user etc.
func NewCommandGroup ¶
func NewCommandGroup(name string, description string, guildId string) *CommandGroup
Creates a new Command Group with the given name, description, and Guild ID.
func (*CommandGroup) AddCommand ¶
func (cg *CommandGroup) AddCommand(command *SlashCommand)
Adds a Slash Command to the command group.
type CommandManager ¶
type CommandManager struct {
// contains filtered or unexported fields
}
Represents a root command manager for the bot. It holds all the information needed to create & execute commands.
func NewCommandManager ¶
func NewCommandManager() *CommandManager
Creates a new instance of CommandManager.
func (*CommandManager) AddGroup ¶
func (cm *CommandManager) AddGroup(group *CommandGroup)
Adds a command group to the command manager.
func (*CommandManager) AddMessageComponentInteractionHandler ¶
func (cm *CommandManager) AddMessageComponentInteractionHandler(handler func(c *Ctx))
func (*CommandManager) AddModalInteractionHandler ¶
func (cm *CommandManager) AddModalInteractionHandler(handler func(c *Ctx))
func (*CommandManager) FindCommand ¶
func (cm *CommandManager) FindCommand(name string) func(ctx *Ctx)
Finds a command by its name. Returns the handler function if found, nil otherwise.
type Ctx ¶
type Ctx struct {
Session *discordgo.Session // Client Session
Interaction *discordgo.InteractionCreate // Interaction Create struct
// contains filtered or unexported fields
}
Represents callback ctx for Slash Command Handlers
func (*Ctx) FlagEphemeral ¶
Flags the interaction response as ephemeral.
func (*Ctx) FlagReply ¶
func (c *Ctx) FlagReply(flag discordgo.MessageFlags) *Ctx
Adds message flags to the response.
func (*Ctx) SetComponents ¶
Adds the components to the interaction response.
func (*Ctx) SetContent ¶
Sets the content of the interaction response.
func (*Ctx) SetCustomID ¶
Adds a customId to the interaction response
func (*Ctx) SetMessageEmbeds ¶
func (c *Ctx) SetMessageEmbeds(embeds []*discordgo.MessageEmbed)
Sets message embeds to the interaction response.
func (*Ctx) SetResponseType ¶
func (c *Ctx) SetResponseType(responseType discordgo.InteractionResponseType) *Ctx
Sets the Interaction response type .
type MessageEmbed ¶
type MessageEmbed struct {
// contains filtered or unexported fields
}
Represents a message embed.
func (*MessageEmbed) GetComponent ¶
func (m *MessageEmbed) GetComponent() *discordgo.MessageEmbed
Returns the discordgo.MessageEmbed struct
func (*MessageEmbed) SetAuthor ¶
func (m *MessageEmbed) SetAuthor(author *discordgo.MessageEmbedAuthor) *MessageEmbed
Sets Author for the message embed
func (*MessageEmbed) SetColor ¶
func (m *MessageEmbed) SetColor(color int) *MessageEmbed
Sets Color for the message embed
func (*MessageEmbed) SetDescription ¶
func (m *MessageEmbed) SetDescription(description string) *MessageEmbed
Sets Description for the message embed
func (*MessageEmbed) SetFields ¶
func (m *MessageEmbed) SetFields(fields []*discordgo.MessageEmbedField) *MessageEmbed
// Sets Fields for the message embed
func (*MessageEmbed) SetFooter ¶
func (m *MessageEmbed) SetFooter(footer *discordgo.MessageEmbedFooter) *MessageEmbed
Sets Footer for the message embed
func (*MessageEmbed) SetImage ¶
func (m *MessageEmbed) SetImage(image *discordgo.MessageEmbedImage) *MessageEmbed
Sets Image for the message embed
func (*MessageEmbed) SetProvider ¶
func (m *MessageEmbed) SetProvider(provider *discordgo.MessageEmbedProvider) *MessageEmbed
Sets Provider for the message embed
func (*MessageEmbed) SetThumbnail ¶
func (m *MessageEmbed) SetThumbnail(thumbnail *discordgo.MessageEmbedThumbnail) *MessageEmbed
Sets Thumbnail for the message embed
func (*MessageEmbed) SetTimestamp ¶
func (m *MessageEmbed) SetTimestamp(timestamp string) *MessageEmbed
Sets Timestamp for the message embed
func (*MessageEmbed) SetTitle ¶
func (m *MessageEmbed) SetTitle(title string) *MessageEmbed
Sets Title for the message embed
func (*MessageEmbed) SetType ¶
func (m *MessageEmbed) SetType(embedType discordgo.EmbedType) *MessageEmbed
Sets type for the message embed
func (*MessageEmbed) SetURL ¶
func (m *MessageEmbed) SetURL(url string) *MessageEmbed
Sets URL for the message embed
func (*MessageEmbed) SetVideo ¶
func (m *MessageEmbed) SetVideo(video *discordgo.MessageEmbedVideo) *MessageEmbed
Sets Video for the message embed
type MessageEmbedAuthor ¶
type MessageEmbedAuthor struct {
// contains filtered or unexported fields
}
Represents a message embed auth
func NewEmbedAuthor ¶
func NewEmbedAuthor(author string) *MessageEmbedAuthor
Returns the MessageEmbedAuthor struct
func (*MessageEmbedAuthor) GetComponent ¶
func (a *MessageEmbedAuthor) GetComponent() interface{}
Returns the discordgo.MessageEmbedAuthor
func (*MessageEmbedAuthor) SetIcon ¶
func (a *MessageEmbedAuthor) SetIcon(icon string) *MessageEmbedAuthor
Sets Icon for the MessageEmbedAuthor
func (*MessageEmbedAuthor) SetURL ¶
func (a *MessageEmbedAuthor) SetURL(url string) *MessageEmbedAuthor
Sets URL for the MessageEmbedAuthor
type SelectMenu ¶
type SelectMenu struct {
// contains filtered or unexported fields
}
Represents a SelectMenu
func NewSelectMenu ¶
func NewSelectMenu(menuType discordgo.SelectMenuType) *SelectMenu
Create a new SelectMenu
func (*SelectMenu) AddChannelTypes ¶
func (sm *SelectMenu) AddChannelTypes(channelTypes []discordgo.ChannelType) *SelectMenu
Add channel types to Select Menu.
func (*SelectMenu) AddDefaultValue ¶
func (sm *SelectMenu) AddDefaultValue(id string, valueType discordgo.SelectMenuDefaultValueType) *SelectMenu
Sets Default value for the SelectMenu
func (*SelectMenu) AddID ¶
func (sm *SelectMenu) AddID(id string) *SelectMenu
Adds an ID to the select menu.
func (*SelectMenu) AddOptions ¶
func (sm *SelectMenu) AddOptions(options []SelectMenuOption) *SelectMenu
Adds options to the select menu
func (*SelectMenu) GetComponent ¶
func (sm *SelectMenu) GetComponent() interface{}
returns the SelectMenu component.
func (*SelectMenu) PlaceHolder ¶
func (sm *SelectMenu) PlaceHolder(placeholder string)
Adds placeholder to select menu
func (*SelectMenu) SetMinMax ¶
func (sm *SelectMenu) SetMinMax(min int, max int) *SelectMenu
Sets Min & Max values for SelectMenu
type SelectMenuOption ¶
type SelectMenuOption struct {
// contains filtered or unexported fields
}
Represents a SelectMenuOption
func NewSelectMenuOption ¶
func NewSelectMenuOption(label string, value string, description string) *SelectMenuOption
Creates a new SelectMenuOption
func (*SelectMenuOption) AnyEmoji ¶
func (sm *SelectMenuOption) AnyEmoji(emoji *Emoji) *SelectMenuOption
Adds emoji to options
func (*SelectMenuOption) Default ¶
func (sm *SelectMenuOption) Default() *SelectMenuOption
Mark the option as default selected for the SelectMenu
func (*SelectMenuOption) GetComponent ¶
func (sm *SelectMenuOption) GetComponent() discordgo.SelectMenuOption
type SlashCommand ¶
type SlashCommand struct {
Command *discordgo.ApplicationCommand // Slash Command information
Handler func(ctx *Ctx) // Handler function to handle any interaction
}
Represents a Slash Command for the bot
func NewSlashCommand ¶
func NewSlashCommand(command discordgo.ApplicationCommand) *SlashCommand
Creates a new Slash Command
func (*SlashCommand) SetHandler ¶
func (c *SlashCommand) SetHandler(handler func(ctx *Ctx))
Sets handler for the command
type TextInput ¶
type TextInput struct {
// contains filtered or unexported fields
}
func NewTextInput ¶
func (*TextInput) GetComponent ¶
func (t *TextInput) GetComponent() interface{}