fix: detect spoiler attachments with flag (v14) (#11561)

fix: detect spoiler attachments with flag
This commit is contained in:
advaith
2026-06-25 18:29:59 -07:00
committed by GitHub
parent d1f74384cf
commit ce29ae9815
@@ -1,7 +1,8 @@
'use strict';
const { AttachmentFlags } = require('discord-api-types/v10');
const AttachmentFlagsBitField = require('../util/AttachmentFlagsBitField.js');
const { basename, flatten } = require('../util/Util');
const { flatten } = require('../util/Util');
/**
* @typedef {Object} AttachmentPayload
@@ -152,7 +153,7 @@ class Attachment {
* @readonly
*/
get spoiler() {
return basename(this.url ?? this.name).startsWith('SPOILER_');
return this.flags.has(AttachmentFlags.IsSpoiler);
}
toJSON() {