所以我现在正试图为我的不和谐机器人发出欢迎信息,但不知何故,我遇到了一个非常奇怪的问题,显然 members.guild.channels.find() 不是一个函数。
client.on('guildMemberAdd', member =>{
const channel = member.guild.channels.find(channel => channel.name === "welcome");
if(!channel) return;
const welcomeEmbed = new Discord.MessageEmbed()
.setColor(pink)
.setAuthor('IdealBot', 'https://hypixel.net/attachments/ideal-png.1417277/', 'https://hypixel.net/threads/ideal-ideal-%E2%9D%96-level-52-%E2%9D%96-sweaty-skyblock-guild-%E2%9D%96-top-10-sb-guild-%E2%9D%96-splashes-%E2%9D%96-events-%E2%9D%96-recruiting.2500755/')
.setTitle('Welcome!')
.setDescription(`${member} just joined the discord! Make sure to read #rules!`)
.setThumbnail(message.user.avatarURL)
.setFooter('Note: The maximum amount of answers is 9.')
.setTimestamp();
channel.send(welcomeEmbed);
});
然而,当我尝试运行它时,出现错误:TypeError: Cannot read property 'find' of undefined
我很确定我以前用过这个,有人知道这个错误可能来自哪里吗?
暮色呼如
蝴蝶不菲
白板的微信
相关分类