Skip to content

Commit

Permalink
feat: remove CommandChatInputRegisterShortcut alias interface, pref…
Browse files Browse the repository at this point in the history
…er 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.
  • Loading branch information
favna committed Feb 5, 2023
1 parent dd548ef commit 18ad9fa
Showing 1 changed file with 1 addition and 50 deletions.
51 changes: 1 addition & 50 deletions src/lib/structures/Command.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { ArgumentStream, Lexer, Parser, type IUnorderedStrategy } from '@sapphire/lexure';
import { AliasPiece, type AliasPieceJSON, type AliasStore } from '@sapphire/pieces';
import { isNullish, type Awaitable, type NonNullObject } from '@sapphire/utilities';
import type { LocalizationMap } from 'discord-api-types/v10';
import {
ChatInputCommandInteraction,
ContextMenuCommandInteraction,
Expand All @@ -12,7 +11,7 @@ import {
type Snowflake
} from 'discord.js';
import { Args } from '../parsers/Args';
import { BucketScope, RegisterBehavior } from '../types/Enums';
import { BucketScope } from '../types/Enums';
import { acquire } from '../utils/application-commands/ApplicationCommandRegistries';
import type { ApplicationCommandRegistry } from '../utils/application-commands/ApplicationCommandRegistry';
import { emitRegistryError } from '../utils/application-commands/emitRegistryError';
Expand Down Expand Up @@ -709,54 +708,6 @@ export interface CommandOptions extends AliasPiece.Options, FlagStrategyOptions
typing?: boolean;
}

export interface CommandChatInputRegisterShortcut {
/**
* Specifies what we should do when the command is present, but not identical with the data you provided
* @default RegisterBehavior.LogToConsole
*/
behaviorWhenNotIdentical?: RegisterBehavior;
/**
* If we should register the command, be it missing or present already
* @default false
*/
register: boolean;
/**
* If this is specified, the application commands will only be registered for these guild ids.
*
* :::tip
*
* If you want to register both guild and global chat input commands,
* please read the [guide about registering application commands](https://www.sapphirejs.dev/docs/Guide/commands/registering-application-commands) instead.
*
* :::
*
*/
guildIds?: string[];
/**
* Specifies a list of command ids that we should check in the event of a name mismatch
* @default []
*/
idHints?: string[];
/**
* Sets the `defaultPermission` field for the chat input command
*
* :::warn
*
* This will be deprecated in the future for Discord's new permission system.
*
* :::
*/
defaultPermission?: boolean;
/**
* Sets the `nameLocalizations` for the chat input command
*/
nameLocalizations?: LocalizationMap;
/**
* Sets the `descriptionLocalizations` for the chat input command
*/
descriptionLocalizations?: LocalizationMap;
}

export interface MessageCommandContext extends Record<PropertyKey, unknown> {
/**
* The prefix used to run this command.
Expand Down

0 comments on commit 18ad9fa

Please sign in to comment.