diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-06-19 16:43:37 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-06-19 16:43:37 -0400 |
commit | ea64ebfff9aae32deb036643422d3427959dcd24 (patch) | |
tree | 5ab83558642bad282515837424637070f547a05e /src/lib/extensions/BushCommand.ts | |
parent | d055e0dbb86ef7fd4ee96a1531b51181e825fb4b (diff) | |
download | tanzanite-ea64ebfff9aae32deb036643422d3427959dcd24.tar.gz tanzanite-ea64ebfff9aae32deb036643422d3427959dcd24.tar.bz2 tanzanite-ea64ebfff9aae32deb036643422d3427959dcd24.zip |
feat(*): A bunch of stuff
- Remade logging
- updated dependencies
- started adding custom crap to the command handler
- added emojis to stuff
- can't remeber other stuff
Note: this is currently broken
BREAKING CHANGE:
Diffstat (limited to 'src/lib/extensions/BushCommand.ts')
-rw-r--r-- | src/lib/extensions/BushCommand.ts | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/src/lib/extensions/BushCommand.ts b/src/lib/extensions/BushCommand.ts index 2b34c69..9de2c95 100644 --- a/src/lib/extensions/BushCommand.ts +++ b/src/lib/extensions/BushCommand.ts @@ -1,8 +1,16 @@ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { Command, CommandOptions } from 'discord-akairo'; import { APIApplicationCommandOption } from 'discord-api-types'; +import { CommandInteraction, Snowflake } from 'discord.js'; import { BushClient } from './BushClient'; +import { BushInteractionMessage } from './BushInteractionMessage'; +import { BushMessage } from './BushMessage'; export interface BushCommandOptions extends CommandOptions { + hidden?: boolean; + restrictedChannels?: Snowflake[]; + restrictedGuilds?: Snowflake[]; slashCommandOptions?: APIApplicationCommandOption[]; description: { content: string; @@ -12,10 +20,33 @@ export interface BushCommandOptions extends CommandOptions { } export class BushCommand extends Command { - public client: BushClient; - options: BushCommandOptions; + public declare client: BushClient; + public options: BushCommandOptions; + /** The channels the command is limited to run in. */ + public restrictedChannels: Snowflake[]; + /** The guilds the command is limited to run in. */ + public restrictedGuilds: Snowflake[]; + /** Whether the command is hidden from the help command. */ + public hidden: boolean; constructor(id: string, options?: BushCommandOptions) { super(id, options); this.options = options; + this.hidden = options.hidden || false; + this.restrictedChannels = options.restrictedChannels; + this.restrictedGuilds = options.restrictedGuilds; + } + + public exec(message: BushMessage, args: any): any; + // @ts-ignore: They are close enough + public exec(message: BushMessage | BushInteractionMessage, args: any): any { + // @ts-ignore: They are close enough + super.exec(message, args); + } + + /** Be careful when using this with a slash command since only the interaction is parsed as the message */ + public before(message: BushMessage): any; + public before(message: BushMessage | CommandInteraction): any; + public before(message) { + super.before(message); } } |