mirror of
https://github.com/pacnpal/markov-discord.git
synced 2025-12-20 11:01:04 -05:00
A fix to remove the duplicate commands
This commit is contained in:
@@ -492,6 +492,11 @@ client.on('ready', async (readyClient) => {
|
||||
await deployCommands(readyClient.user.id);
|
||||
|
||||
const guildsToSave = readyClient.guilds.valueOf().map((guild) => Guild.create({ id: guild.id }));
|
||||
|
||||
// Remove the duplicate commands
|
||||
if (!config.devGuildId) {
|
||||
await Promise.all(readyClient.guilds.valueOf().map(async (guild) => guild.commands.set([])));
|
||||
}
|
||||
await Guild.upsert(guildsToSave, ['id']);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user