From 66429c629d6cf2da592f2e4a4254080053ff0f5f Mon Sep 17 00:00:00 2001 From: Nils <7890309+DarkView@users.noreply.github.com> Date: Wed, 4 Nov 2020 00:59:55 +0100 Subject: [PATCH] Fix message chunking not properly handling allowedMentions (#496) --- src/data/Thread.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/data/Thread.js b/src/data/Thread.js index 45f1585..dd95b95 100644 --- a/src/data/Thread.js +++ b/src/data/Thread.js @@ -90,6 +90,7 @@ class Thread { let firstMessage; const textContent = typeof content === "string" ? content : content.content; + const contentObj = typeof content === "string" ? {} : content; if (textContent) { // Text content is included, chunk it and send it as individual messages. // Files (attachments) are only sent with the last message. @@ -97,8 +98,8 @@ class Thread { for (const [i, chunk] of chunks.entries()) { // Only send embeds, files, etc. with the last message const msg = (i === chunks.length - 1) - ? await bot.createMessage(this.channel_id, chunk, file) - : await bot.createMessage(this.channel_id, chunk); + ? await bot.createMessage(this.channel_id, { ...contentObj, content: chunk }, file) + : await bot.createMessage(this.channel_id, { ...contentObj, content: chunk, embed: null }); firstMessage = firstMessage || msg; }