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: v13 support SUPPRESS_NOTIFICATIONS flag #9184

Merged
merged 1 commit into from
Mar 3, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/managers/GuildForumThreadManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class GuildForumThreadManager extends ThreadManager {
/**
* @typedef {BaseMessageOptions} GuildForumThreadMessageCreateOptions
* @property {StickerResolvable} [stickers] The stickers to send with the message
* @property {BitFieldResolvable} [flags] The flags to send with the message
* @property {BitFieldResolvable} [flags] The flags to send with the message.
* Only `SUPPRESS_EMBEDS` and `SUPPRESS_NOTIFICATIONS` can be set.
*/

/**
Expand Down
3 changes: 2 additions & 1 deletion src/structures/interfaces/TextBasedChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ class TextBasedChannel {
* @typedef {BaseMessageOptions} MessageOptions
* @property {ReplyOptions} [reply] The options for replying to a message
* @property {StickerResolvable[]} [stickers=[]] Stickers to send in the message
* @property {MessageFlags} [flags] Which flags to set for the message. Only `SUPPRESS_EMBEDS` can be set.
* @property {MessageFlags} [flags]
* Which flags to set for the message. Only `SUPPRESS_EMBEDS` and `SUPPRESS_NOTIFICATIONS` can be set.
*/

/**
Expand Down
2 changes: 2 additions & 0 deletions src/util/MessageFlags.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class MessageFlags extends BitField {}
* * `HAS_THREAD`
* * `EPHEMERAL`
* * `LOADING`
* * `SUPPRESS_NOTIFICATIONS`
* @type {Object}
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-flags}
*/
Expand All @@ -43,6 +44,7 @@ MessageFlags.FLAGS = {
HAS_THREAD: 1 << 5,
EPHEMERAL: 1 << 6,
LOADING: 1 << 7,
SUPPRESS_NOTIFICATIONS: 1 >> 12,
};

module.exports = MessageFlags;
5 changes: 3 additions & 2 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5817,7 +5817,8 @@ export type MessageFlagsString =
| 'URGENT'
| 'HAS_THREAD'
| 'EPHEMERAL'
| 'LOADING';
| 'LOADING'
| 'SUPPRESS_NOTIFICATIONS';

export interface MessageInteraction {
id: Snowflake;
Expand Down Expand Up @@ -5853,7 +5854,7 @@ export interface MessageOptions {
reply?: ReplyOptions;
stickers?: StickerResolvable[];
attachments?: MessageAttachment[];
flags?: BitFieldResolvable<'SUPPRESS_EMBEDS', number>;
flags?: BitFieldResolvable<'SUPPRESS_EMBEDS' | 'SUPPRESS_NOTIFICATIONS', number>;
}

export type MessageReactionResolvable = MessageReaction | Snowflake | string;
Expand Down