【发布时间】:2020-03-05 14:57:03
【问题描述】:
我有一个在 Discord 服务器内创建频道的机器人。我在将频道分配给类别时遇到问题。
我的代码:
if (!message.member.hasPermission("ADMINISTRATOR)")) return message.reply("nope");
if (command === "open") {
if (!args[0]) return message.channel.send('Proper usage: *open <name>');
let botmessage = args.join(" ");
message.guild.createChannel('????' + botmessage, { type: 'text' })
channel.setParent('[ID of Category here]')
机器人成功地创建了频道,但它没有分配到类别中。我得到的错误是:
“频道”未定义。
总的来说,我仍在学习 promise 和 discord.js。 如何让我的 Discord 机器人将创建的频道分配给指定的类别?
【问题讨论】:
标签: node.js promise discord discord.js