defaultChannel.send不是函数

时间:2018-07-22 11:11:05

标签: javascript discord discord.js

添加自动程序后,我有一些代码向服务器打招呼。

client.on("guildCreate", guild => {
    const defaultChannel = guild.channels.find(c => c.permissionsFor(guild.me).has("SEND_MESSAGES"));
    defaultChannel.send(`Hi! Thanks for adding me to your server!`).catch(console.error);
});  

它找到一个可以向其发送消息并发送感谢消息的频道。

运行上面的代码时,出现以下错误:TypeError: defaultChannel.send is not a function

0 个答案:

没有答案