From 6347a74424841eca280bbc6bb221417dcb6a3f7c Mon Sep 17 00:00:00 2001 From: TTtie Date: Wed, 19 Jul 2023 00:53:49 +0200 Subject: [PATCH] feat: support attachment flags (#86) Ref: https://github.com/discord/discord-api-docs/commit/8530715b6d51e80713734f414896b4273a491c38 --- index.d.ts | 4 ++++ lib/Constants.js | 4 ++++ lib/structures/Attachment.js | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/index.d.ts b/index.d.ts index 8065e1b8..40959c74 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1823,6 +1823,9 @@ declare namespace Dysnomia { GATEWAY_MESSAGE_CONTENT_LIMITED: 524288; APPLICATION_COMMAND_BADGE: 8388608; }; + AttachmentFlags: { + IS_REMIX: 4; + }; AuditLogActions: { GUILD_UPDATE: 1; @@ -2403,6 +2406,7 @@ declare namespace Dysnomia { durationSecs?: number; ephemeral?: boolean; filename: string; + flags?: number; height?: number; id: string; proxyURL: string; diff --git a/lib/Constants.js b/lib/Constants.js index 8da6ace6..4e33b1e5 100644 --- a/lib/Constants.js +++ b/lib/Constants.js @@ -63,6 +63,10 @@ module.exports.ApplicationFlags = { APPLICATION_COMMAND_BADGE: 1 << 23 }; +module.exports.AttachmentFlags = { + IS_REMIX: 1 << 2 +}; + module.exports.AuditLogActions = { GUILD_UPDATE: 1, diff --git a/lib/structures/Attachment.js b/lib/structures/Attachment.js index 5fda4e02..61cf633b 100644 --- a/lib/structures/Attachment.js +++ b/lib/structures/Attachment.js @@ -9,6 +9,7 @@ const Base = require("./Base"); * @prop {Number?} durationSecs The duration of the audio file (voice messages only) * @prop {Boolean?} ephemeral Whether the attachment is ephemeral * @prop {String} filename The filename of the attachment + * @prop {Number?} flags Attachment flags. See [Discord's documentation](https://discord.com/developers/docs/resources/channel#attachment-object-attachment-flags) for a list of them * @prop {Number?} height The height of the attachment * @prop {String} id The attachment ID * @prop {String} proxyURL The proxy URL of the attachment @@ -46,6 +47,9 @@ class Attachment extends Base { if(data.ephemeral !== undefined) { this.ephemeral = data.ephemeral; } + if(data.flags !== undefined) { + this.flags = data.flags; + } } toJSON(props = []) {