错误:TypeError:message.guild.channels.find不是函数

时间:2020-05-10 15:16:04

标签: discord.js

我在寻找频道时遇到了问题!代码:

    let chan = `ticket-${message.author.username}`;

    if (message.guild.channels.find(channel => channel.name === chan)) {
            message.channel.send("You already have a channel!")
    }

错误:

TypeError: message.guild.channels.find is not a function

我希望有人能帮助我! :-)

1 个答案:

答案 0 :(得分:0)

从discord.js v12开始,您需要使用(new TotalFullDays( new FromRange( new FromISO8601('2011-08-19 17:14:40'), new Now() ) )) ->value(); 访问channels集合,因此您的解决方案将是:

cache