diff options
25 files changed, 241 insertions, 153 deletions
@@ -1,6 +1,6 @@ <!-- markdownlint-disable-file MD010 MD033 MD041 --> -<a href="https://discord.com/api/oauth2/authorize?client_id=767478359348740148&permissions=2147483647&scope=bot%20applications.commands"><h1 align="center" > BushBot </h1></a> +<a href="https://discord.com/api/oauth2/authorize?client_id=767478359348740148&permissions=5368709119918&scope=bot%20applications.commands"><h1 align="center" > BushBot </h1></a> <div align="center"> <!-- lint --> diff --git a/ecosystem.config.js b/ecosystem.config.js index 95db01c..bcaf56e 100644 --- a/ecosystem.config.js +++ b/ecosystem.config.js @@ -33,7 +33,7 @@ module.exports = { deploy: { production: { 'user': 'pi', - 'host': '192.168.1.240', + 'host': '192.168.1.210', 'ref': 'origin/master', 'repo': 'https://github.com/NotEnoughUpdates/bush-bot.git', 'path': '/code/bush-bot', @@ -41,7 +41,7 @@ module.exports = { }, beta: { 'user': 'pi', - 'host': '192.168.1.240', + 'host': '192.168.1.210', 'ref': 'origin/beta', 'repo': 'https://github.com/NotEnoughUpdates/bush-bot.git', 'path': '/code/bush-bot-beta', diff --git a/package.json b/package.json index d636695..3dfb25b 100644 --- a/package.json +++ b/package.json @@ -56,9 +56,8 @@ "chalk": "^4.1.1", "common-tags": "^1.8.0", "discord-akairo": "NotEnoughUpdates/discord-akairo", - "discord-akairo-message-util": "NotEnoughUpdates/discord-akairo-message-util", "discord-api-types": "0.22.0", - "discord.js": "NotEnoughUpdates/discord.js", + "discord.js": "npm:@notenoughupdates/discord.js@13.2.0-dev", "discord.js-minesweeper": "^1.0.6", "esbuild": "^0.12.11", "eslint": "^7.29.0", diff --git a/src/commands/config/config.ts b/src/commands/config/config.ts index 6e7373c..3f1fc8c 100644 --- a/src/commands/config/config.ts +++ b/src/commands/config/config.ts @@ -240,10 +240,8 @@ export default class SettingsCommand extends BushCommand { } } const collector = msg.createMessageComponentCollector({ - channel: message.channel ?? undefined, - guild: message.guild, - message: message as Message, - time: 300_000 + time: 300_000, + filter: (i) => i.guildId === message.guildId && i.message.id === message.id }); collector.on('collect', async (interaction: MessageComponentInteraction) => { diff --git a/src/commands/config/features.ts b/src/commands/config/features.ts index 8010ab9..743b243 100644 --- a/src/commands/config/features.ts +++ b/src/commands/config/features.ts @@ -28,11 +28,9 @@ export default class FeaturesCommand extends BushCommand { const components = this.generateComponents(guildFeaturesArr, false); const msg = (await message.util.reply({ embeds: [featureEmbed], components: [components] })) as Message; const collector = msg.createMessageComponentCollector({ - channel: message.channel ?? undefined, - guild: message.guild, componentType: 'SELECT_MENU', - message: message as Message, - time: 300_000 + time: 300_000, + filter: (i) => i.guildId === message.guildId && i.message.id === message.id }); collector.on('collect', async (interaction: SelectMenuInteraction) => { diff --git a/src/commands/info/guildInfo.ts b/src/commands/info/guildInfo.ts index f70b741..f1db783 100644 --- a/src/commands/info/guildInfo.ts +++ b/src/commands/info/guildInfo.ts @@ -105,7 +105,7 @@ export default class GuildInfoCommand extends BushCommand { guildAbout.push( `**Owner:** ${guild.members.cache.get(guild.ownerId)?.user.tag}`, - `**Created** ${guild.createdAt.toLocaleString()} (${util.dateDelta(guild.createdAt)})`, + `**Created** ${util.timestamp(guild.createdAt)} (${util.dateDelta(guild.createdAt)})`, `**Members:** ${guild.memberCount.toLocaleString() ?? 0} (${util.emojis.onlineCircle} ${ guild.approximatePresenceCount?.toLocaleString() ?? 0 }, ${util.emojis.offlineCircle} ${(guild.memberCount - (guild.approximatePresenceCount ?? 0)).toLocaleString() ?? 0})`, diff --git a/src/commands/info/help.ts b/src/commands/info/help.ts index 1338f8a..8c97ba8 100644 --- a/src/commands/info/help.ts +++ b/src/commands/info/help.ts @@ -1,7 +1,6 @@ import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; import { MessageActionRow, MessageButton, MessageEmbed } from 'discord.js'; import packageDotJSON from '../../../package.json'; - export default class HelpCommand extends BushCommand { public constructor() { super('help', { @@ -61,7 +60,7 @@ export default class HelpCommand extends BushCommand { label: 'Invite Me', url: `https://discord.com/api/oauth2/authorize?client_id=${ client.user!.id - }&permissions=2147483647&scope=bot%20applications.commands` + }&permissions=5368709119918&scope=bot%20applications.commands` }) ); } diff --git a/src/commands/info/links.ts b/src/commands/info/links.ts index 29152d9..b3a762a 100644 --- a/src/commands/info/links.ts +++ b/src/commands/info/links.ts @@ -27,7 +27,7 @@ export default class LinksCommand extends BushCommand { label: 'Invite Me', url: `https://discord.com/api/oauth2/authorize?client_id=${ client.user!.id - }&permissions=2147483647&scope=bot%20applications.commands` + }&permissions=5368709119918&scope=bot%20applications.commands` }), new MessageButton({ style: 'LINK', diff --git a/src/commands/info/snowflake.ts b/src/commands/info/snowflake.ts index 8d6129b..df11bce 100644 --- a/src/commands/info/snowflake.ts +++ b/src/commands/info/snowflake.ts @@ -139,7 +139,7 @@ export default class SnowflakeCommand extends BushCommand { const deconstructedSnowflake: DeconstructedSnowflake = SnowflakeUtil.deconstruct(snowflake); const snowflakeInfo = [ `**Timestamp:** ${deconstructedSnowflake.timestamp}`, - `**Created:** ${deconstructedSnowflake.date.toLocaleString()}`, + `**Created:** ${util.timestamp(deconstructedSnowflake.date)}`, `**Worker ID:** ${deconstructedSnowflake.workerId}`, `**Process ID:** ${deconstructedSnowflake.processId}`, `**Increment:** ${deconstructedSnowflake.increment}` diff --git a/src/commands/info/userInfo.ts b/src/commands/info/userInfo.ts index 745dcf0..98ef3ae 100644 --- a/src/commands/info/userInfo.ts +++ b/src/commands/info/userInfo.ts @@ -85,11 +85,11 @@ export default class UserInfoCommand extends BushCommand { else if (member?.permissions.has('ADMINISTRATOR')) emojis.push(client.consts.mappings.otherEmojis.ADMIN); if (member?.premiumSinceTimestamp) emojis.push(client.consts.mappings.otherEmojis.BOOSTER); - const createdAt = user.createdAt.toLocaleString(), + const createdAt = util.timestamp(user.createdAt), createdAtDelta = util.dateDelta(user.createdAt), - joinedAt = member?.joinedAt?.toLocaleString(), + joinedAt = util.timestamp(member?.joinedAt), joinedAtDelta = member && member.joinedAt ? util.dateDelta(member.joinedAt, 2) : undefined, - premiumSince = member?.premiumSince?.toLocaleString(), + premiumSince = util.timestamp(member?.premiumSince), premiumSinceDelta = member && member.premiumSince ? util.dateDelta(member.premiumSince, 2) : undefined; // General Info diff --git a/src/commands/leveling/leaderboard.ts b/src/commands/leveling/leaderboard.ts index 953a6c5..4fb1765 100644 --- a/src/commands/leveling/leaderboard.ts +++ b/src/commands/leveling/leaderboard.ts @@ -41,8 +41,19 @@ export default class LeaderboardCommand extends BushCommand { if (!message.guild) return await message.util.reply(`${util.emojis.error} This command can only be run in a server.`); if (!(await message.guild.hasFeature('leveling'))) return await message.util.reply( - `${util.emojis.error} This command can only be run in commands with the leveling feature enabled.` + `${util.emojis.error} This command can only be run in servers with the leveling feature enabled.${ + message.member?.permissions.has('MANAGE_GUILD') + ? ` You can toggle features using the \`${ + message.util.isSlash + ? '/' + : client.config.isDevelopment + ? 'dev ' + : message.util.parsed?.prefix ?? client.config.prefix + }features\` command.` + : '' + }` ); + const ranks = (await Level.findAll({ where: { guild: message.guild.id } })).sort((a, b) => b.xp - a.xp); const mapedRanks = ranks.map( (val, index) => `\`${index + 1}\` <@${val.user}> - Level ${val.level} (${val.xp.toLocaleString()} xp)` diff --git a/src/commands/leveling/level.ts b/src/commands/leveling/level.ts index f14c005..33ad705 100644 --- a/src/commands/leveling/level.ts +++ b/src/commands/leveling/level.ts @@ -132,7 +132,17 @@ export default class LevelCommand extends BushCommand { if (!message.guild) return await message.util.reply(`${util.emojis.error} This command can only be run in a server.`); if (!(await message.guild.hasFeature('leveling'))) return await message.util.reply( - `${util.emojis.error} This command can only be run in commands with the leveling feature enabled.` + `${util.emojis.error} This command can only be run in servers with the leveling feature enabled.${ + message.member?.permissions.has('MANAGE_GUILD') + ? ` You can toggle features using the \`${ + message.util.isSlash + ? '/' + : client.config.isDevelopment + ? 'dev ' + : message.util.parsed?.prefix ?? client.config.prefix + }features\` command.` + : '' + }` ); const user = args.user ?? message.author; try { diff --git a/src/commands/moderation/modlog.ts b/src/commands/moderation/modlog.ts index d1a3900..c72ff39 100644 --- a/src/commands/moderation/modlog.ts +++ b/src/commands/moderation/modlog.ts @@ -53,7 +53,7 @@ export default class ModlogCommand extends BushCommand { modLog.push(`**Moderator**: <@!${log.moderator}>`); if (log.duration) modLog.push(`**Duration**: ${util.humanizeDuration(log.duration)}`); modLog.push(`**Reason**: ${trim(log.reason ?? 'No Reason Specified.')}`); - modLog.push(`**Date**: ${log.createdAt.toLocaleString()}`); + modLog.push(`**Date**: ${util.timestamp(log.createdAt)}`); if (log.evidence) modLog.push(`**Evidence:** ${trim(log.evidence)}`); return modLog.join(`\n`); } diff --git a/src/commands/moderation/unban.ts b/src/commands/moderation/unban.ts index 5025ede..a319ff9 100644 --- a/src/commands/moderation/unban.ts +++ b/src/commands/moderation/unban.ts @@ -76,7 +76,7 @@ export default class UnbanCommand extends BushCommand { case 'error creating modlog entry': return `${util.emojis.error} While unbanning **${user.tag}**, there was an error creating a modlog entry, please report this to my developers.`; case 'user not banned': - return `${util.emojis.warn} **${user.tag}** but I tried to unban them anyways.`; + return `${util.emojis.warn} **${user.tag}** is not banned but I tried to unban them anyways.`; case 'success': return `${util.emojis.success} Successfully unbanned **${user.tag}**.`; } diff --git a/src/lib/extensions/discord-akairo/BushClient.ts b/src/lib/extensions/discord-akairo/BushClient.ts index 7d84b5e..48ba90d 100644 --- a/src/lib/extensions/discord-akairo/BushClient.ts +++ b/src/lib/extensions/discord-akairo/BushClient.ts @@ -1,4 +1,3 @@ -import chalk from 'chalk'; import { AkairoClient, ContextMenuCommandHandler } from 'discord-akairo'; import { Awaited, @@ -21,7 +20,6 @@ import eventsIntercept from 'events-intercept'; import JSON5 from 'json5'; import 'json5/lib/register'; import path from 'path'; -import { exit } from 'process'; import readline from 'readline'; import { Sequelize } from 'sequelize'; import { abbreviatedNumberTypeCaster } from '../../../arguments/abbreviatedNumber'; @@ -292,7 +290,8 @@ export class BushClient<Ready extends boolean = boolean> extends AkairoClient<Re dialect: 'postgres', host: this.config.db.host, port: this.config.db.port, - logging: this.config.logging.db ? (sql) => this.logger.debug(sql) : false + logging: this.config.logging.db ? (sql) => this.logger.debug(sql) : false, + timezone: 'America/New_York' }); } @@ -337,9 +336,9 @@ export class BushClient<Ready extends boolean = boolean> extends AkairoClient<Re inhibitors: this.inhibitorHandler, tasks: this.taskHandler }; - for (const loader of Object.keys(loaders)) { + for (const loader in loaders) { try { - loaders[loader as keyof typeof loaders].loadAll(); + await loaders[loader as keyof typeof loaders].loadAll(); void this.logger.success('startup', `Successfully loaded <<${loader}>>.`, false); } catch (e) { void this.logger.error('startup', `Unable to load loader <<${loader}>> with error:\n${e?.stack || e}`, false); @@ -367,9 +366,10 @@ export class BushClient<Ready extends boolean = boolean> extends AkairoClient<Re } catch (e) { await this.console.error( 'startup', - `Failed to connect to <<database>> with error:\n${typeof e}` === 'object' ? e?.stack : e, + `Failed to connect to <<database>> with error:\n${util.inspect(e, { colors: true, depth: 1 })}`, false ); + process.exit(2); } } @@ -397,8 +397,7 @@ export class BushClient<Ready extends boolean = boolean> extends AkairoClient<Re await this.#init(); await this.login(this.token!); } catch (e) { - await this.console.error('start', chalk.red(e?.stack || e), false); - exit(2); + await this.console.error('start', util.inspect(e, { colors: true, depth: 1 }), false); } } diff --git a/src/lib/extensions/discord-akairo/BushClientUtil.ts b/src/lib/extensions/discord-akairo/BushClientUtil.ts index 38e1a06..c15ca1c 100644 --- a/src/lib/extensions/discord-akairo/BushClientUtil.ts +++ b/src/lib/extensions/discord-akairo/BushClientUtil.ts @@ -925,11 +925,12 @@ export class BushClientUtil extends ClientUtil { #mapCredential(old: string): string { const mapping = { - ['token']: 'Main Token', - ['devToken']: 'Dev Token', - ['betaToken']: 'Beta Token', - ['hypixelApiKey']: 'Hypixel Api Key', - ['wolframAlphaAppId']: 'Wolfram|Alpha App ID' + token: 'Main Token', + devToken: 'Dev Token', + betaToken: 'Beta Token', + hypixelApiKey: 'Hypixel Api Key', + wolframAlphaAppId: 'Wolfram|Alpha App ID', + dbPassword: 'Database Password' }; return mapping[old as keyof typeof mapping] || old; } @@ -938,8 +939,10 @@ export class BushClientUtil extends ClientUtil { * Redacts credentials from a string */ public redact(text: string) { - for (const credentialName in client.config.credentials) { - const credential = client.config.credentials[credentialName as keyof typeof client.config.credentials]; + for (const credentialName in { ...client.config.credentials, dbPassword: client.config.db.password }) { + const credential = { ...client.config.credentials, dbPassword: client.config.db.password }[ + credentialName as keyof typeof client.config.credentials + ]; const replacement = this.#mapCredential(credentialName); const escapeRegex = /[.*+?^${}()|[\]\\]/g; text = text.replace(new RegExp(credential.toString().replace(escapeRegex, '\\$&'), 'g'), `[${replacement} Omitted]`); @@ -1182,14 +1185,18 @@ export class BushClientUtil extends ClientUtil { modlog: string; extraInfo?: Snowflake; }): Promise<ActivePunishment | null> { - const expires = options.duration ? new Date(new Date().getTime() + options.duration ?? 0) : undefined; + const expires = options.duration ? new Date(+new Date() + options.duration ?? 0) : undefined; const user = (await util.resolveNonCachedUser(options.user))!.id; const guild = client.guilds.resolveId(options.guild)!; const type = this.#findTypeEnum(options.type)!; - const entry = options.extraInfo - ? ActivePunishment.build({ user, type, guild, expires, modlog: options.modlog, extraInfo: options.extraInfo }) - : ActivePunishment.build({ user, type, guild, expires, modlog: options.modlog }); + console.debug(expires); + + const entry = ActivePunishment.build( + options.extraInfo + ? { user, type, guild, expires, modlog: options.modlog, extraInfo: options.extraInfo } + : { user, type, guild, expires, modlog: options.modlog } + ); return await entry.save().catch(async (e) => { await util.handleError('createPunishmentEntry', e); return null; @@ -1200,6 +1207,7 @@ export class BushClientUtil extends ClientUtil { type: 'mute' | 'ban' | 'role' | 'block'; user: BushGuildMemberResolvable; guild: BushGuildResolvable; + extraInfo?: Snowflake; }): Promise<boolean> { const user = await util.resolveNonCachedUser(options.user); const guild = client.guilds.resolveId(options.guild); @@ -1211,7 +1219,9 @@ export class BushClientUtil extends ClientUtil { const entries = await ActivePunishment.findAll({ // finding all cases of a certain type incase there were duplicates or something - where: { user: user.id, guild: guild, type } + where: options.extraInfo + ? { user: user.id, guild: guild, type, extraInfo: options.extraInfo } + : { user: user.id, guild: guild, type } }).catch(async (e) => { await util.handleError('removePunishmentEntry', e); success = false; @@ -1243,6 +1253,28 @@ export class BushClientUtil extends ClientUtil { else return humanizeDuration(duration, { language: 'en', maxDecimalPoints: 2 }); } + public timestampDuration(duration: number): string { + return `<t:${Math.round(duration / 1000)}:R>`; + } + + /** + * **Styles:** + * - **t**: Short Time + * - **T**: Long Time + * - **d**: Short Date + * - **D**: Long Date + * - **f**: Short Date/Time + * - **F**: Long Date/Time + * - **R**: Relative Time + */ + public timestamp<D extends Date | undefined | null>( + date: D, + style: 't' | 'T' | 'd' | 'D' | 'f' | 'F' | 'R' = 'f' + ): D extends Date ? string : undefined { + if (!date) return date as unknown as D extends Date ? string : undefined; + return `<t:${Math.round(date.getTime() / 1000)}:${style}>` as unknown as D extends Date ? string : undefined; + } + public dateDelta(date: Date, largest?: number) { return this.humanizeDuration(moment(date).diff(moment()), largest ?? 3); } diff --git a/src/lib/extensions/discord.js/BushClientEvents.d.ts b/src/lib/extensions/discord.js/BushClientEvents.d.ts index 96dc4c5..eb36153 100644 --- a/src/lib/extensions/discord.js/BushClientEvents.d.ts +++ b/src/lib/extensions/discord.js/BushClientEvents.d.ts @@ -85,7 +85,10 @@ export interface BushClientEvents extends ClientEvents { inviteDelete: [invite: Invite]; messageCreate: [message: BushMessage]; messageDelete: [message: BushMessage | PartialBushMessage]; - messageReactionRemoveAll: [message: BushMessage | PartialBushMessage]; + messageReactionRemoveAll: [ + message: BushMessage | PartialBushMessage, + reactions: Collection<string, BushMessageReaction> + ]; messageReactionRemoveEmoji: [ reaction: BushMessageReaction | PartialBushMessageReaction ]; diff --git a/src/lib/extensions/discord.js/BushGuildMember.ts b/src/lib/extensions/discord.js/BushGuildMember.ts index b5bc407..8e855f7 100644 --- a/src/lib/extensions/discord.js/BushGuildMember.ts +++ b/src/lib/extensions/discord.js/BushGuildMember.ts @@ -199,7 +199,7 @@ export class BushGuildMember extends GuildMember { const ret = await (async () => { if (options.addToModlog) { const { log: modlog } = await util.createModLogEntry({ - type: ModLogType.PERM_PUNISHMENT_ROLE, + type: ModLogType.REMOVE_PUNISHMENT_ROLE, guild: this.guild, moderator: moderator.id, user: this, @@ -212,7 +212,8 @@ export class BushGuildMember extends GuildMember { const punishmentEntrySuccess = await util.removePunishmentEntry({ type: 'role', user: this, - guild: this.guild + guild: this.guild, + extraInfo: options.role.id }); if (!punishmentEntrySuccess) return 'error removing role entry'; diff --git a/src/lib/models/ActivePunishment.ts b/src/lib/models/ActivePunishment.ts index f453426..12b0cab 100644 --- a/src/lib/models/ActivePunishment.ts +++ b/src/lib/models/ActivePunishment.ts @@ -131,7 +131,7 @@ export class ActivePunishment } }, extraInfo: { - type: DataTypes.DATE, + type: DataTypes.STRING, allowNull: true }, expires: { diff --git a/src/lib/utils/BushLogger.ts b/src/lib/utils/BushLogger.ts index c2a9989..f00c19c 100644 --- a/src/lib/utils/BushLogger.ts +++ b/src/lib/utils/BushLogger.ts @@ -156,7 +156,7 @@ export class BushLogger { .setDescription(`**[${header}]** ${this.#parseFormatting(this.#stripColor(newContent), '', true)}`) .setColor(util.colors.warn) .setTimestamp(); - await this.channelLog({ embeds: [embed] }); + await this.channelError({ embeds: [embed] }); } /** diff --git a/src/listeners/message/autoThread.ts b/src/listeners/message/autoThread.ts index 04f6bcf..a254337 100644 --- a/src/listeners/message/autoThread.ts +++ b/src/listeners/message/autoThread.ts @@ -6,8 +6,8 @@ import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEven export default class autoThreadListener extends BushListener { public constructor() { super('autoThread', { - emitter: 'commandHandler', - event: 'messageInvalid', + emitter: 'client', + event: 'messageCreate', category: 'message' }); } @@ -23,6 +23,17 @@ export default class autoThreadListener extends BushListener { message.content.includes('<:yes:822211477624586260>') ) return; + + if ( + (message.content.trim().startsWith(await message.guild.getSetting('prefix')) || + message.content.trim().startsWith(`<@!${client.user!.id}>`) || + message.content.trim().startsWith(`<@${client.user!.id}>`)) && + client.commandHandler.aliases.some((alias) => message.content.includes(alias)) + ) + return; + + if (message.thread) return; + // todo: make these configurable etc... if (message.guild.id !== '516977525906341928') return; // mb if (message.channel.id !== '714332750156660756') return; // neu-support-1 diff --git a/src/listeners/other/promiseRejection.ts b/src/listeners/other/promiseRejection.ts index 130daa3..dc21c3f 100644 --- a/src/listeners/other/promiseRejection.ts +++ b/src/listeners/other/promiseRejection.ts @@ -10,8 +10,11 @@ export default class PromiseRejectionListener extends BushListener { } public override async exec(error: Error): Promise<void> { - // eslint-disable-next-line @typescript-eslint/no-base-to-string - void client.console.error('promiseRejection', `An unhanded promise rejection occurred:\n${error.stack ?? error}`, false); + void client.console.error( + 'promiseRejection', + `An unhanded promise rejection occurred:\n${typeof error == 'object' ? error.stack : error}`, + false + ); if (!error.message.includes('reason: getaddrinfo ENOTFOUND canary.discord.com')) void client.console.channelError({ embeds: [await CommandErrorListener.generateErrorEmbed({ type: 'unhandledRejection', error: error })] diff --git a/src/listeners/other/uncaughtException.ts b/src/listeners/other/uncaughtException.ts index 47db37f..4ba47bd 100644 --- a/src/listeners/other/uncaughtException.ts +++ b/src/listeners/other/uncaughtException.ts @@ -10,8 +10,11 @@ export default class UncaughtExceptionListener extends BushListener { } public override async exec(error: Error): Promise<void> { - // eslint-disable-next-line @typescript-eslint/no-base-to-string - void client.console.error('uncaughtException', `An uncaught exception occurred:\n${error?.stack ?? error}`, false); + void client.console.error( + 'uncaughtException', + `An uncaught exception occurred:\n${typeof error == 'object' ? error.stack : error}`, + false + ); void client.console.channelError({ embeds: [await CommandErrorListener.generateErrorEmbed({ type: 'uncaughtException', error: error })] }); diff --git a/src/listeners/other/warning.ts b/src/listeners/other/warning.ts new file mode 100644 index 0000000..d85e9e3 --- /dev/null +++ b/src/listeners/other/warning.ts @@ -0,0 +1,22 @@ +import { BushListener } from '@lib'; +import CommandErrorListener from '../commands/commandError'; + +export default class WarningListener extends BushListener { + public constructor() { + super('warning', { + emitter: 'process', + event: 'warning' + }); + } + + public override async exec(error: Error): Promise<void> { + void client.console.warn('warning', `A warning occurred:\n${typeof error == 'object' ? error.stack : error}`, false); + void client.console.channelError({ + embeds: [ + (await CommandErrorListener.generateErrorEmbed({ type: 'unhandledRejection', error: error })) + .setColor(util.colors.warn) + .setTitle('A Warning Occurred') + ] + }); + } +} @@ -32,7 +32,7 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.14.6": +"@babel/runtime@npm:^7.15.4": version: 7.15.4 resolution: "@babel/runtime@npm:7.15.4" dependencies: @@ -214,9 +214,9 @@ __metadata: linkType: hard "@sindresorhus/is@npm:^4.0.0, @sindresorhus/is@npm:^4.0.1": - version: 4.0.1 - resolution: "@sindresorhus/is@npm:4.0.1" - checksum: 92ae3f3d765bd5bc7355852cb9852091ebce6a76bb00eeb37d08e0247b9b3e742eae43ff3753de0c0c00876c526613db6433c9594ae0d17b305b3d6dbeef2514 + version: 4.2.0 + resolution: "@sindresorhus/is@npm:4.2.0" + checksum: 59040dfb75c2eb6ab76e8c7ac10b7f7f6ba740f0b5ac618a89a8bcdbaf923836a8e998078d59d81f6f13f4b6bbe15bfe1bca962c877edcbe9160d1c100c56fd7 languageName: node linkType: hard @@ -328,9 +328,9 @@ __metadata: linkType: hard "@types/lodash@npm:^4.14.172": - version: 4.14.172 - resolution: "@types/lodash@npm:4.14.172" - checksum: 5fc51ea40d7e455bd1c760bcc60c9e81f82d85988666d4d4969bd8311367c63bbf1fe2be48755ba87836710e45fff94014ec164ebe6ccaa72815014981152434 + version: 4.14.173 + resolution: "@types/lodash@npm:4.14.173" + checksum: 9e97ef5816299e5470db1cb32a93e981af60f74f18a35d045ed4caf224a065df96bfae6e444ec96aa392fc01258592b965d840ae042eef77ef719a578c7daef8 languageName: node linkType: hard @@ -366,16 +366,16 @@ __metadata: linkType: hard "@types/node@npm:*": - version: 16.7.13 - resolution: "@types/node@npm:16.7.13" - checksum: 15dc28aa44674d3f49dcca4a6523b6ab1ef9bbea5c659057bec13153e1873718d6b62ab0ea57a3d57ee37f0f1136ae30e3ea503df43b0afa3ae437c8750be7f5 + version: 16.9.2 + resolution: "@types/node@npm:16.9.2" + checksum: 204aa883bc93a267f43804af8872e538935369ab905d5ca702d2c17a213339f8df974bb95d21e2e714e8f83f669b185d8526f7c4b5d16adbdb5d96d4f2e75fa9 languageName: node linkType: hard "@types/node@npm:^14.14.22": - version: 14.17.15 - resolution: "@types/node@npm:14.17.15" - checksum: e0840304db236027e822ef1e149de433afd20d2553699cdc2ce651d107a77646c6eaaeaec8c348eabdc05169440dbc2cf069791bef65ca4b6e5ee4412e69c898 + version: 14.17.17 + resolution: "@types/node@npm:14.17.17" + checksum: ec17a5662e8e4dafbf5c7b577b390811f521ea984525c8fae3b90b14222a61832161c74c9a335abe8ef01a59adba578498298a9ccee0d84d71285680f5bc135a languageName: node linkType: hard @@ -443,11 +443,11 @@ __metadata: linkType: hard "@typescript-eslint/eslint-plugin@npm:^4.14.1": - version: 4.31.0 - resolution: "@typescript-eslint/eslint-plugin@npm:4.31.0" + version: 4.31.1 + resolution: "@typescript-eslint/eslint-plugin@npm:4.31.1" dependencies: - "@typescript-eslint/experimental-utils": 4.31.0 - "@typescript-eslint/scope-manager": 4.31.0 + "@typescript-eslint/experimental-utils": 4.31.1 + "@typescript-eslint/scope-manager": 4.31.1 debug: ^4.3.1 functional-red-black-tree: ^1.0.1 regexpp: ^3.1.0 @@ -459,66 +459,66 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 3a285a55d493b427644ab864d36b2abc663b1c2707a0bccb748a56e4e8025275025f8268d70dfea7ca2f82fe54a64de4c5634d4552c72a81d6f17a7ab20d5f87 + checksum: 90bed374dcdb5497a829f6bb02aa2a88dfb74683b0385b433e29a34b03d4b0f2992cd953cee20426c35c2695fb75845824860a77aca12481e9a1f823c4158bf8 languageName: node linkType: hard -"@typescript-eslint/experimental-utils@npm:4.31.0": - version: 4.31.0 - resolution: "@typescript-eslint/experimental-utils@npm:4.31.0" +"@typescript-eslint/experimental-utils@npm:4.31.1": + version: 4.31.1 + resolution: "@typescript-eslint/experimental-utils@npm:4.31.1" dependencies: "@types/json-schema": ^7.0.7 - "@typescript-eslint/scope-manager": 4.31.0 - "@typescript-eslint/types": 4.31.0 - "@typescript-eslint/typescript-estree": 4.31.0 + "@typescript-eslint/scope-manager": 4.31.1 + "@typescript-eslint/types": 4.31.1 + "@typescript-eslint/typescript-estree": 4.31.1 eslint-scope: ^5.1.1 eslint-utils: ^3.0.0 peerDependencies: eslint: "*" - checksum: 24581932c50ae561aa7712ae5966ad962096d7b86efd3c0620080b32ba014fc082394e8475b8e1b5ad5ab19b11383f00dd9469b6b1305913e1eb73182febea6c + checksum: 0767a1a554b78e3a81df28a40d213b0ca8d16e2360e04a377d99fceec4cf6af132953076fe6ed5a07708e6115091d18744a6b4904878e029bb22278e84193f59 |
