revert embeds,..
This commit is contained in:
parent
e552d14305
commit
3cd243a50f
@ -189,24 +189,22 @@ class MessagePayload {
|
|||||||
this.options.attachments = attachments;
|
this.options.attachments = attachments;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.options.webembeds) {
|
if (this.options.embeds) {
|
||||||
//check if webembeds is an array
|
//check if embed is an array
|
||||||
if (!Array.isArray(this.options.embeds)) {
|
if (!Array.isArray(this.options.embeds)) {
|
||||||
this.options.embeds = [this.options.embeds];
|
this.options.embeds = [this.options.embeds];
|
||||||
}
|
}
|
||||||
|
|
||||||
//check if the webembeds is an array of WebEmbed
|
//check if the webembeds is an array of WebEmbed
|
||||||
if (!this.options.webembeds.every(e => e instanceof WebEmbed)) {
|
if (this.options.embeds.every(embed => embed instanceof WebEmbed)) {
|
||||||
throw new TypeError('WEB_EMBEDS_TYPE');
|
|
||||||
}
|
|
||||||
|
|
||||||
//while loop to make sure all embeds will be added to the content
|
//while loop to make sure all embeds will be added to the content
|
||||||
while (this.options.webembeds.length) {
|
while (this.options.embeds.length) {
|
||||||
const webembeds = this.options.webembeds.shift();
|
const embed = this.options.embeds.shift();
|
||||||
const data = await webembeds.toMessage();
|
const data = await embed.toMessage();
|
||||||
content +=`\n${data}`
|
content +=`\n${data}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.data = {
|
this.data = {
|
||||||
content,
|
content,
|
||||||
|
Loading…
Reference in New Issue
Block a user