From 051b7d88a6863bb73b912917e508e29612407713 Mon Sep 17 00:00:00 2001 From: Elysia <71698422+aiko-chan-ai@users.noreply.github.com> Date: Thu, 2 Mar 2023 22:11:21 +0700 Subject: [PATCH] feat: v13 support `SUPPRESS_NOTIFICATIONS` flag #9184 djs --- src/managers/GuildForumThreadManager.js | 3 ++- src/structures/interfaces/TextBasedChannel.js | 3 ++- src/util/MessageFlags.js | 2 ++ typings/index.d.ts | 5 +++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/managers/GuildForumThreadManager.js b/src/managers/GuildForumThreadManager.js index adeb12b..d799919 100644 --- a/src/managers/GuildForumThreadManager.js +++ b/src/managers/GuildForumThreadManager.js @@ -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. */ /** diff --git a/src/structures/interfaces/TextBasedChannel.js b/src/structures/interfaces/TextBasedChannel.js index c2419df..a0ac2da 100644 --- a/src/structures/interfaces/TextBasedChannel.js +++ b/src/structures/interfaces/TextBasedChannel.js @@ -92,7 +92,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. */ /** diff --git a/src/util/MessageFlags.js b/src/util/MessageFlags.js index ff50e2d..da271b8 100644 --- a/src/util/MessageFlags.js +++ b/src/util/MessageFlags.js @@ -32,6 +32,7 @@ class MessageFlags extends BitField {} * * `EPHEMERAL` * * `LOADING` * * `FAILED_TO_MENTION_SOME_ROLES_IN_THREAD` + * * `SUPPRESS_NOTIFICATIONS` * @type {Object} * @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-flags} */ @@ -45,6 +46,7 @@ MessageFlags.FLAGS = { EPHEMERAL: 1 << 6, LOADING: 1 << 7, FAILED_TO_MENTION_SOME_ROLES_IN_THREAD: 1 << 8, + SUPPRESS_NOTIFICATIONS: 1 << 12, }; module.exports = MessageFlags; diff --git a/typings/index.d.ts b/typings/index.d.ts index a24bca2..572aa6c 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -6761,7 +6761,8 @@ export type MessageFlagsString = | 'HAS_THREAD' | 'EPHEMERAL' | 'LOADING' - | 'FAILED_TO_MENTION_SOME_ROLES_IN_THREAD'; + | 'FAILED_TO_MENTION_SOME_ROLES_IN_THREAD' + | 'SUPPRESS_NOTIFICATIONS'; export interface MessageInteraction { id: Snowflake; @@ -6798,7 +6799,7 @@ export interface MessageOptions { reply?: ReplyOptions; stickers?: StickerResolvable[]; attachments?: MessageAttachment[]; - flags?: BitFieldResolvable<'SUPPRESS_EMBEDS', number>; + flags?: BitFieldResolvable<'SUPPRESS_EMBEDS' | 'SUPPRESS_NOTIFICATIONS', number>; usingNewAttachmentAPI?: boolean; }