ReferenceError:通道未定义

时间:2020-08-11 10:11:07

标签: javascript discord discord.js

我想知道为什么会收到此错误...听起来可能很糟糕,但我真的不明白! T-T

client.on("guildMemberAdd", async member => {
    let welcome = member.guild.channels.cache.find(channel.name === "〢〘?〙?ιsᥴᥙssιoᥒ").send(`Coucou ! <@!${user.id}>`)
}),

1 个答案:

答案 0 :(得分:2)

您在channel => 调用中缺少find函数参数声明。

client.on("guildMemberAdd", async (member) => {
  let welcome = member.guild.channels.cache
    .find((channel) => channel.name === "〢〘?〙?ιsᥴᥙssιoᥒ")
    .send(`Coucou ! <@!${user.id}>`);
});