Home > other >  Discord.JS Send all Embeds from Array
Discord.JS Send all Embeds from Array

Time:01-16

multiple embed pushed in array but i need write them in send message without writing specific number Embeds[0], Embeds[1] and more ...

i cant find a way.

let Embeds = [];

Embeds.push(new MessageEmbed()
   .setTitle("title")
   .setColor("#3d9e00")
   .setDescription("TEST"));

msg.channel.send({
   embeds: [Embeds[0], Embeds[1]]
});

CodePudding user response:

Just use Embeds as embeds value:

msg.channel.send({
   embeds: Embeds
})

By doing: [Embeds[0], Embeds[1]] you are just coping the original array.

  •  Tags:  
  • Related