From 71a427f6322be76fe2d1cb265de09f171b1b354a Mon Sep 17 00:00:00 2001 From: Synbulat Biishev Date: Tue, 28 Feb 2023 01:39:03 +0500 Subject: [PATCH] types: allow sending messages with `SuppressNotifications` flag (#9177) --- packages/discord.js/src/managers/GuildForumThreadManager.js | 1 + .../discord.js/src/structures/interfaces/TextBasedChannel.js | 2 +- packages/discord.js/typings/index.d.ts | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/discord.js/src/managers/GuildForumThreadManager.js b/packages/discord.js/src/managers/GuildForumThreadManager.js index 2d521d495..f830b98f1 100644 --- a/packages/discord.js/src/managers/GuildForumThreadManager.js +++ b/packages/discord.js/src/managers/GuildForumThreadManager.js @@ -20,6 +20,7 @@ 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 + * Only `MessageFlags.SuppressEmbeds` and `MessageFlags.SuppressNotifications` can be set. */ /** diff --git a/packages/discord.js/src/structures/interfaces/TextBasedChannel.js b/packages/discord.js/src/structures/interfaces/TextBasedChannel.js index db7542b26..2c73ffc9c 100644 --- a/packages/discord.js/src/structures/interfaces/TextBasedChannel.js +++ b/packages/discord.js/src/structures/interfaces/TextBasedChannel.js @@ -81,7 +81,7 @@ class TextBasedChannel { * @property {ReplyOptions} [reply] The options for replying to a message * @property {StickerResolvable[]} [stickers=[]] The stickers to send in the message * @property {MessageFlags} [flags] Which flags to set for the message. - * Only `MessageFlags.SuppressEmbeds` can be set. + * Only `MessageFlags.SuppressEmbeds` and `MessageFlags.SuppressNotifications` can be set. */ /** diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 80efc3e7c..f2a6142fb 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -5827,7 +5827,10 @@ export interface MessageCreateOptions extends BaseMessageOptions { nonce?: string | number; reply?: ReplyOptions; stickers?: StickerResolvable[]; - flags?: BitFieldResolvable, MessageFlags.SuppressEmbeds>; + flags?: BitFieldResolvable< + Extract, + MessageFlags.SuppressEmbeds | MessageFlags.SuppressNotifications + >; } export type GuildForumThreadMessageCreateOptions = BaseMessageOptions &