mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 12:09:51 +02:00
feat: command registry mismatch
This commit is contained in:
1 parent
6f21789c46
commit
e49bd6aa68
1 file changed
+5
-3
@@ -86,6 +86,10 @@ const commands = (
|
|||||||
evolution,
|
evolution,
|
||||||
] as CommandRegistry[]
|
] as CommandRegistry[]
|
||||||
).reduce<Record<string, CommandRegistry>>((accumulator, registry) => {
|
).reduce<Record<string, CommandRegistry>>((accumulator, registry) => {
|
||||||
|
registry.command.setName(
|
||||||
|
isDev() ? `${registry.command.name}dev` : registry.command.name,
|
||||||
|
);
|
||||||
|
|
||||||
return { ...accumulator, [registry.command.name]: registry };
|
return { ...accumulator, [registry.command.name]: registry };
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
@@ -96,9 +100,7 @@ export const publicCommands: RESTPostAPIChatInputApplicationCommandsJSONBody[] =
|
|||||||
|
|
||||||
Object.entries(commands).forEach(([, registry]) => {
|
Object.entries(commands).forEach(([, registry]) => {
|
||||||
if (isDev() ? registry.inDevelopment : registry.inProduction) {
|
if (isDev() ? registry.inDevelopment : registry.inProduction) {
|
||||||
const json = registry.command
|
const json = registry.command.toJSON();
|
||||||
.setName(isDev() ? `${registry.command.name}dev` : registry.command.name)
|
|
||||||
.toJSON();
|
|
||||||
|
|
||||||
if (registry.inPublic) {
|
if (registry.inPublic) {
|
||||||
publicCommands.push(json);
|
publicCommands.push(json);
|
||||||
|
|||||||
Reference in new issue
Block a user