diff --git a/src/events/interactionCreate.ts b/src/events/interactionCreate.ts index 48e30dd6b..3b0dd2a75 100644 --- a/src/events/interactionCreate.ts +++ b/src/events/interactionCreate.ts @@ -86,6 +86,10 @@ const commands = ( evolution, ] as CommandRegistry[] ).reduce>((accumulator, registry) => { + registry.command.setName( + isDev() ? `${registry.command.name}dev` : registry.command.name, + ); + return { ...accumulator, [registry.command.name]: registry }; }, {}); @@ -96,9 +100,7 @@ export const publicCommands: RESTPostAPIChatInputApplicationCommandsJSONBody[] = Object.entries(commands).forEach(([, registry]) => { if (isDev() ? registry.inDevelopment : registry.inProduction) { - const json = registry.command - .setName(isDev() ? `${registry.command.name}dev` : registry.command.name) - .toJSON(); + const json = registry.command.toJSON(); if (registry.inPublic) { publicCommands.push(json);