Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support for silent messages #374

Merged
merged 2 commits into from
Feb 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions api/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ type SendMessageData struct {
// guild_id in the reference. However, they are not necessary, but will be
// validated if sent.
Reference *discord.MessageReference `json:"message_reference,omitempty"`

// Flags specifies the message flags to set (only `SuppressEmbeds` and `SuppressNotifications` can be set).
Flags discord.MessageFlags `json:"flags,omitempty"`
}

// NeedsMultipart returns true if the SendMessageData has files.
Expand Down
4 changes: 4 additions & 0 deletions discord/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ const (
// MessageLoading specifies whether the message is an Interaction Response
// and the bot is "thinking"
MessageLoading
// TODO: add FailedToMentionSomeRolesInThread

// SuppressNotifications specifies whether the message will not trigger push and desktop notifications.
SuppressNotifications = 1 << 12
)

// StickerItem contains partial data of a Sticker.
Expand Down