feat: command registry mismatch

This commit is contained in:
TresAbhi committed 2023-06-21 22:31:46 +00:00
1 parent 6f21789c46
commit e49bd6aa68
1 file changed
+5 -3
+5 -3
View File
@@ -86,6 +86,10 @@ const commands = (
evolution,
] as CommandRegistry[]
).reduce<Record<string, CommandRegistry>>((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);