0
votes

I have created a discord bot of mine just as a fun project. I am trying to make a todo list (the bot responds with a made todo list once I type a -todo command). I want to put an array in an embed message box.

Can I use .setDescription(array[])? Or is there another way to display it in the embed box? It works with text messages but not as an embed.

module.exports = {
  name: 'todolist',
  description: 'Sends a to do list in the channel',
  execute(message, args) {
    let i;
    for(i = 0 ; i < todolist.length; i++){
      message.channel.send(`${todolist[i]}`);
    }
  },
};
1

1 Answers

0
votes

Yes, you can use .setDescription(array).

setDescription accepts a StringResolvable and uses the resolved string as the embed description. This behaves in the same way as TextBasedChannel#send: arrays are joined with a new line.