diff options
Diffstat (limited to 'src/lib/extensions/discord-akairo')
8 files changed, 65 insertions, 26 deletions
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<Ready extends boolean = boolean> extends AkairoClient<Re try { await this.#init(); await this.login(this.token!); - this.taskHandler.startAll(); } catch (e) { await this.console.error('start', util.inspect(e, { colors: true, depth: 1 }), false); } diff --git a/src/lib/extensions/discord-akairo/BushCommand.ts b/src/lib/extensions/discord-akairo/BushCommand.ts index 11f5ee3..1494aee 100644 --- a/src/lib/extensions/discord-akairo/BushCommand.ts +++ b/src/lib/extensions/discord-akairo/BushCommand.ts @@ -27,6 +27,7 @@ interface BaseBushArgumentOptions extends Omit<ArgumentOptions, 'type'> { 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> | any; export interface BushCommandOptions extends Omit<CommandOptions, 'userPermissions' | 'clientPermissions'> { - /** 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<string, BushCommand>; public declare categories: Collection<string, Category<string, BushCommand>>; + 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; } |