不和谐嵌入(embed.addDescription)

时间:2020-09-29 00:59:57

标签: javascript node.js discord discord.js

作为一个有趣的项目,我创建了我的不和谐机器人。我正在尝试创建待办事项列表(一旦我输入-todo command,机器人就会用已完成的待办事项列表进行响应)。我想在嵌入消息框中放入一个数组。

我可以使用.setDescription(array[])吗?还是有其他方法可以在嵌入框中显示它?它适用于短信,但不能嵌入。

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 个答案:

答案 0 :(得分:0)

是的,您可以使用.setDescription(array)

setDescription接受StringResolvable并将解析的字符串用作嵌入描述。行为与TextBasedChannel#send相同:数组用新行连接。

相关问题