Documentation ¶
Index ¶
- func CommandDataInterface(command discordgo.ApplicationCommandInteractionData) any
- func CommandDataString(command discordgo.ApplicationCommandInteractionData) string
- func CompareApplicationCommand(first, second discordgo.ApplicationCommand) bool
- func CompareApplicationCommandOption(first, second discordgo.ApplicationCommandOption) bool
- func GetCommandOption(command any, name string, optionName string) *discordgo.ApplicationCommandInteractionDataOption
- func GetInteractionUser(interaction *discordgo.Interaction) map[string]string
- func GetInteractionUserId(interaction *discordgo.Interaction) string
- func GetInteractionUserName(interaction *discordgo.Interaction) string
- func GetInteractionUserVoiceStateId(session *discordgo.Session, interaction *discordgo.Interaction) string
- func IsInteractionMessageComponent(i *discordgo.InteractionCreate, compareType string, name string) bool
- func MessageComponentInterface(message discordgo.MessageComponentInteractionData) any
- func NotNil(v any) bool
- func PointerTo[V any](v V) *V
- func ShaSum(s string) string
- type ActionsRowBuilder
- type ButtonBuilder
- func (b *ButtonBuilder) Build() discordgo.Button
- func (b *ButtonBuilder) Enabled(enabled bool) *ButtonBuilder
- func (b *ButtonBuilder) Id(id string) *ButtonBuilder
- func (b *ButtonBuilder) Label(label string) *ButtonBuilder
- func (b *ButtonBuilder) Style(style discordgo.ButtonStyle) *ButtonBuilder
- func (b *ButtonBuilder) URL(url string) *ButtonBuilder
- type InteractionResponseBuilder
- func (i *InteractionResponseBuilder) Components(components ...discordgo.MessageComponent) *InteractionResponseBuilder
- func (i *InteractionResponseBuilder) Deferred() *InteractionResponseBuilder
- func (i *InteractionResponseBuilder) DeferredUpdate() *InteractionResponseBuilder
- func (i *InteractionResponseBuilder) Delete() error
- func (i *InteractionResponseBuilder) DeleteWithLog(logger *slog.Logger)
- func (i *InteractionResponseBuilder) Edit() error
- func (i *InteractionResponseBuilder) EditWithLog(logger *slog.Logger)
- func (i *InteractionResponseBuilder) Embeds(embeds ...*discordgo.MessageEmbed) *InteractionResponseBuilder
- func (i *InteractionResponseBuilder) Ephemeral() *InteractionResponseBuilder
- func (i *InteractionResponseBuilder) Flags(flags discordgo.MessageFlags) *InteractionResponseBuilder
- func (i *InteractionResponseBuilder) FollowUpCreate() (*discordgo.Message, error)
- func (i *InteractionResponseBuilder) FollowUpCreateWithLog(logger *slog.Logger)
- func (i *InteractionResponseBuilder) FollowUpDelete(id string) error
- func (i *InteractionResponseBuilder) FollowUpDeleteWithLog(id string, logger *slog.Logger)
- func (i *InteractionResponseBuilder) FollowUpEdit(id string) (*discordgo.Message, error)
- func (i *InteractionResponseBuilder) FollowUpEditWithLog(id string, logger *slog.Logger)
- func (i *InteractionResponseBuilder) Message(message string) *InteractionResponseBuilder
- func (i *InteractionResponseBuilder) Response(response *discordgo.InteractionResponse) *InteractionResponseBuilder
- func (i *InteractionResponseBuilder) Send() error
- func (i *InteractionResponseBuilder) SendWithLog(logger *slog.Logger)
- func (i *InteractionResponseBuilder) Type(t discordgo.InteractionResponseType) *InteractionResponseBuilder
- type MessageEmbedBuilder
- func (m *MessageEmbedBuilder) Build() *discordgo.MessageEmbed
- func (m *MessageEmbedBuilder) Description(description string) *MessageEmbedBuilder
- func (m *MessageEmbedBuilder) Image(url string) *MessageEmbedBuilder
- func (m *MessageEmbedBuilder) Title(title string) *MessageEmbedBuilder
- func (m *MessageEmbedBuilder) URL(url string) *MessageEmbedBuilder
- type NopLogHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommandDataInterface ¶
func CommandDataInterface(command discordgo.ApplicationCommandInteractionData) any
CommandDataInterface returns a trimmed version of discordgo.ApplicationCommandInteractionData.
func CommandDataString ¶
func CommandDataString(command discordgo.ApplicationCommandInteractionData) string
CommandDataString recursively traverses a discordgo.ApplicationCommandInteractionData and returns a formatted string representing the command.
func CompareApplicationCommand ¶
func CompareApplicationCommand(first, second discordgo.ApplicationCommand) bool
CompareApplicationCommand compares two discordgo.ApplicationCommand(s) and returns first == second.
func CompareApplicationCommandOption ¶
func CompareApplicationCommandOption(first, second discordgo.ApplicationCommandOption) bool
CompareApplicationCommandOption recursively traverses two discordgo.ApplicationCommandOption(s) to test for value equivalence. This can be called directly or through CompareApplicationCommand to compare higher level commands.
func GetCommandOption ¶
func GetCommandOption(command any, name string, optionName string) *discordgo.ApplicationCommandInteractionDataOption
GetCommandOption takes either a discordgo.ApplicationCommandInteractionData or a discordgo.ApplicationCommandInteractionDataOption, and checks that:
- the `.Name` property matches `name`
- there exists and option in `.Options` with the name optionName
If those conditions are met then the *discordgo.ApplicationCommandInteractionDataOption that matches is returned. If the conditions aren't met, then nil is returned.
func GetInteractionUser ¶
func GetInteractionUser(interaction *discordgo.Interaction) map[string]string
func GetInteractionUserId ¶
func GetInteractionUserId(interaction *discordgo.Interaction) string
func GetInteractionUserName ¶
func GetInteractionUserName(interaction *discordgo.Interaction) string
func GetInteractionUserVoiceStateId ¶
func GetInteractionUserVoiceStateId(session *discordgo.Session, interaction *discordgo.Interaction) string
func IsInteractionMessageComponent ¶
func IsInteractionMessageComponent(i *discordgo.InteractionCreate, compareType string, name string) bool
IsInteractionMessageComponent checks an interaction to see if it's of type discordgo.InteractionMessageComponent. It also compares the CustomID of it to name using the compareType supplied. compareType can be any of the following: "is", or "startsWith".
func MessageComponentInterface ¶
func MessageComponentInterface(message discordgo.MessageComponentInteractionData) any
MessageComponentInterface returns a trimmed version of discordgo.MessageComponentInteractionData.
Types ¶
type ActionsRowBuilder ¶
type ActionsRowBuilder struct {
// contains filtered or unexported fields
}
func ActionsRow ¶
func ActionsRow() *ActionsRowBuilder
func (*ActionsRowBuilder) Build ¶
func (a *ActionsRowBuilder) Build() discordgo.ActionsRow
func (*ActionsRowBuilder) Button ¶
func (a *ActionsRowBuilder) Button(button discordgo.Button) *ActionsRowBuilder
func (*ActionsRowBuilder) SelectMenu ¶
func (a *ActionsRowBuilder) SelectMenu() *ActionsRowBuilder
type ButtonBuilder ¶
type ButtonBuilder struct {
// contains filtered or unexported fields
}
func Button ¶
func Button() *ButtonBuilder
func (*ButtonBuilder) Build ¶
func (b *ButtonBuilder) Build() discordgo.Button
func (*ButtonBuilder) Enabled ¶
func (b *ButtonBuilder) Enabled(enabled bool) *ButtonBuilder
func (*ButtonBuilder) Id ¶
func (b *ButtonBuilder) Id(id string) *ButtonBuilder
func (*ButtonBuilder) Label ¶
func (b *ButtonBuilder) Label(label string) *ButtonBuilder
func (*ButtonBuilder) Style ¶
func (b *ButtonBuilder) Style(style discordgo.ButtonStyle) *ButtonBuilder
func (*ButtonBuilder) URL ¶
func (b *ButtonBuilder) URL(url string) *ButtonBuilder
type InteractionResponseBuilder ¶
type InteractionResponseBuilder struct {
// contains filtered or unexported fields
}
func InteractionResponse ¶
func InteractionResponse(session *discordgo.Session, interaction *discordgo.Interaction) *InteractionResponseBuilder
func (*InteractionResponseBuilder) Components ¶
func (i *InteractionResponseBuilder) Components(components ...discordgo.MessageComponent) *InteractionResponseBuilder
func (*InteractionResponseBuilder) Deferred ¶
func (i *InteractionResponseBuilder) Deferred() *InteractionResponseBuilder
Deferred marks the response as "will respond later"
func (*InteractionResponseBuilder) DeferredUpdate ¶
func (i *InteractionResponseBuilder) DeferredUpdate() *InteractionResponseBuilder
DeferredUpdate marks the response as "will update response later"
func (*InteractionResponseBuilder) Delete ¶
func (i *InteractionResponseBuilder) Delete() error
func (*InteractionResponseBuilder) DeleteWithLog ¶
func (i *InteractionResponseBuilder) DeleteWithLog(logger *slog.Logger)
func (*InteractionResponseBuilder) Edit ¶
func (i *InteractionResponseBuilder) Edit() error
func (*InteractionResponseBuilder) EditWithLog ¶
func (i *InteractionResponseBuilder) EditWithLog(logger *slog.Logger)
func (*InteractionResponseBuilder) Embeds ¶
func (i *InteractionResponseBuilder) Embeds(embeds ...*discordgo.MessageEmbed) *InteractionResponseBuilder
func (*InteractionResponseBuilder) Ephemeral ¶
func (i *InteractionResponseBuilder) Ephemeral() *InteractionResponseBuilder
Ephemeral is a convenience function that calls Flags(discordgo.MessageFlagsEphemeral).
func (*InteractionResponseBuilder) Flags ¶
func (i *InteractionResponseBuilder) Flags(flags discordgo.MessageFlags) *InteractionResponseBuilder
func (*InteractionResponseBuilder) FollowUpCreate ¶
func (i *InteractionResponseBuilder) FollowUpCreate() (*discordgo.Message, error)
func (*InteractionResponseBuilder) FollowUpCreateWithLog ¶
func (i *InteractionResponseBuilder) FollowUpCreateWithLog(logger *slog.Logger)
func (*InteractionResponseBuilder) FollowUpDelete ¶
func (i *InteractionResponseBuilder) FollowUpDelete(id string) error
func (*InteractionResponseBuilder) FollowUpDeleteWithLog ¶
func (i *InteractionResponseBuilder) FollowUpDeleteWithLog(id string, logger *slog.Logger)
func (*InteractionResponseBuilder) FollowUpEdit ¶
func (i *InteractionResponseBuilder) FollowUpEdit(id string) (*discordgo.Message, error)
func (*InteractionResponseBuilder) FollowUpEditWithLog ¶
func (i *InteractionResponseBuilder) FollowUpEditWithLog(id string, logger *slog.Logger)
func (*InteractionResponseBuilder) Message ¶
func (i *InteractionResponseBuilder) Message(message string) *InteractionResponseBuilder
func (*InteractionResponseBuilder) Response ¶
func (i *InteractionResponseBuilder) Response(response *discordgo.InteractionResponse) *InteractionResponseBuilder
func (*InteractionResponseBuilder) Send ¶
func (i *InteractionResponseBuilder) Send() error
func (*InteractionResponseBuilder) SendWithLog ¶
func (i *InteractionResponseBuilder) SendWithLog(logger *slog.Logger)
func (*InteractionResponseBuilder) Type ¶
func (i *InteractionResponseBuilder) Type(t discordgo.InteractionResponseType) *InteractionResponseBuilder
type MessageEmbedBuilder ¶
type MessageEmbedBuilder struct {
// contains filtered or unexported fields
}
func MessageEmbed ¶
func MessageEmbed() *MessageEmbedBuilder
func (*MessageEmbedBuilder) Build ¶
func (m *MessageEmbedBuilder) Build() *discordgo.MessageEmbed
func (*MessageEmbedBuilder) Description ¶
func (m *MessageEmbedBuilder) Description(description string) *MessageEmbedBuilder
func (*MessageEmbedBuilder) Image ¶
func (m *MessageEmbedBuilder) Image(url string) *MessageEmbedBuilder
func (*MessageEmbedBuilder) Title ¶
func (m *MessageEmbedBuilder) Title(title string) *MessageEmbedBuilder
func (*MessageEmbedBuilder) URL ¶
func (m *MessageEmbedBuilder) URL(url string) *MessageEmbedBuilder
type NopLogHandler ¶
type NopLogHandler struct{}