Documentation
¶
Index ¶
- func Execute(bot *Minidis) error
- type ComponentContext
- type ComponentInteractionProps
- type EditProps
- type FollowupContext
- type FollowupProps
- type Minidis
- func (m *Minidis) AddCommand(cmd *SlashCommandProps) *SlashCommandProps
- func (m *Minidis) AddComponentHandler(cpi *ComponentInteractionProps)
- func (m *Minidis) AddCustomComponentHandler(handler func(s *SlashContext, c *ComponentContext) error)
- func (m *Minidis) NewComponentContext(event *discordgo.Interaction) *ComponentContext
- func (m *Minidis) NewSlashContext(session *discordgo.Session, event *discordgo.Interaction, isSlash bool) *SlashContext
- func (m *Minidis) OnReady(v func(s *discordgo.Session, i *discordgo.Ready))
- func (m *Minidis) Run() error
- func (m *Minidis) SetIntents(intents discordgo.Intent)
- func (m *Minidis) SyncToGuilds(guildIDs ...string)
- type ReplyProps
- type SlashCommandProps
- type SlashContext
- func (s *SlashContext) DeferReply(ephemeral bool) error
- func (s *SlashContext) Delete() error
- func (s *SlashContext) Edit(content string) error
- func (s *SlashContext) EditC(reply EditProps) error
- func (s *SlashContext) Followup(content string) (*FollowupContext, error)
- func (s *SlashContext) FollowupC(reply FollowupProps) (*FollowupContext, error)
- func (s *SlashContext) Reply(content string, embeds ...*discordgo.MessageEmbed) error
- func (s *SlashContext) ReplyC(reply ReplyProps) error
- func (s *SlashContext) ReplyEphemeral(content string, embeds ...*discordgo.MessageEmbed) error
- func (s *SlashContext) ReplyString(content string) error
- type SlashSubcommandGroupProps
- type SlashSubcommandProps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ComponentContext ¶
type ComponentContext struct {
Data discordgo.MessageComponentInteractionData
}
type ComponentInteractionProps ¶
type ComponentInteractionProps struct {
ID string
Execute func(s *SlashContext, c *ComponentContext) error
}
type EditProps ¶
type EditProps struct {
Content string
Embeds []*discordgo.MessageEmbed
Components []discordgo.MessageComponent
Attachments []*discordgo.File
AllowedMentions *discordgo.MessageAllowedMentions
}
type FollowupContext ¶
type FollowupContext struct {
AppID string
// contains filtered or unexported fields
}
func (*FollowupContext) Delete ¶
func (f *FollowupContext) Delete() error
Delete deletes the followup message.
func (*FollowupContext) Edit ¶
func (f *FollowupContext) Edit(content string) error
Edit edits the followup message.
func (*FollowupContext) EditC ¶
func (f *FollowupContext) EditC(reply EditProps) error
EditC is the full edit interaction component structure.
type FollowupProps ¶
type FollowupProps ReplyProps
type Minidis ¶
func (*Minidis) AddCommand ¶
func (m *Minidis) AddCommand(cmd *SlashCommandProps) *SlashCommandProps
AddCommand adds a new slash command.
func (*Minidis) AddComponentHandler ¶
func (m *Minidis) AddComponentHandler(cpi *ComponentInteractionProps)
AddComponentHandler adds a function handler once the `id` is called.
func (*Minidis) AddCustomComponentHandler ¶
func (m *Minidis) AddCustomComponentHandler(handler func(s *SlashContext, c *ComponentContext) error)
AddCustomComponentHandler is a fallback handler for the AddComponentHandler. This is usefull if you have custom component ids that are changing or unique. This is called if the component's id has no handler set.
func (*Minidis) NewComponentContext ¶
func (m *Minidis) NewComponentContext(event *discordgo.Interaction) *ComponentContext
func (*Minidis) NewSlashContext ¶
func (m *Minidis) NewSlashContext(session *discordgo.Session, event *discordgo.Interaction, isSlash bool) *SlashContext
Creates a new slash context for slash command interaction. This is called internally.
func (*Minidis) SetIntents ¶
SetIntents sets the required or used intents by the bot.
func (*Minidis) SyncToGuilds ¶
Sync the commands to these guilds.
type ReplyProps ¶
type ReplyProps struct {
Content string
Embeds []*discordgo.MessageEmbed
Components []discordgo.MessageComponent
IsEphemeral bool
Attachments []*discordgo.File
AllowedMentions *discordgo.MessageAllowedMentions
}
type SlashCommandProps ¶
type SlashCommandProps struct {
Command string
Description string
Options []*discordgo.ApplicationCommandOption
Execute func(c *SlashContext) error
// contains filtered or unexported fields
}
func (*SlashCommandProps) AddSubcommand ¶
func (s *SlashCommandProps) AddSubcommand(cmd *SlashSubcommandProps)
AddSubcommand adds a new sub command for the parent command. Note: this will make your parent command not execute.
func (*SlashCommandProps) AddSubcommandGroup ¶
func (s *SlashCommandProps) AddSubcommandGroup(group *SlashSubcommandGroupProps) *SlashSubcommandGroupProps
AddSubcommand adds a new group for sub commands for the parent command. Note: this will make your parent command not execute.
type SlashContext ¶
type SlashContext struct {
AppID string
Author *discordgo.User
Member *discordgo.Member // only filled when called in a guild
IsDM bool
// NOTE: this is empty if component is called
Options map[string]*discordgo.ApplicationCommandInteractionDataOption
// contains filtered or unexported fields
}
func (*SlashContext) DeferReply ¶
func (s *SlashContext) DeferReply(ephemeral bool) error
DeferReply sends an interaction response where the user sees a loading state. After sending, 15 minutes is given to complete your command's tasks. This is considered as an interaction response, so you should not use the `Reply*` functions after. - `ephemeral` -> only the user sees the loading state
func (*SlashContext) Delete ¶
func (s *SlashContext) Delete() error
Delete deletes the interaction response.
func (*SlashContext) Edit ¶
func (s *SlashContext) Edit(content string) error
Edit edis the interaction response.
func (*SlashContext) EditC ¶
func (s *SlashContext) EditC(reply EditProps) error
EditC is the full edit interaction component structure.
func (*SlashContext) Followup ¶
func (s *SlashContext) Followup(content string) (*FollowupContext, error)
Followup creates a followup message to the interaction response.
func (*SlashContext) FollowupC ¶
func (s *SlashContext) FollowupC(reply FollowupProps) (*FollowupContext, error)
FollowupC is the full followup component structure.
func (*SlashContext) Reply ¶
func (s *SlashContext) Reply(content string, embeds ...*discordgo.MessageEmbed) error
Reply sends a string content with embeds if there is.
func (*SlashContext) ReplyC ¶
func (s *SlashContext) ReplyC(reply ReplyProps) error
ReplyC is the full reply component structure.
func (*SlashContext) ReplyEphemeral ¶
func (s *SlashContext) ReplyEphemeral(content string, embeds ...*discordgo.MessageEmbed) error
Reply sends a string content with embeds if there is. `Ephemeral` - the response message will only be seen by the user who called it.
func (*SlashContext) ReplyString ¶
func (s *SlashContext) ReplyString(content string) error
SendText sends a string text as interaction response.
type SlashSubcommandGroupProps ¶
type SlashSubcommandGroupProps struct {
Command string
Description string
// contains filtered or unexported fields
}
func (*SlashSubcommandGroupProps) AddSubcommand ¶
func (s *SlashSubcommandGroupProps) AddSubcommand(cmd *SlashSubcommandProps)
AddSubcommand adds a new sub command for the subcommmand group. Note: this will make your parent command not execute.
type SlashSubcommandProps ¶
type SlashSubcommandProps struct {
Command string
Description string
Options []*discordgo.ApplicationCommandOption
Execute func(c *SlashContext) error
}
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
example
|
|
|
components
command
|
|
|
options
command
|
|
|
simple
command
|
|
|
subcommands
command
|