disgomsg

package module
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2025 License: GPL-3.0 Imports: 2 Imported by: 1 module, 12 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingChannelID   = errors.New("missing channel ID")
	ErrMissingMessageID   = errors.New("missing message ID")
	ErrInvalidMessageType = errors.New("invalid message type")
)

Functions

This section is empty.

Types

type DirectMessage added in v0.5.0

type DirectMessage message

DirectMessage is a Discord message representation used for sending a message to a user in a private channel.

func NewDirectMessage added in v0.6.0

func NewDirectMessage(opts ...Option) *DirectMessage

NewDirectMessage creates a new message instance with the provided options that may be sent as a direct message to a given member.

func (*DirectMessage) Delete added in v0.5.0

func (dm *DirectMessage) Delete(s *discordgo.Session, options ...discordgo.RequestOption) error

Delete deletes the message using the provided Discord session and clears the MessageID to indicate it has been deleted.

func (*DirectMessage) Edit added in v0.5.0

func (dm *DirectMessage) Edit(s *discordgo.Session, options ...discordgo.RequestOption) error

Edit edits the existing message using the provided Discord session and updates its content, components, embeds, and flags.

func (*DirectMessage) Send added in v0.5.0

func (dm *DirectMessage) Send(s *discordgo.Session, memberID string, options ...discordgo.RequestOption) error

Send sends a direct message to the specified member using the provided Discord session.

func (*DirectMessage) SetOptions added in v0.7.0

func (dm *DirectMessage) SetOptions(opts ...Option)

SetOptions sets the options for the message.

func (*DirectMessage) WithChannelID added in v0.5.0

func (dm *DirectMessage) WithChannelID(channelID string) *DirectMessage

WithChannelID sets the channel ID for the message.

type Message

type Message message

Message is a Discord message representation used for sending and editing messages in a channel.

func NewMessage added in v0.6.0

func NewMessage(opts ...Option) *Message

NewMessage creates a new message instance with the provided options that may be sent to a channel.

func (*Message) Delete

func (m *Message) Delete(s *discordgo.Session, options ...discordgo.RequestOption) error

Delete deletes the message using the provided Discord session and clears the MessageID to indicate it has been deleted.

func (*Message) Edit

func (m *Message) Edit(s *discordgo.Session, options ...discordgo.RequestOption) error

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) SetOptions added in v0.7.0

func (m *Message) SetOptions(opts ...Option)

SetOptions sets the options for the message.

func (*Message) WithChannelID added in v0.4.0

func (m *Message) WithChannelID(channelID string) *Message

WithChannelID sets the channel ID for the message.

type Option added in v0.6.0

type Option func(*message)

Option is a function that modifies a message.

func WithAllowedMentions added in v0.6.0

func WithAllowedMentions(allowedMentions *discordgo.MessageAllowedMentions) Option

WithAllowedMentions sets the allowed mentions for the message.

func WithAttachments added in v0.6.0

func WithAttachments(attachments []*discordgo.MessageAttachment) Option

WithAttachments sets the attachments for the message.

func WithChannelID added in v0.6.0

func WithChannelID(channelID string) Option

WithChannelID sets the channel ID for the message.

func WithChoices added in v0.6.0

func WithChoices(choices []*discordgo.ApplicationCommandOptionChoice) Option

WithChoices sets the choices for the message.

func WithComponents added in v0.6.0

func WithComponents(components []discordgo.MessageComponent) Option

WithComponents sets the components for the message.

func WithContent added in v0.6.0

func WithContent(content string) Option

WithContent sets the content for the message.

func WithCustomID added in v0.6.0

func WithCustomID(customID string) Option

WithCustomID sets the custom ID for the message.

func WithEmbeds added in v0.6.0

func WithEmbeds(embeds []*discordgo.MessageEmbed) Option

WithEmbeds sets the embeds for the message.

func WithFiles added in v0.6.0

func WithFiles(files []*discordgo.File) Option

WithFiles sets the files for the message.

func WithFlags added in v0.6.0

func WithFlags(flags discordgo.MessageFlags) Option

WithFlags sets the flags for the message.

func WithInteraction added in v0.6.0

func WithInteraction(interaction *discordgo.Interaction) Option

WithInteraction sets the interaction for the message.

func WithMessageID added in v0.6.0

func WithMessageID(messageID string) Option

WithMessageID sets the message ID for the message.

func WithReference added in v0.6.0

func WithReference(reference *discordgo.MessageReference) Option

WithReference sets the reference for the message.

func WithResponseType added in v0.6.0

func WithResponseType(responseType *discordgo.InteractionResponseType) Option

WithResponseType sets the response type for the message.

func WithStickerIDs added in v0.6.0

func WithStickerIDs(stickerIDs []string) Option

WithStickerIDs sets the sticker IDs for the message.

func WithTTS added in v0.6.0

func WithTTS(tts bool) Option

WithTTS sets the tts for the message.

func WithTitle added in v0.6.0

func WithTitle(title string) Option

WithTitle sets the title for the message.

type Response

type Response message

Response is a Discord interaction response representation used for sending and editing responses to interactions.

func NewResponse added in v0.6.0

func NewResponse(opts ...Option) *Response

NewResponse creates a new message instance with the provided options that may be sent as a response to an interaction.

func (*Response) Delete

func (r *Response) Delete(s *discordgo.Session, options ...discordgo.RequestOption) error

Delete deletes the interaction response using the provided Discord session.

func (*Response) Edit

func (r *Response) Edit(s *discordgo.Session, options ...discordgo.RequestOption) error

Edit edits the existing interaction response using the provided Discord session and updates its content, components, embeds, and attachments.

func (*Response) Send

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) SetOptions added in v0.7.0

func (r *Response) SetOptions(opts ...Option)

SetOptions sets the options for the message.

func (*Response) WithInteraction added in v0.4.0

func (r *Response) WithInteraction(i *discordgo.Interaction) *Response

WithInteraction sets the interaction for the response.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL