Skip to content

Commit

Permalink
fix(creator): fix syncing erroring for old command classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Snazzah committed Mar 30, 2022
1 parent 33fff14 commit ce7b715
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/creator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
});
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
});
Expand Down

0 comments on commit ce7b715

Please sign in to comment.