Skip to content

Commit 18ad9fa

Browse files
authoredFeb 5, 2023
feat: remove CommandChatInputRegisterShortcut alias interface, prefer using ApplicationCommandRegistry.RegisterOptions instead (#597)
The old interface exposed options that were not actually supported by Sapphire, which was misleading. The whole interface could in fact be removed, but that would be a breaking change, so for now we mark it as deprecated and make it a type alias. While normally removing interface options would be a breaking change too, these particular options already did absolutely nothing and weren't being read anywhere anymore. Anyone who still had this option and will get a TypeScript build error can simply remove the options.
1 parent dd548ef commit 18ad9fa

File tree

1 file changed

+1
-50
lines changed

1 file changed

+1
-50
lines changed
 

‎src/lib/structures/Command.ts

+1-50
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { ArgumentStream, Lexer, Parser, type IUnorderedStrategy } from '@sapphire/lexure';
22
import { AliasPiece, type AliasPieceJSON, type AliasStore } from '@sapphire/pieces';
33
import { isNullish, type Awaitable, type NonNullObject } from '@sapphire/utilities';
4-
import type { LocalizationMap } from 'discord-api-types/v10';
54
import {
65
ChatInputCommandInteraction,
76
ContextMenuCommandInteraction,
@@ -12,7 +11,7 @@ import {
1211
type Snowflake
1312
} from 'discord.js';
1413
import { Args } from '../parsers/Args';
15-
import { BucketScope, RegisterBehavior } from '../types/Enums';
14+
import { BucketScope } from '../types/Enums';
1615
import { acquire } from '../utils/application-commands/ApplicationCommandRegistries';
1716
import type { ApplicationCommandRegistry } from '../utils/application-commands/ApplicationCommandRegistry';
1817
import { emitRegistryError } from '../utils/application-commands/emitRegistryError';
@@ -709,54 +708,6 @@ export interface CommandOptions extends AliasPiece.Options, FlagStrategyOptions
709708
typing?: boolean;
710709
}
711710

712-
export interface CommandChatInputRegisterShortcut {
713-
/**
714-
* Specifies what we should do when the command is present, but not identical with the data you provided
715-
* @default RegisterBehavior.LogToConsole
716-
*/
717-
behaviorWhenNotIdentical?: RegisterBehavior;
718-
/**
719-
* If we should register the command, be it missing or present already
720-
* @default false
721-
*/
722-
register: boolean;
723-
/**
724-
* If this is specified, the application commands will only be registered for these guild ids.
725-
*
726-
* :::tip
727-
*
728-
* If you want to register both guild and global chat input commands,
729-
* please read the [guide about registering application commands](https://www.sapphirejs.dev/docs/Guide/commands/registering-application-commands) instead.
730-
*
731-
* :::
732-
*
733-
*/
734-
guildIds?: string[];
735-
/**
736-
* Specifies a list of command ids that we should check in the event of a name mismatch
737-
* @default []
738-
*/
739-
idHints?: string[];
740-
/**
741-
* Sets the `defaultPermission` field for the chat input command
742-
*
743-
* :::warn
744-
*
745-
* This will be deprecated in the future for Discord's new permission system.
746-
*
747-
* :::
748-
*/
749-
defaultPermission?: boolean;
750-
/**
751-
* Sets the `nameLocalizations` for the chat input command
752-
*/
753-
nameLocalizations?: LocalizationMap;
754-
/**
755-
* Sets the `descriptionLocalizations` for the chat input command
756-
*/
757-
descriptionLocalizations?: LocalizationMap;
758-
}
759-
760711
export interface MessageCommandContext extends Record<PropertyKey, unknown> {
761712
/**
762713
* The prefix used to run this command.

0 commit comments

Comments
 (0)
Please sign in to comment.