aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-05-31 19:39:45 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-05-31 19:39:45 -0400
commitcb6368c78c2c3cdc0ff63be600750e81f815ce8c (patch)
tree0a1bb327f808e6a192277eaff9e8e1ab04ba20ee /src/lib
parent302461fcd34de14eccd4d18664af3fc12a37b4d5 (diff)
downloadtanzanite-cb6368c78c2c3cdc0ff63be600750e81f815ce8c.tar.gz
tanzanite-cb6368c78c2c3cdc0ff63be600750e81f815ce8c.tar.bz2
tanzanite-cb6368c78c2c3cdc0ff63be600750e81f815ce8c.zip
refactoring & changes to steal command
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/extensions/discord-akairo/BushCommand.ts23
-rw-r--r--src/lib/extensions/discord.js/other.ts2
2 files changed, 22 insertions, 3 deletions
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<BushArgumentOptions, 'slashType'> & { 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<T extends keyof PseudoArguments> = NonNullable<PseudoArguments[T]>;
-export type OptionalArgType<T extends keyof PseudoArguments> = PseudoArguments[T];
+export type OptArgType<T extends keyof PseudoArguments> = 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<Cached extends CacheType> = CacheTypeReducer<
BushMessage | APIMessage,
BushMessage | APIMessage
>;
+
+export { ApplicationCommandOptionType as SlashType } from 'discord.js';