由于某种原因,每次我在索引文件中指定的某个通道中运行命令或消息时,控制台都会吐出此错误:TypeError: Cannot read property 'channels' of null
代码如下:
bot.on("message", async message => {
let schannel = message.guild.channels.find(x => x.name === "suggestions");
if(message.member.hasPermission("ADMINISTRATOR")) return
else if(!schannel) return console.log(`There is no suggestions channel!`);;
if (message.channel != schannel || message.author.bot || message.content.startsWith("!suggest")) return;
else message.delete().catch(O_o=> {});
});
答案 0 :(得分:0)
在您要求收集email purchase in 1 hour
abc@gmail.com 3
abc@gmail.com 2
def@gmail.com 3
ghi@gmail.com 1
ghi@gmail.com 1
ghi@gmail.com 2
ghi@gmail.com 2
之前,我会尝试检查公会。
.channel