Documentation ¶
Index ¶
- Constants
- func EditResponse(c *api.Component, s *discordgo.Session, i *discordgo.InteractionCreate, ...) *discordgo.Message
- func GenerateEphemeralInteractionResponseTemplate(name string, description string) *discordgo.InteractionResponseData
- func GenerateInteractionResponseTemplate(name string, description string) *discordgo.InteractionResponseData
- func Respond(c *api.Component, s *discordgo.Session, i *discordgo.InteractionCreate, ...)
- func RespondWithCommandIsGuildOnly(c *api.Component, s *discordgo.Session, i *discordgo.InteractionCreate, ...)
- func RespondWithGenericErrorMessage(c *api.Component, s *discordgo.Session, i *discordgo.InteractionCreate, ...)
- func RespondWithSimpleEmbedMessage(c *api.Component, s *discordgo.Session, i *discordgo.InteractionCreate, ...)
Constants ¶
const ( GenericErrorResponseEmbedName = ":x: Damn, something went wrong!" GenericErrorResponseEmbedValue = "Something unexpected happened while processing the command!" )
Variables ¶
This section is empty.
Functions ¶
func EditResponse ¶
func EditResponse( c *api.Component, s *discordgo.Session, i *discordgo.InteractionCreate, editData *discordgo.WebhookEdit, ) *discordgo.Message
EditResponse edits the passed interactions original response with the passed discordgo.WebhooKParams. This allows things like sending a notice that something will take some time and then edit the message to tell the user that the action has been done.
func GenerateEphemeralInteractionResponseTemplate ¶
func GenerateEphemeralInteractionResponseTemplate( name string, description string, ) *discordgo.InteractionResponseData
GenerateEphemeralInteractionResponseTemplate creates a prefilled discordgo.InteractionResponseData that is prepared to be filled with specific data or errors. In addition, the discordgo.InteractionResponseData will be ephemeral and therefore only show to the user that triggered the interaction.
The template will get an empty embed with the specified name and description.
func GenerateInteractionResponseTemplate ¶
func GenerateInteractionResponseTemplate( name string, description string, ) *discordgo.InteractionResponseData
GenerateInteractionResponseTemplate creates a prefilled discordgo.InteractionResponseData that is prepared to be filled with specific data or errors.
The template will get an empty embed with the specified name and description. The default color of the auto-generated embed equals the one defined under api.DefaultEmbedColor
func Respond ¶
func Respond( c *api.Component, s *discordgo.Session, i *discordgo.InteractionCreate, resp *discordgo.InteractionResponseData, )
Respond to the target interaction with the passed discordgo.InteractionResponseData as a message in the channel where the interaction has been triggered.
func RespondWithCommandIsGuildOnly ¶ added in v0.2.0
func RespondWithCommandIsGuildOnly( c *api.Component, s *discordgo.Session, i *discordgo.InteractionCreate, commandName string, )
RespondWithCommandIsGuildOnly responds with a message stating that the executed command is only available on guilds.
func RespondWithGenericErrorMessage ¶ added in v0.2.0
func RespondWithGenericErrorMessage( c *api.Component, s *discordgo.Session, i *discordgo.InteractionCreate, resp *discordgo.InteractionResponseData, )
RespondWithGenericErrorMessage fills the passed discordgo.InteractionResponseData with a generic error message as content.
The prepared interaction response will be sent.
func RespondWithSimpleEmbedMessage ¶ added in v0.2.0
func RespondWithSimpleEmbedMessage( c *api.Component, s *discordgo.Session, i *discordgo.InteractionCreate, resp *discordgo.InteractionResponseData, header string, message string, )
RespondWithSimpleEmbedMessage fills the passed discordgo.InteractionResponseData with an embed that contains a single field with a name and value.
The prepared interaction response will be sent.
Types ¶
This section is empty.