Discord.js bot两次执行所有操作

我正在为我的私有不和谐服务器编写此bot的代码,发现此bug /故障导致该bot两次执行了所有操作。在我的控制台中,它还会记录两次,两次回答。这是我的代码:

(我不知道这是否重要,但是您可以看到最后两个命令不存在,因为我当前正在制作命令处理程序,并且仅转换了一些命令)。

您知道是什么原因/如何修复吗?

const bot = new Discord.Client();
const token = '---my token---';
var PREFIX = 'bb!';
var member



const fs = require('fs');
bot.commands = new Discord.Collection();

const commandFiles = fs.readdirSync('./commands/').filter(File => File.endsWith('.js'));
for(const file of commandFiles){
    const command = require(`./commands/${file}`);
    bot.commands.set(command.name, command);

bot.on('ready', () =>{
    console.log('Discord Bot Is Online.');
    bot.user.setActivity('In BitBots FunHouse', { type: 'PLAYING'}).catch(console.error);
})


bot.on('message', msg=>{


    var args = msg.content.substring(PREFIX.length).split(" ");
    switch(args[0]){
        case 'Test':
            msg.channel.send('Bot Online.');
        break;





       case 'Help':
        const exampleEmbed = new Discord.MessageEmbed()
            .setColor('#FF8C00')
            .setTitle('BitBot Help Menu')
            .setAuthor('MrFishy', )
            .setDescription('BitBot Help & Commands Menu')
            .addFields(
                { name: 'Test', value: 'More test' },
                  { name: '\u200B', value: '\u200B' },
                  { name: 'Inline field title', value: 'Some value here', inline: true },
                  { name: 'Inline field title', value: 'Some value here', inline: true },
              )
              .addField('Test subtitle', 'Test value', true)
              .setTimestamp()
             .setFooter('All commands start with bb!', 'https://i.imgur.com/Naujnff.png');

        msg.channel.send(exampleEmbed);
        break;


       case 'Delete':
        if(!msg.member.hasPermission("MANAGE_MESSAGES")) return msg.reply("You cannot use this command since you do not have a role with `MANAGE_MESSAGES` enabled.");
        if(!args[1]) return msg.reply("Please specify the number of messages you want to delete.");
        if(parseInt(args[1]) > 100) return msg.reply("You cannot delete more than 100 messages at once!");

        msg.channel.bulkDelete(parseInt(args[1]) + 1).then(() => {
            msg.channel.send(`Deleted ${args[1]} messages!`).then(msg.channel.delete);
        }).catch((err) => {
            return msg.reply("An error occured!")
        })
        break;

        case '8ball':
            bot.commands.get('8ball').execute(msg, args);
        break;

        case 'GetRekt':
                bot.commands.get('GetRekt').execute(msg, args);
        break;    

    }


}
)
bot.login(token);




}```

Code in one of the different command files (Just in case it helps):

```module.exports = {
    name: 'GetRekt'
    ,description: "Sends the GetRekt image.",
    execute(message, args){
        message.channel.send('Get rekt, bro. https://i.imgur.com/3qvm3d0.png');

    }
}```


Sorry if that's too much to read through, I just did not finish moving all the commands to separate files.