diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-11-22 20:24:19 -0500 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-11-22 20:24:19 -0500 |
commit | 62e9eca0452c56f6efd00921db8ed6b6302be1df (patch) | |
tree | 5ab61b73d0eab0f9fce36c911cb9429df2a97fd5 | |
parent | 609f042fc2bb5b1ded881d3e9eedb2f92bd0c172 (diff) | |
download | tanzanite-62e9eca0452c56f6efd00921db8ed6b6302be1df.tar.gz tanzanite-62e9eca0452c56f6efd00921db8ed6b6302be1df.tar.bz2 tanzanite-62e9eca0452c56f6efd00921db8ed6b6302be1df.zip |
add @notenoughupdates/simplify-number
37 files changed, 111 insertions, 48 deletions
diff --git a/package.json b/package.json index 9ea3a19..99c5b07 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "@notenoughupdates/discord.js-minesweeper": "^1.0.8", "@notenoughupdates/events-intercept": "^3.0.1", "@notenoughupdates/humanize-duration": "^4.0.1", + "@notenoughupdates/simplify-number": "^1.0.1", "@notenoughupdates/wolfram-alpha-api": "^1.0.1", "@sentry/node": "^6.15.0", "@sentry/tracing": "^6.15.0", @@ -72,7 +73,6 @@ "pretty-bytes": "^5.6.0", "rimraf": "^3.0.2", "sequelize": "^6.12.0-alpha.1", - "simplify-number": "^1.0.0", "source-map-support": "^0.5.21", "tinycolor2": "^1.4.2", "tslib": "^2.3.1", diff --git a/src/commands/leveling/level.ts b/src/commands/leveling/level.ts index eb86155..36fb153 100644 --- a/src/commands/leveling/level.ts +++ b/src/commands/leveling/level.ts @@ -8,15 +8,13 @@ import { type BushSlashMessage, type BushUser } from '#lib'; +import { SimplifyNumber } from '@notenoughupdates/simplify-number'; import canvas from 'canvas'; import { MessageAttachment } from 'discord.js'; import got from 'got'; import { dirname, join } from 'path'; import { fileURLToPath } from 'url'; -// idk why I need to do default twice, it is being weird -const { default: SimplifyNumber } = (await import('simplify-number')).default as unknown as typeof import('simplify-number'); - export default class LevelCommand extends BushCommand { public constructor() { super('level', { diff --git a/src/lib/common/AutoMod.ts b/src/lib/common/AutoMod.ts index 8b31e55..5fd5d2d 100644 --- a/src/lib/common/AutoMod.ts +++ b/src/lib/common/AutoMod.ts @@ -129,7 +129,7 @@ export class AutoMod { return color; async function deleteError(this: AutoMod, e: Error | any) { - this.message.guild?.sendLogChannel('error', { + void this.message.guild?.sendLogChannel('error', { embeds: [ { title: 'AutoMod Error', diff --git a/src/lib/common/Format.ts b/src/lib/common/Format.ts index 55a6666..b47be38 100644 --- a/src/lib/common/Format.ts +++ b/src/lib/common/Format.ts @@ -10,6 +10,7 @@ export class Format { * @param content The content to wrap. */ public static codeBlock(content: string): string; + /** * Wraps the content inside a codeblock with the specified language. * @param language The language for the codeblock. 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; } diff --git a/src/lib/extensions/discord.js/BushActivity.ts b/src/lib/extensions/discord.js/BushActivity.ts index 10d7f05..e438918 100644 --- a/src/lib/extensions/discord.js/BushActivity.ts +++ b/src/lib/extensions/discord.js/BushActivity.ts @@ -4,6 +4,7 @@ import type { RawActivityData } from 'discord.js/typings/rawDataTypes'; export class BushActivity extends Activity { public declare emoji: BushEmoji | null; + public constructor(presence: BushPresence, data?: RawActivityData) { super(presence, data); } diff --git a/src/lib/extensions/discord.js/BushBaseGuildTextChannel.ts b/src/lib/extensions/discord.js/BushBaseGuildTextChannel.ts index c3c279e..742ea76 100644 --- a/src/lib/extensions/discord.js/BushBaseGuildTextChannel.ts +++ b/src/lib/extensions/discord.js/BushBaseGuildTextChannel.ts @@ -9,13 +9,14 @@ import { import type { RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; export class BushBaseGuildTextChannel extends BaseGuildTextChannel { - public constructor(guild: BushGuild, data?: RawGuildChannelData, client?: BushClient, immediatePatch?: boolean) { - super(guild, data, client, immediatePatch); - } public declare messages: BushMessageManager; public declare threads: BushThreadManager<AllowedThreadTypeForTextChannel | AllowedThreadTypeForNewsChannel>; public declare readonly client: BushClient; public declare guild: BushGuild; public declare readonly members: Collection<Snowflake, BushGuildMember>; public declare readonly parent: BushCategoryChannel | null; + + public constructor(guild: BushGuild, data?: RawGuildChannelData, client?: BushClient, immediatePatch?: boolean) { + super(guild, data, client, immediatePatch); + } } diff --git a/src/lib/extensions/discord.js/BushButtonInteraction.ts b/src/lib/extensions/discord.js/BushButtonInteraction.ts index 03ec881..9e62d46 100644 --- a/src/lib/extensions/discord.js/BushButtonInteraction.ts +++ b/src/lib/extensions/discord.js/BushButtonInteraction.ts @@ -8,6 +8,7 @@ export class BushButtonInteraction<Cached extends CacheType = CacheType> extends public declare readonly guild: CacheTypeReducer<Cached, BushGuild, null>; public declare member: CacheTypeReducer<Cached, BushGuildMember, APIInteractionGuildMember>; public declare user: BushUser; + public constructor(client: BushClient, data: RawMessageButtonInteractionData) { super(client, data); } diff --git a/src/lib/extensions/discord.js/BushCategoryChannel.ts b/src/lib/extensions/discord.js/BushCategoryChannel.ts index 90f52dd..c30a761 100644 --- a/src/lib/extensions/discord.js/BushCategoryChannel.ts +++ b/src/lib/extensions/discord.js/BushCategoryChannel.ts @@ -8,6 +8,7 @@ export class BushCategoryChannel extends CategoryChannel { public declare guild: BushGuild; public declare readonly members: Collection<Snowflake, BushGuildMember>; public declare readonly parent: CategoryChannel | null; + public constructor(guild: BushGuild, data?: RawGuildChannelData, client?: BushClient, immediatePatch?: boolean) { super(guild, data, client, immediatePatch); } diff --git a/src/lib/extensions/discord.js/BushCommandInteraction.ts b/src/lib/extensions/discord.js/BushCommandInteraction.ts index 3cbef57..b61ec9b 100644 --- a/src/lib/extensions/discord.js/BushCommandInteraction.ts +++ b/src/lib/extensions/discord.js/BushCommandInteraction.ts @@ -15,13 +15,14 @@ import { BushTextBasedChannels, type BushClient } from '../discord-akairo/BushCl export type BushGuildResolvable = BushGuild | BushGuildChannel | BushGuildMember | BushGuildEmoji | Invite | BushRole | Snowflake; export class BushCommandInteraction<Cached extends CacheType = CacheType> extends CommandInteraction<Cached> { - public constructor(client: BushClient, data: RawCommandInteractionData) { - super(client, data); - } public declare readonly client: BushClient; public declare readonly command: BushApplicationCommand | BushApplicationCommand<{ guild: BushGuildResolvable }> | null; public declare readonly channel: CacheTypeReducer<Cached, BushTextBasedChannels | null>; public declare readonly guild: CacheTypeReducer<Cached, BushGuild, null>; public declare member: CacheTypeReducer<Cached, BushGuildMember, APIInteractionGuildMember>; public declare user: BushUser; + + public constructor(client: BushClient, data: RawCommandInteractionData) { + super(client, data); + } } diff --git a/src/lib/extensions/discord.js/BushEmoji.ts b/src/lib/extensions/discord.js/BushEmoji.ts index 4c97fee..5cdf5ac 100644 --- a/src/lib/extensions/discord.js/BushEmoji.ts +++ b/src/lib/extensions/discord.js/BushEmoji.ts @@ -4,6 +4,7 @@ import type { RawEmojiData } from 'discord.js/typings/rawDataTypes'; export class BushEmoji extends Emoji { public declare readonly client: BushClient; + public constructor(client: BushClient, emoji: RawEmojiData) { super(client, emoji); } diff --git a/src/lib/extensions/discord.js/BushGuild.ts b/src/lib/extensions/discord.js/BushGuild.ts index ff920ce..e3b39d3 100644 --- a/src/lib/extensions/discord.js/BushGuild.ts +++ b/src/lib/extensions/discord.js/BushGuild.ts @@ -19,6 +19,7 @@ export class BushGuild extends Guild { public declare readonly client: BushClient; public declare readonly me: BushGuildMember | null; public declare members: BushGuildMemberManager; + public constructor(client: BushClient, data: RawGuildData) { super(client, data); } diff --git a/src/lib/extensions/discord.js/BushGuildChannel.ts b/src/lib/extensions/discord.js/BushGuildChannel.ts index ddf4c9a..3324dc8 100644 --- a/src/lib/extensions/discord.js/BushGuildChannel.ts +++ b/src/lib/extensions/discord.js/BushGuildChannel.ts @@ -5,6 +5,7 @@ import type { RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; export class BushGuildChannel extends GuildChannel { public declare readonly client: BushClient; public declare guild: BushGuild; + public constructor(guild: BushGuild, data?: RawGuildChannelData, client?: BushClient, immediatePatch?: boolean) { super(guild, data, client, immediatePatch); } diff --git a/src/lib/extensions/discord.js/BushGuildEmoji.ts b/src/lib/extensions/discord.js/BushGuildEmoji.ts index f3a7491..180f78c 100644 --- a/src/lib/extensions/discord.js/BushGuildEmoji.ts +++ b/src/lib/extensions/discord.js/BushGuildEmoji.ts @@ -7,6 +7,7 @@ export class BushGuildEmoji extends GuildEmoji { public declare guild: BushGuild; public declare author: BushUser | null; public declare readonly roles: BushGuildEmojiRoleManager; + public constructor(client: BushClient, data: RawGuildEmojiData, guild: BushGuild) { super(client, data, guild); } diff --git a/src/lib/extensions/discord.js/BushGuildMember.ts b/src/lib/extensions/discord.js/BushGuildMember.ts index 0667646..c4a2ed3 100644 --- a/src/lib/extensions/discord.js/BushGuildMember.ts +++ b/src/lib/extensions/discord.js/BushGuildMember.ts @@ -78,6 +78,7 @@ export class BushGuildMember extends GuildMember { public declare readonly client: BushClient; public declare guild: BushGuild; public declare user: BushUser; + public constructor(client: BushClient, data: RawGuildMemberData, guild: BushGuild) { super(client, data, guild); } diff --git a/src/lib/extensions/discord.js/BushMessage.ts b/src/lib/extensions/discord.js/BushMessage.ts index 83ae59b..c722f3d 100644 --- a/src/lib/extensions/discord.js/BushMessage.ts +++ b/src/lib/extensions/discord.js/BushMessage.ts @@ -22,10 +22,12 @@ export class BushMessage<Cached extends boolean = boolean> extends Message<Cache public declare readonly member: BushGuildMember | null; public declare author: BushUser; public declare readonly channel: If<Cached, BushGuildTextBasedChannel, BushTextBasedChannels>; + public constructor(client: BushClient, data: RawMessageData) { super(client, data); } - public override fetch(force?: boolean): Promise<BushMessage> { - return super.fetch(force) as Promise<BushMessage>; - } +} + +export interface BushMessage { + fetch(force?: boolean): Promise<BushMessage>; } diff --git a/src/lib/extensions/discord.js/BushReactionEmoji.ts b/src/lib/extensions/discord.js/BushReactionEmoji.ts index 2e87183..b85916c 100644 --- a/src/lib/extensions/discord.js/BushReactionEmoji.ts +++ b/src/lib/extensions/discord.js/BushReactionEmoji.ts @@ -4,6 +4,7 @@ import type { RawReactionEmojiData } from 'discord.js/typings/rawDataTypes'; export class BushReactionEmoji extends ReactionEmoji { public declare reaction: BushMessageReaction; + public constructor(reaction: BushMessageReaction, emoji: RawReactionEmojiData) { super(reaction, emoji); } diff --git a/src/lib/extensions/discord.js/BushRole.ts b/src/lib/extensions/discord.js/BushRole.ts index 10757c1..bf09e2d 100644 --- a/src/lib/extensions/discord.js/BushRole.ts +++ b/src/lib/extensions/discord.js/BushRole.ts @@ -5,6 +5,7 @@ import type { RawRoleData } from 'discord.js/typings/rawDataTypes'; export class BushRole extends Role { public declare guild: BushGuild; public declare readonly members: Collection<Snowflake, BushGuildMember>; + public constructor(client: BushClient, data: RawRoleData, guild: BushGuild) { super(client, data, guild); } diff --git a/src/lib/extensions/discord.js/BushSelectMenuInteraction.ts b/src/lib/extensions/discord.js/BushSelectMenuInteraction.ts index 7581236..6b33c20 100644 --- a/src/lib/extensions/discord.js/BushSelectMenuInteraction.ts +++ b/src/lib/extensions/discord.js/BushSelectMenuInteraction.ts @@ -8,6 +8,7 @@ export class BushSelectMenuInteraction<Cached extends CacheType = CacheType> ext public declare readonly guild: CacheTypeReducer<Cached, BushGuild, null>; public declare member: CacheTypeReducer<Cached, BushGuildMember, APIInteractionGuildMember>; public declare user: BushUser; + public constructor(client: BushClient, data: RawMessageSelectMenuInteractionData) { super(client, data); } diff --git a/src/lib/extensions/discord.js/BushStageChannel.ts b/src/lib/extensions/discord.js/BushStageChannel.ts index 5b1fd88..1391757 100644 --- a/src/lib/extensions/discord.js/BushStageChannel.ts +++ b/src/lib/extensions/discord.js/BushStageChannel.ts @@ -7,6 +7,7 @@ export class BushStageChannel extends StageChannel { public declare readonly members: Collection<Snowflake, BushGuildMember>; public declare guild: BushGuild; public declare readonly parent: BushCategoryChannel | null; + public constructor(guild: BushGuild, data?: RawGuildChannelData) { super(guild, data); } diff --git a/src/lib/extensions/discord.js/BushStageInstance.ts b/src/lib/extensions/discord.js/BushStageInstance.ts index 67b1030..3b46bf6 100644 --- a/src/lib/extensions/discord.js/BushStageInstance.ts +++ b/src/lib/extensions/discord.js/BushStageInstance.ts @@ -5,6 +5,7 @@ import type { RawStageInstanceData } from 'discord.js/typings/rawDataTypes'; export class BushStageInstance extends StageInstance { public declare readonly channel: BushStageChannel | null; public declare readonly guild: BushGuild | null; + public constructor(client: BushClient, data: RawStageInstanceData, channel: BushStageChannel) { super(client, data, channel); } diff --git a/src/lib/extensions/discord.js/BushTextChannel.ts b/src/lib/extensions/discord.js/BushTextChannel.ts index 57a0598..57f0833 100644 --- a/src/lib/extensions/discord.js/BushTextChannel.ts +++ b/src/lib/extensions/discord.js/BushTextChannel.ts @@ -6,6 +6,7 @@ export class BushTextChannel extends TextChannel { public declare guild: BushGuild; public declare messages: BushMessageManager; public declare threads: BushThreadManager<AllowedThreadTypeForTextChannel>; + public constructor(guild: BushGuild, data?: RawGuildChannelData) { super(guild, data); } diff --git a/src/lib/extensions/discord.js/BushThreadChannel.ts b/src/lib/extensions/discord.js/BushThreadChannel.ts index ea4b07c..5f68213 100644 --- a/src/lib/extensions/discord.js/BushThreadChannel.ts +++ b/src/lib/extensions/discord.js/BushThreadChannel.ts @@ -17,6 +17,7 @@ export class BushThreadChannel extends ThreadChannel { public declare readonly client: BushClient; public declare readonly guildMembers: Collection<Snowflake, BushGuildMember>; public declare readonly parent: BushTextChannel | BushNewsChannel | null; + public constructor(guild: BushGuild, data?: RawThreadChannelData, client?: BushClient, fromInteraction?: boolean) { super(guild, data, client, fromInteraction); } diff --git a/src/lib/extensions/discord.js/BushThreadMember.ts b/src/lib/extensions/discord.js/BushThreadMember.ts index db63d01..fa7588e 100644 --- a/src/lib/extensions/discord.js/BushThreadMember.ts +++ b/src/lib/extensions/discord.js/BushThreadMember.ts @@ -6,6 +6,7 @@ export class BushThreadMember extends ThreadMember { public declare readonly guildMember: BushGuildMember | null; public declare readonly user: BushUser | null; public declare thread: BushThreadChannel; + public constructor(thread: BushThreadChannel, data?: RawThreadMemberData) { super(thread, data); } diff --git a/src/lib/extensions/discord.js/BushUser.ts b/src/lib/extensions/discord.js/BushUser.ts index e7f232a..9b2c92a 100644 --- a/src/lib/extensions/discord.js/BushUser.ts +++ b/src/lib/extensions/discord.js/BushUser.ts @@ -7,6 +7,7 @@ export type PartialBushUser = Partialize<BushUser, 'username' | 'tag' | 'discrim export class BushUser extends User { public declare readonly client: BushClient; public declare readonly dmChannel: BushDMChannel | null; + public constructor(client: BushClient, data: RawUserData) { super(client, data); } diff --git a/src/lib/extensions/discord.js/BushVoiceChannel.ts b/src/lib/extensions/discord.js/BushVoiceChannel.ts index f65906e..d5cdafc 100644 --- a/src/lib/extensions/discord.js/BushVoiceChannel.ts +++ b/src/lib/extensions/discord.js/BushVoiceChannel.ts @@ -5,6 +5,7 @@ import type { RawGuildChannelData } from 'discord.js/typings/rawDataTypes'; export class BushVoiceChannel extends VoiceChannel { public declare readonly client: BushClient; public declare readonly members: Collection<Snowflake, BushGuildMember>; + public constructor(guild: BushGuild, data?: RawGuildChannelData) { super(guild, data); } diff --git a/src/lib/extensions/discord.js/BushVoiceState.ts b/src/lib/extensions/discord.js/BushVoiceState.ts index 167a369..a479143 100644 --- a/src/lib/extensions/discord.js/BushVoiceState.ts +++ b/src/lib/extensions/discord.js/BushVoiceState.ts @@ -7,6 +7,7 @@ export class BushVoiceState extends VoiceState { public declare readonly channel: BushVoiceChannel | BushStageChannel | null; public declare guild: BushGuild; public declare readonly member: BushGuildMember | null; + public constructor(guild: BushGuild, data: RawVoiceStateData) { super(guild, data); } diff --git a/src/listeners/client/ready.ts b/src/listeners/client/ready.ts index 05b8fa2..0b57156 100644 --- a/src/listeners/client/ready.ts +++ b/src/listeners/client/ready.ts @@ -11,6 +11,7 @@ export default class ReadyListener extends BushListener { } public override async exec() { + client.taskHandler.startAll(); process.emit('ready' as any); const tag = `<<${client.user?.tag}>>`, diff --git a/src/listeners/commands/commandStarted.ts b/src/listeners/commands/commandStarted.ts index b2d7470..afc689d 100644 --- a/src/listeners/commands/commandStarted.ts +++ b/src/listeners/commands/commandStarted.ts @@ -11,6 +11,7 @@ export default class CommandStartedListener extends BushListener { category: 'commands' }); } + public override exec(...[message, command]: BushCommandHandlerEvents['commandStarted']): void { client.sentry.addBreadcrumb({ message: `[commandStarted] The ${command.id} was started by ${message.author.tag}.`, @@ -158,6 +158,13 @@ __metadata: languageName: node linkType: hard +"@notenoughupdates/simplify-number@npm:^1.0.1": + version: 1.0.1 + resolution: "@notenoughupdates/simplify-number@npm:1.0.1" + checksum: 91b73abf024888fdf68954dfc46464f6e22f0f83291bae7f75f223b49d115f23be0aad809a72a0dba10012418e1562a9703795c2ec084edd37f52dca16649141 + languageName: node + linkType: hard + "@notenoughupdates/wolfram-alpha-api@npm:^1.0.1": version: 1.0.1 resolution: "@notenoughupdates/wolfram-alpha-api@npm:1.0.1" @@ -773,6 +780,7 @@ __metadata: "@notenoughupdates/discord.js-minesweeper": ^1.0.8 "@notenoughupdates/events-intercept": ^3.0.1 "@notenoughupdates/humanize-duration": ^4.0.1 + "@notenoughupdates/simplify-number": ^1.0.1 "@notenoughupdates/wolfram-alpha-api": ^1.0.1 "@sentry/node": ^6.15.0 "@sentry/tracing": ^6.15.0 @@ -807,7 +815,6 @@ __metadata: pretty-bytes: ^5.6.0 rimraf: ^3.0.2 sequelize: ^6.12.0-alpha.1 - simplify-number: ^1.0.0 source-map-support: ^0.5.21 tinycolor2: ^1.4.2 tslib: ^2.3.1 @@ -2731,13 +2738,6 @@ __metadata: languageName: node linkType: hard -"simplify-number@npm:^1.0.0": - version: 1.0.0 - resolution: "simplify-number@npm:1.0.0" - checksum: a8e1d85dcd390f5c8fc5b8b5f5d49c62590656540904e9809aef8dfc3e3846a9ebd14405e4a54849a1da3bdf7feaa2456886d32f0c27e1a942988dfb762da857 - languageName: node - linkType: hard - "slash@npm:^3.0.0": version: 3.0.0 resolution: "slash@npm:3.0.0" |