为什么我在运行此代码时收到无效的表单正文作为错误?

时间:2020-07-11 17:25:34

标签: javascript node.js bots discord discord.js

我有这段代码,但是我不太确定为什么我得到(node:4890) UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body name: This field is required作为错误。而且我不确定如何解决此问题。

const loggingChannel = message.guild.channels.cache.find(ch => ch.name === "katsu-member-logs");
if(!loggingChannel) {
const channelName = "katsu-member-logs";
    message.guild.channels.create(channelName, { parent: katsuCategory.id, topic: "Katsu Member Logs" }).then(c => {
        const allUsers = message.guild.roles.cache.find(r => r.name === "@everyone")
        c.updateOverwrite(allUsers, {
            SEND_MESSAGES: false
        })
    });
} else {
    await message.channel.send("Oops, it looks like `katsu-member-logs` channel already exist in this server");
}

0 个答案:

没有答案