feat: v13 support SUPPRESS_NOTIFICATIONS flag

#9184 djs
This commit is contained in:
Elysia 2023-03-02 22:11:21 +07:00
parent 4a2f1d9c85
commit 051b7d88a6
4 changed files with 9 additions and 4 deletions

View File

@ -19,7 +19,8 @@ class GuildForumThreadManager extends ThreadManager {
/** /**
* @typedef {BaseMessageOptions} GuildForumThreadMessageCreateOptions * @typedef {BaseMessageOptions} GuildForumThreadMessageCreateOptions
* @property {StickerResolvable} [stickers] The stickers to send with the message * @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.
*/ */
/** /**

View File

@ -92,7 +92,8 @@ class TextBasedChannel {
* @typedef {BaseMessageOptions} MessageOptions * @typedef {BaseMessageOptions} MessageOptions
* @property {ReplyOptions} [reply] The options for replying to a message * @property {ReplyOptions} [reply] The options for replying to a message
* @property {StickerResolvable[]} [stickers=[]] Stickers to send in the 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.
*/ */
/** /**

View File

@ -32,6 +32,7 @@ class MessageFlags extends BitField {}
* * `EPHEMERAL` * * `EPHEMERAL`
* * `LOADING` * * `LOADING`
* * `FAILED_TO_MENTION_SOME_ROLES_IN_THREAD` * * `FAILED_TO_MENTION_SOME_ROLES_IN_THREAD`
* * `SUPPRESS_NOTIFICATIONS`
* @type {Object} * @type {Object}
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-flags} * @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-flags}
*/ */
@ -45,6 +46,7 @@ MessageFlags.FLAGS = {
EPHEMERAL: 1 << 6, EPHEMERAL: 1 << 6,
LOADING: 1 << 7, LOADING: 1 << 7,
FAILED_TO_MENTION_SOME_ROLES_IN_THREAD: 1 << 8, FAILED_TO_MENTION_SOME_ROLES_IN_THREAD: 1 << 8,
SUPPRESS_NOTIFICATIONS: 1 << 12,
}; };
module.exports = MessageFlags; module.exports = MessageFlags;

5
typings/index.d.ts vendored
View File

@ -6761,7 +6761,8 @@ export type MessageFlagsString =
| 'HAS_THREAD' | 'HAS_THREAD'
| 'EPHEMERAL' | 'EPHEMERAL'
| 'LOADING' | 'LOADING'
| 'FAILED_TO_MENTION_SOME_ROLES_IN_THREAD'; | 'FAILED_TO_MENTION_SOME_ROLES_IN_THREAD'
| 'SUPPRESS_NOTIFICATIONS';
export interface MessageInteraction { export interface MessageInteraction {
id: Snowflake; id: Snowflake;
@ -6798,7 +6799,7 @@ export interface MessageOptions {
reply?: ReplyOptions; reply?: ReplyOptions;
stickers?: StickerResolvable[]; stickers?: StickerResolvable[];
attachments?: MessageAttachment[]; attachments?: MessageAttachment[];
flags?: BitFieldResolvable<'SUPPRESS_EMBEDS', number>; flags?: BitFieldResolvable<'SUPPRESS_EMBEDS' | 'SUPPRESS_NOTIFICATIONS', number>;
usingNewAttachmentAPI?: boolean; usingNewAttachmentAPI?: boolean;
} }