简体   繁体   English

fn 不是 function - discord.js

[英]fn is not a function - discord.js

I added this section and when I run the command it says fn is not a function我添加了这一部分,当我运行命令时它说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;
    }
})

You are getting the error because you're not using a function inside find()您收到错误是因为您没有在find()中使用 function

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM