From 009499d13d5aa9ac4c2be0e3d5fd6e95e4df7fbe Mon Sep 17 00:00:00 2001 From: Almeida Date: Fri, 11 Jun 2021 20:00:07 +0100 Subject: [PATCH 1/2] fix(TextBasedChannel): allow passing an APIMessage with split --- src/structures/interfaces/TextBasedChannel.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/structures/interfaces/TextBasedChannel.js b/src/structures/interfaces/TextBasedChannel.js index 11af7125502d..af2b99c39956 100644 --- a/src/structures/interfaces/TextBasedChannel.js +++ b/src/structures/interfaces/TextBasedChannel.js @@ -173,9 +173,10 @@ class TextBasedChannel { apiMessage = options.resolveData(); } else { apiMessage = APIMessage.create(this, options).resolveData(); - if (Array.isArray(apiMessage.data.content)) { - return Promise.all(apiMessage.split().map(this.send.bind(this))); - } + } + + if (Array.isArray(apiMessage.data.content)) { + return Promise.all(apiMessage.split().map(this.send.bind(this))); } const { data, files } = await apiMessage.resolveFiles(); From 8d7b4dace43ae03ab9d871747300b90f4a357756 Mon Sep 17 00:00:00 2001 From: Almeida Date: Fri, 11 Jun 2021 21:41:45 +0100 Subject: [PATCH 2/2] fix(Webhook): allow passing an APIMessage with slit --- src/structures/Webhook.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/structures/Webhook.js b/src/structures/Webhook.js index 6c945fb5e2fe..d39eed7bdd1c 100644 --- a/src/structures/Webhook.js +++ b/src/structures/Webhook.js @@ -158,9 +158,10 @@ class Webhook { apiMessage = options.resolveData(); } else { apiMessage = APIMessage.create(this, options).resolveData(); - if (Array.isArray(apiMessage.data.content)) { - return Promise.all(apiMessage.split().map(this.send.bind(this))); - } + } + + if (Array.isArray(apiMessage.data.content)) { + return Promise.all(apiMessage.split().map(this.send.bind(this))); } const { data, files } = await apiMessage.resolveFiles();