提问者:小点点

不一致尝试在终端中运行命令时,JS token ban函数无法正常工作


好的,所以我试图创建一个不和谐的机器人,使用ban命令,但后来发生了这种情况

https://i.stack.imgur.com/ogAHf.png

这是我的密码

https://i.stack.imgur.com/5ceGo.png

我该怎么解决这个问题?


共1个答案

匿名用户

应该是:

module.exports = {
    name: 'ban',
    description: "This command bans people",
    execute(message, args) {

        if(message.member.roles.cache.has('923203237019004958')) {
            const member = message.mentions.members.first();
            if(member) {
                const memberTarger = message.guild.members.cache.get(member.id);
                memberTarger.ban();
                message.channel.send("User has been banned from the paper bag");
            }
            else {
                message.channel.send("You don't have the sufficent permissions to run this command")
            }
        }

    }
}

execute(message,args)旁边有一个结束括号},但它应该是一个开始括号{