From 62e9eca0452c56f6efd00921db8ed6b6302be1df Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Mon, 22 Nov 2021 20:24:19 -0500 Subject: add @notenoughupdates/simplify-number --- src/lib/extensions/discord-akairo/BushClient.ts | 1 - src/lib/extensions/discord-akairo/BushCommand.ts | 70 ++++++++++++++++------ .../discord-akairo/BushCommandHandler.ts | 1 + src/lib/extensions/discord-akairo/BushInhibitor.ts | 8 +-- src/lib/extensions/discord-akairo/BushListener.ts | 1 + .../extensions/discord-akairo/BushSlashMessage.ts | 6 +- src/lib/extensions/discord-akairo/BushTask.ts | 1 + .../extensions/discord-akairo/BushTaskHandler.ts | 3 +- 8 files changed, 65 insertions(+), 26 deletions(-) (limited to 'src/lib/extensions/discord-akairo') diff --git a/src/lib/extensions/discord-akairo/BushClient.ts b/src/lib/extensions/discord-akairo/BushClient.ts index 59aea26..3339a62 100644 --- a/src/lib/extensions/discord-akairo/BushClient.ts +++ b/src/lib/extensions/discord-akairo/BushClient.ts @@ -363,7 +363,6 @@ export class BushClient extends AkairoClient { description?: string; prompt?: ArgumentPromptOptions; } + export interface BushArgumentOptions extends BaseBushArgumentOptions { /** * The type that the argument should be cast to. @@ -93,26 +94,49 @@ export interface CustomBushArgumentOptions extends BaseBushArgumentOptions { export type BushMissingPermissionSupplier = (message: BushMessage | BushSlashMessage) => Promise | any; export interface BushCommandOptions extends Omit { - /** Whether the command is hidden from the help command. */ + /** + * Whether the command is hidden from the help command. + */ hidden?: boolean; - /** The channels the command is limited to run in. */ + + /** + * The channels the command is limited to run in. + */ restrictedChannels?: Snowflake[]; - /** The guilds the command is limited to run in. */ + + /** + * The guilds the command is limited to run in. + */ restrictedGuilds?: Snowflake[]; + description: { content: string; usage: string[]; examples: string[]; }; + args?: BushArgumentOptions[] & CustomBushArgumentOptions[]; + category: string; - /** A fake command, completely hidden from the help command. */ + + /** + * A fake command, completely hidden from the help command. + */ pseudo?: boolean; - /** Allow this command to be run in channels that are blacklisted. */ + + /** + * Allow this command to be run in channels that are blacklisted. + */ bypassChannelBlacklist?: boolean; - /** Permissions required by the client to run this command. */ + + /** + * Permissions required by the client to run this command. + */ clientPermissions: PermissionResolvable | PermissionResolvable[] | BushMissingPermissionSupplier; - /** Permissions required by the user to run this command. */ + + /** + * Permissions required by the user to run this command. + */ userPermissions: PermissionResolvable | PermissionResolvable[] | BushMissingPermissionSupplier; } @@ -127,22 +151,34 @@ export class BushCommand extends Command { examples: string[]; }; - /** The command's options */ + /** + * The command's options + */ public options: BushCommandOptions; - /** The channels the command is limited to run in. */ + /** + * The channels the command is limited to run in. + */ public restrictedChannels: Snowflake[] | undefined; - /** The guilds the command is limited to run in. */ + /** + * The guilds the command is limited to run in. + */ public restrictedGuilds: Snowflake[] | undefined; - /** Whether the command is hidden from the help command. */ + /** + * Whether the command is hidden from the help command. + */ public hidden: boolean; - /** A fake command, completely hidden from the help command. */ + /** + * A fake command, completely hidden from the help command. + */ public pseudo: boolean; - /** Allow this command to be run in channels that are blacklisted. */ + /** + * Allow this command to be run in channels that are blacklisted. + */ public bypassChannelBlacklist: boolean; public constructor(id: string, options: BushCommandOptions) { @@ -164,9 +200,9 @@ export class BushCommand extends Command { this.pseudo = Boolean(options.pseudo); this.bypassChannelBlacklist = Boolean(options.bypassChannelBlacklist); } +} - public override exec(message: BushMessage, args: any): any; - public override exec(message: BushMessage | BushSlashMessage, args: any): any { - super.exec(message, args); - } +export interface BushCommand { + exec(message: BushMessage, args: any): any; + exec(message: BushMessage | BushSlashMessage, args: any): any; } diff --git a/src/lib/extensions/discord-akairo/BushCommandHandler.ts b/src/lib/extensions/discord-akairo/BushCommandHandler.ts index 2a74aa4..a5aabb1 100644 --- a/src/lib/extensions/discord-akairo/BushCommandHandler.ts +++ b/src/lib/extensions/discord-akairo/BushCommandHandler.ts @@ -36,6 +36,7 @@ export class BushCommandHandler extends CommandHandler { public declare client: BushClient; public declare modules: Collection; public declare categories: Collection>; + public constructor(client: BushClient, options: CommandHandlerOptions) { super(client, options); } diff --git a/src/lib/extensions/discord-akairo/BushInhibitor.ts b/src/lib/extensions/discord-akairo/BushInhibitor.ts index 78563c9..c3f9994 100644 --- a/src/lib/extensions/discord-akairo/BushInhibitor.ts +++ b/src/lib/extensions/discord-akairo/BushInhibitor.ts @@ -3,9 +3,9 @@ import { Inhibitor } from 'discord-akairo'; export class BushInhibitor extends Inhibitor { public declare client: BushClient; +} - public override exec(message: BushMessage, command: BushCommand): any; - public override exec(message: BushMessage | BushSlashMessage, command: BushCommand): any { - return super.exec(message, command); - } +export interface BushInhibitor { + exec(message: BushMessage, command: BushCommand): any; + exec(message: BushMessage | BushSlashMessage, command: BushCommand): any; } diff --git a/src/lib/extensions/discord-akairo/BushListener.ts b/src/lib/extensions/discord-akairo/BushListener.ts index 28aefe5..f6247ec 100644 --- a/src/lib/extensions/discord-akairo/BushListener.ts +++ b/src/lib/extensions/discord-akairo/BushListener.ts @@ -4,6 +4,7 @@ import type EventEmitter from 'events'; export class BushListener extends Listener { public declare client: BushClient; + public constructor( id: string, options: { diff --git a/src/lib/extensions/discord-akairo/BushSlashMessage.ts b/src/lib/extensions/discord-akairo/BushSlashMessage.ts index 4e0c297..c0a4a60 100644 --- a/src/lib/extensions/discord-akairo/BushSlashMessage.ts +++ b/src/lib/extensions/discord-akairo/BushSlashMessage.ts @@ -10,8 +10,8 @@ export class BushSlashMessage extends AkairoMessage { public constructor(client: BushClient, interaction: CommandInteraction) { super(client, interaction); } +} - public override get guild(): BushGuild | null { - return super.guild as BushGuild | null; - } +export interface BushSlashMessage { + get guild(): BushGuild | null; } diff --git a/src/lib/extensions/discord-akairo/BushTask.ts b/src/lib/extensions/discord-akairo/BushTask.ts index 4a2068d..b4359ce 100644 --- a/src/lib/extensions/discord-akairo/BushTask.ts +++ b/src/lib/extensions/discord-akairo/BushTask.ts @@ -3,6 +3,7 @@ import { Task, type TaskOptions } from 'discord-akairo'; export class BushTask extends Task { public declare client: BushClient; + public constructor(id: string, options: TaskOptions) { super(id, options); } diff --git a/src/lib/extensions/discord-akairo/BushTaskHandler.ts b/src/lib/extensions/discord-akairo/BushTaskHandler.ts index d5ccad6..ed6b91d 100644 --- a/src/lib/extensions/discord-akairo/BushTaskHandler.ts +++ b/src/lib/extensions/discord-akairo/BushTaskHandler.ts @@ -4,8 +4,9 @@ import { TaskHandler, type AkairoHandlerOptions } from 'discord-akairo'; export type BushTaskHandlerOptions = AkairoHandlerOptions; export class BushTaskHandler extends TaskHandler { + public declare client: BushClient; + public constructor(client: BushClient, options: BushTaskHandlerOptions) { super(client, options); } - declare client: BushClient; } -- cgit