Skip to content

Commit

Permalink
fix(subcommands): remove deprecated `SubcommandPluginEvents.ChatInput…
Browse files Browse the repository at this point in the history
…SubCommandDenied`

BREAKING CHANGE: `SubcommandPluginEvents.ChatInputSubCommandDenied` has been removed. Use `SubcommandPluginEvents.ChatInputSubcommandDenied` instead. If you previously named your listener file `chatInputSubCommandDenied.<ext>` then you will also need to rename it to `chatInputSubcommandDenied.<ext>`. Note the change in capital C in `Subcommand`.
  • Loading branch information
favna committed Oct 26, 2023
1 parent d0df8aa commit d14f023
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion packages/subcommands/src/lib/Subcommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ export class Subcommand<PreParseReturn extends Args = Args, O extends Subcommand
// Run the subcommand specific preconditions:
const localSubcommandResult = await preconditionsForSubcommand.chatInputRun(interaction, this, payload as any);
if (localSubcommandResult.isErr()) {
this.container.client.emit(SubcommandPluginEvents.ChatInputSubCommandDenied, localSubcommandResult.unwrapErr(), payload);
this.container.client.emit(SubcommandPluginEvents.ChatInputSubcommandDenied, localSubcommandResult.unwrapErr(), payload);
return;
}
}
Expand Down
5 changes: 0 additions & 5 deletions packages/subcommands/src/lib/types/Events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import type { Subcommand } from '../Subcommand';
import type { ChatInputCommandSubcommandMappingMethod, MessageSubcommandMappingMethod, SubcommandMappingMethod } from './SubcommandMappings';

export const SubcommandPluginEvents = {
/** @deprecated use {@link SubcommandPluginEvents.ChatInputSubcommandDenied} */
ChatInputSubCommandDenied: 'chatInputSubCommandDenied' as const,

ChatInputSubcommandDenied: 'chatInputSubcommandDenied' as const,
ChatInputSubcommandRun: 'chatInputSubcommandRun' as const,
ChatInputSubcommandSuccess: 'chatInputSubcommandSuccess' as const,
Expand Down Expand Up @@ -83,8 +80,6 @@ export interface ChatInputSubcommandSuccessPayload extends ChatInputSubcommandRu

declare module 'discord.js' {
interface ClientEvents {
/** @deprecated use {@link SubcommandPluginEvents.ChatInputSubcommandDenied} */
[SubcommandPluginEvents.ChatInputSubCommandDenied]: [error: UserError, payload: ChatInputSubcommandDeniedPayload];
[SubcommandPluginEvents.ChatInputSubcommandDenied]: [error: UserError, payload: ChatInputSubcommandDeniedPayload];
[SubcommandPluginEvents.ChatInputSubcommandRun]: [
interaction: ChatInputCommand.Interaction,
Expand Down

0 comments on commit d14f023

Please sign in to comment.