mirror of
https://github.com/discordjs/discord.js.git
synced 2026-07-22 06:02:57 +00:00
fix: detect spoiler attachments with flag (v14) (#11561)
fix: detect spoiler attachments with flag
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user