【发布时间】:2020-01-28 08:13:21
【问题描述】:
在特定频道上发送机器人消息时遇到问题。我只是想让机器人在激活时向#general 发送一条消息,让每个人都知道它再次工作。
在 bot.on 函数中,我尝试了经典的 client.channels.get().send(),但我收到的错误消息表明它认为客户端未定义。 (它说“无法读取未定义的属性'通道'”)
bot.on('ready', client => {
console.log("MACsim online")
client.channels.get('#general').send("@here");
})
机器人立即崩溃,说:Cannot read property 'channels' of undefined
【问题讨论】:
标签: node.js discord.js