From cb6368c78c2c3cdc0ff63be600750e81f815ce8c Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Tue, 31 May 2022 19:39:45 -0400 Subject: refactoring & changes to steal command --- src/lib/extensions/discord-akairo/BushCommand.ts | 23 ++++++++++++++++++++--- src/lib/extensions/discord.js/other.ts | 2 ++ 2 files changed, 22 insertions(+), 3 deletions(-) (limited to 'src/lib') diff --git a/src/lib/extensions/discord-akairo/BushCommand.ts b/src/lib/extensions/discord-akairo/BushCommand.ts index 958e451..1797be8 100644 --- a/src/lib/extensions/discord-akairo/BushCommand.ts +++ b/src/lib/extensions/discord-akairo/BushCommand.ts @@ -284,7 +284,7 @@ interface ExtendedCommandOptions { /** * Use instead of {@link BaseBushCommandOptions.args} when using argument generators or custom slashOptions */ - helpArgs?: BushArgumentOptions[]; + helpArgs?: (Omit & { slashType?: AkairoApplicationCommandOptionData['type'] })[]; /** * Extra information about the command, displayed in the help command. @@ -340,6 +340,23 @@ export interface ArgsInfo { type: string; } +export interface ArgsInfoText { + id: string; + description: string; + optional?: boolean; + only: 'text'; + type: string; +} + +export interface ArgsInfoSlash { + id: string; + description: string; + optional?: boolean; + slashType: AkairoApplicationCommandOptionData['type'] | false; + slashResolve?: SlashResolveType; + only: 'slash'; +} + export class BushCommand extends Command { public declare client: BushClient; @@ -486,7 +503,7 @@ export class BushCommand extends Command { id: arg.id, description: arg.description, optional: arg.optional, - slashType: arg.slashType, + slashType: arg.slashType!, slashResolve: arg.slashResolve, only: arg.only, type: (arg.readableType ?? arg.type) as string @@ -539,4 +556,4 @@ interface PseudoArguments extends BaseBushArgumentType { } export type ArgType = NonNullable; -export type OptionalArgType = PseudoArguments[T]; +export type OptArgType = PseudoArguments[T]; diff --git a/src/lib/extensions/discord.js/other.ts b/src/lib/extensions/discord.js/other.ts index aeba01c..0560ffc 100644 --- a/src/lib/extensions/discord.js/other.ts +++ b/src/lib/extensions/discord.js/other.ts @@ -184,3 +184,5 @@ export type BushGuildCacheMessage = CacheTypeReducer< BushMessage | APIMessage, BushMessage | APIMessage >; + +export { ApplicationCommandOptionType as SlashType } from 'discord.js'; -- cgit