Documentation
¶
Index ¶
- type Message
- func (m *Message) Delete(s *discordgo.Session, options ...discordgo.RequestOption) error
- func (m *Message) Edit(s *discordgo.Session, options ...discordgo.RequestOption) error
- func (m *Message) Send(s *discordgo.Session, channelID string, options ...discordgo.RequestOption) error
- func (m *Message) SendEphemeral(s *discordgo.Session, channelID string, options ...discordgo.RequestOption) error
- func (m *Message) WithChannelID(channelID string) *Message
- func (m *Message) WithMessageID(messageID string) *Message
- type Response
- func (r *Response) Delete(s *discordgo.Session, options ...discordgo.RequestOption) error
- func (r *Response) Edit(s *discordgo.Session, options ...discordgo.RequestOption) error
- func (r *Response) Send(s *discordgo.Session, i *discordgo.Interaction, ...) error
- func (r *Response) SendEphemeral(s *discordgo.Session, i *discordgo.Interaction, ...) error
- func (r *Response) WithInteraction(i *discordgo.Interaction) *Response
- func (r *Response) WithResponseType(responseType discordgo.InteractionResponseType) *Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct {
AllowedMentions *discordgo.MessageAllowedMentions
Components []discordgo.MessageComponent
Content string
Embeds []*discordgo.MessageEmbed
Files []*discordgo.File
Flags discordgo.MessageFlags
Reference *discordgo.MessageReference
StickerIDs []string
TTS bool
// contains filtered or unexported fields
}
Message is a Discord message representation used for sending and editing messages in a channel.
func (*Message) Delete ¶
Delete deletes the message using the provided Discord session and clears the MessageID to indicate it has been deleted.
func (*Message) Edit ¶
Edit edits the existing message using the provided Discord session and updates its content, components, embeds, and flags.
func (*Message) Send ¶
func (m *Message) Send(s *discordgo.Session, channelID string, options ...discordgo.RequestOption) error
Send s the message to the specified channel using the provided Discord session.
func (*Message) SendEphemeral ¶
func (m *Message) SendEphemeral(s *discordgo.Session, channelID string, options ...discordgo.RequestOption) error
SendEphemeral sends the message as an ephemeral message to the specified channel using the provided Discord session.
func (*Message) WithChannelID ¶ added in v0.4.0
WithChannelID sets the channel ID that corresponds to the message to be edited or deleted.
func (*Message) WithMessageID ¶ added in v0.4.0
WithMessageID sets the message ID that corresponds to the message to be edited or deleted.
type Response ¶
type Response struct {
AllowedMentions *discordgo.MessageAllowedMentions
Attachments []*discordgo.MessageAttachment
Components []discordgo.MessageComponent
Content string
Embeds []*discordgo.MessageEmbed
Files []*discordgo.File
TTS bool
Choices []*discordgo.ApplicationCommandOptionChoice // Autocomplete interaction only.
Flags discordgo.MessageFlags // Only MessageFlagsSuppressEmbeds and MessageFlagsEphemeral are valid.
CustomID string // Modal interaction only.
Title string // Modal interaction only.
// contains filtered or unexported fields
}
Response is a Discord interaction response representation used for sending and editing responses to interactions.
func (*Response) Delete ¶
Delete deletes the interaction response using the provided Discord session.
func (*Response) Edit ¶
Edit edits the existing interaction response using the provided Discord session and updates its content, components, embeds, and attachments.
func (*Response) Send ¶
func (r *Response) Send(s *discordgo.Session, i *discordgo.Interaction, options ...discordgo.RequestOption) error
Send sends the interaction response to the specified channel using the provided Discord session.
func (*Response) SendEphemeral ¶
func (r *Response) SendEphemeral(s *discordgo.Session, i *discordgo.Interaction, options ...discordgo.RequestOption) error
SendEphemeral sends the interaction response as an ephemeral message to the specified channel using the provided Discord session.
func (*Response) WithInteraction ¶ added in v0.4.0
func (r *Response) WithInteraction(i *discordgo.Interaction) *Response
WithInteraction sets the interaction that corresponds to the response to be edited or deleted.
func (*Response) WithResponseType ¶ added in v0.4.2
func (r *Response) WithResponseType(responseType discordgo.InteractionResponseType) *Response
WithResponseType sets the response type for the interaction response. If not set, the resposne defaults to `discordgo.InteractionResponseChannelMessageWithSource`.