mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
feat(ClientOptions): allow setting default allowedMentions (#4085)
* feat(ClientOptions): add default allowedMentions * feat(ClientOptions): use default allowedMentions when not provided * Update src/structures/APIMessage.js Co-Authored-By: SpaceEEC <spaceeec@yahoo.com> * Update src/structures/APIMessage.js Co-Authored-By: SpaceEEC <spaceeec@yahoo.com> * fix(ClientOptions): default allowedMentions should be undefined Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
This commit is contained in:
@@ -176,6 +176,11 @@ class APIMessage {
|
||||
flags = this.options.flags != null ? new MessageFlags(this.options.flags).bitfield : this.target.flags.bitfield;
|
||||
}
|
||||
|
||||
const allowedMentions =
|
||||
typeof this.options.allowedMentions === 'undefined'
|
||||
? this.target.client.options.allowedMentions
|
||||
: this.options.allowedMentions;
|
||||
|
||||
this.data = {
|
||||
content,
|
||||
tts,
|
||||
@@ -184,7 +189,7 @@ class APIMessage {
|
||||
embeds,
|
||||
username,
|
||||
avatar_url: avatarURL,
|
||||
allowed_mentions: this.options.allowedMentions,
|
||||
allowed_mentions: allowedMentions,
|
||||
flags,
|
||||
};
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user