From 3cd243a50fb15971dd2b707f2f336b25f29a22f3 Mon Sep 17 00:00:00 2001 From: John Marlo Date: Fri, 1 Apr 2022 18:55:40 +0800 Subject: [PATCH] revert embeds,.. --- src/structures/MessagePayload.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/structures/MessagePayload.js b/src/structures/MessagePayload.js index d56ae44..8aa45b7 100644 --- a/src/structures/MessagePayload.js +++ b/src/structures/MessagePayload.js @@ -189,22 +189,20 @@ class MessagePayload { this.options.attachments = attachments; } - if (this.options.webembeds) { - //check if webembeds is an array + if (this.options.embeds) { + //check if embed is an array if (!Array.isArray(this.options.embeds)) { this.options.embeds = [this.options.embeds]; } //check if the webembeds is an array of WebEmbed - if (!this.options.webembeds.every(e => e instanceof WebEmbed)) { - throw new TypeError('WEB_EMBEDS_TYPE'); - } - - //while loop to make sure all embeds will be added to the content - while (this.options.webembeds.length) { - const webembeds = this.options.webembeds.shift(); - const data = await webembeds.toMessage(); - content +=`\n${data}` + if (this.options.embeds.every(embed => embed instanceof WebEmbed)) { + //while loop to make sure all embeds will be added to the content + while (this.options.embeds.length) { + const embed = this.options.embeds.shift(); + const data = await embed.toMessage(); + content +=`\n${data}` + } } }