Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove CommandChatInputRegisterShortcut alias interface, prefer using ApplicationCommandRegistry.RegisterOptions instead #597

Merged
merged 2 commits into from
Feb 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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