From 7b7e6a4ae902bf0b6473c768a0ada39ab2a680e2 Mon Sep 17 00:00:00 2001 From: Jeroen Claassens Date: Sun, 10 Dec 2023 15:49:46 +0100 Subject: [PATCH] fix: update to latest http-framework --- src/commands/sapphire.ts | 6 +++--- src/lib/util/register-commands.ts | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/commands/sapphire.ts b/src/commands/sapphire.ts index cc485ca3..2aaea980 100644 --- a/src/commands/sapphire.ts +++ b/src/commands/sapphire.ts @@ -12,7 +12,7 @@ import { envParseString } from '@skyra/env-utilities'; import { Command, RegisterCommand, - RegisterSubCommand, + RegisterSubcommand, RestrictGuildIds, type AutocompleteInteractionArguments, type InteractionArguments, @@ -63,8 +63,8 @@ export class UserCommand extends Command { }); } - @RegisterSubCommand(buildSubcommandBuilders('docs', 'Search the sapphire documentation')) - @RegisterSubCommand(buildSubcommandBuilders('guide', 'Search the sapphire guide')) + @RegisterSubcommand(buildSubcommandBuilders('docs', 'Search the sapphire documentation')) + @RegisterSubcommand(buildSubcommandBuilders('guide', 'Search the sapphire guide')) protected async sharedRun(interaction: Command.Interaction, { subCommand, query, target }: InteractionArguments) { const docsOrGuide = cast<'docs' | 'guide'>(subCommand); diff --git a/src/lib/util/register-commands.ts b/src/lib/util/register-commands.ts index 82eb055d..13d826f4 100644 --- a/src/lib/util/register-commands.ts +++ b/src/lib/util/register-commands.ts @@ -1,12 +1,10 @@ import { envParseString } from '@skyra/env-utilities'; -import { Registry } from '@skyra/http-framework'; +import { applicationCommandRegistry } from '@skyra/http-framework'; export async function registerCommands() { - const registry = new Registry({}); - if (envParseString('NODE_ENV') === 'development') { - await registry.registerGuildRestrictedCommands(); + await applicationCommandRegistry.pushGuildRestrictedCommands(); } else { - await registry.registerGlobalCommands(); + await applicationCommandRegistry.pushGlobalCommands(); } }