Skip to content

Commit

Permalink
fix: update to latest http-framework
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed Dec 10, 2023
1 parent e1830e2 commit 7b7e6a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/commands/sapphire.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { envParseString } from '@skyra/env-utilities';
import {
Command,
RegisterCommand,
RegisterSubCommand,
RegisterSubcommand,
RestrictGuildIds,
type AutocompleteInteractionArguments,
type InteractionArguments,
Expand Down Expand Up @@ -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<Args>) {
const docsOrGuide = cast<'docs' | 'guide'>(subCommand);

Expand Down
8 changes: 3 additions & 5 deletions src/lib/util/register-commands.ts
Original file line number Diff line number Diff line change
@@ -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();
}
}

0 comments on commit 7b7e6a4

Please sign in to comment.