mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
feat(MessageAttachment): add spoiler property (#3561)
* feat(MessageAttachment): add spoiler property * typings * Implement suggestions * Make readonly Co-Authored-By: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
@@ -81,6 +81,14 @@ class MessageAttachment {
|
||||
this.width = typeof data.width !== 'undefined' ? data.width : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether or not this attachment has been marked as a spoiler
|
||||
* @type {boolean}
|
||||
*/
|
||||
get spoiler() {
|
||||
return Util.basename(this.url).startsWith('SPOILER_');
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
return Util.flatten(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user