aboutsummaryrefslogtreecommitdiff
path: root/src/lib/extensions/discord-akairo
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-11-22 20:24:19 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-11-22 20:24:19 -0500
commit62e9eca0452c56f6efd00921db8ed6b6302be1df (patch)
tree5ab61b73d0eab0f9fce36c911cb9429df2a97fd5 /src/lib/extensions/discord-akairo
parent609f042fc2bb5b1ded881d3e9eedb2f92bd0c172 (diff)
downloadtanzanite-62e9eca0452c56f6efd00921db8ed6b6302be1df.tar.gz
tanzanite-62e9eca0452c56f6efd00921db8ed6b6302be1df.tar.bz2
tanzanite-62e9eca0452c56f6efd00921db8ed6b6302be1df.zip
add @notenoughupdates/simplify-number
Diffstat (limited to 'src/lib/extensions/discord-akairo')
-rw-r--r--src/lib/extensions/discord-akairo/BushClient.ts1
-rw-r--r--src/lib/extensions/discord-akairo/BushCommand.ts70
-rw-r--r--src/lib/extensions/discord-akairo/BushCommandHandler.ts1
-rw-r--r--src/lib/extensions/discord-akairo/BushInhibitor.ts8
-rw-r--r--src/lib/extensions/discord-akairo/BushListener.ts1
-rw-r--r--src/lib/extensions/discord-akairo/BushSlashMessage.ts6
-rw-r--r--src/lib/extensions/discord-akairo/BushTask.ts1
-rw-r--r--src/lib/extensions/discord-akairo/BushTaskHandler.ts3
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;
}