From 88625a5b7db9d16e251840a091ba740a9bb82c80 Mon Sep 17 00:00:00 2001 From: monbrey Date: Tue, 24 Nov 2020 09:01:24 +1100 Subject: [PATCH] fix(ApiMessage): pass allowed_mentions when replying without content --- src/structures/APIMessage.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/structures/APIMessage.js b/src/structures/APIMessage.js index c44ef5ba..ebe82282 100644 --- a/src/structures/APIMessage.js +++ b/src/structures/APIMessage.js @@ -170,6 +170,11 @@ class APIMessage { ? this.target.client.options.allowedMentions : this.options.allowedMentions; + if (allowedMentions) { + allowedMentions.replied_user = allowedMentions.repliedUser; + delete allowedMentions.repliedUser; + } + let message_reference; if (typeof this.options.replyTo !== 'undefined') { const message_id = this.isMessage @@ -188,7 +193,8 @@ class APIMessage { embeds, username, avatar_url: avatarURL, - allowed_mentions: typeof content === 'undefined' ? undefined : allowedMentions, + allowed_mentions: + typeof content === 'undefined' && typeof message_reference === 'undefined' ? undefined : allowedMentions, flags, message_reference, };