fn不是函数-discord.js

时间:2020-06-04 17:27:31

标签: javascript node.js visual-studio discord.js

我添加了本节,当我运行命令时它显示fn is not a function

     if (fn(val, key, this))
                ^
bot.on('message', message => {

    let args = message.content.substring(PREFIX.length).split(" ");

    switch (args[0]) 
    {    
       case 'ssremaining':
                // Get our server
                const guild = bot.guilds.cache.find('701549737068855317');

                // Get our stats channels
                const totalUsers = bot.channels.get('701871141219729538');
                const roleUsers = bot.roles.get('715204365601865769');
        break;
    }
})

1 个答案:

答案 0 :(得分:0)

由于未在find()内使用函数而收到错误

const guild = bot.guilds.cache.find(guild => guild.id === '701549737068855317');