From ce7b715d7b63b5498d27802e7b19066efaa83627 Mon Sep 17 00:00:00 2001 From: Snazzah Date: Wed, 30 Mar 2022 17:45:35 -0500 Subject: [PATCH] fix(creator): fix syncing erroring for old command classes --- src/creator.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/creator.ts b/src/creator.ts index d2e123d1..d820413a 100644 --- a/src/creator.ts +++ b/src/creator.ts @@ -340,7 +340,7 @@ export class SlashCreator extends (EventEmitter as any as new () => TypedEventEm 'debug', `Found guild command "${applicationCommand.name}" (${applicationCommand.id}, type ${applicationCommand.type}, guild: ${guildID})` ); - await command.onLocaleUpdate(); + if (command.onLocaleUpdate) await command.onLocaleUpdate(); updatePayload.push({ id: applicationCommand.id, ...command.commandJSON @@ -371,7 +371,7 @@ export class SlashCreator extends (EventEmitter as any as new () => TypedEventEm for (const [, command] of unhandledCommands) { this.emit('debug', `Creating guild command "${command.commandName}" (type ${command.type}, guild: ${guildID})`); - await command.onLocaleUpdate(); + if (command.onLocaleUpdate) await command.onLocaleUpdate(); updatePayload.push({ ...command.commandJSON }); @@ -416,7 +416,7 @@ export class SlashCreator extends (EventEmitter as any as new () => TypedEventEm 'debug', `Found command "${applicationCommand.name}" (${applicationCommand.id}, type ${applicationCommand.type})` ); - await command.onLocaleUpdate(); + if (command.onLocaleUpdate) await command.onLocaleUpdate(); updatePayload.push({ id: applicationCommand.id, ...command.commandJSON @@ -447,7 +447,7 @@ export class SlashCreator extends (EventEmitter as any as new () => TypedEventEm for (const [, command] of unhandledCommands) { this.emit('debug', `Creating command "${command.commandName}" (type ${command.type})`); - await command.onLocaleUpdate(); + if (command.onLocaleUpdate) await command.onLocaleUpdate(); updatePayload.push({ ...command.commandJSON });