diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-19 12:03:21 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-19 12:03:21 -0400 |
commit | b29a217f76483e000bd9d75d30250d11a0a88c4d (patch) | |
tree | 041b13dc115cf94aff81cda17cf088f2290c2a14 /src/lib/utils | |
parent | 5984cc283ca50099d0e266b994324446316c0013 (diff) | |
download | tanzanite-b29a217f76483e000bd9d75d30250d11a0a88c4d.tar.gz tanzanite-b29a217f76483e000bd9d75d30250d11a0a88c4d.tar.bz2 tanzanite-b29a217f76483e000bd9d75d30250d11a0a88c4d.zip |
added steal command, revamped error handling and other stuff
Diffstat (limited to 'src/lib/utils')
-rw-r--r-- | src/lib/utils/BushConstants.ts | 64 | ||||
-rw-r--r-- | src/lib/utils/BushLogger.ts | 7 |
2 files changed, 68 insertions, 3 deletions
diff --git a/src/lib/utils/BushConstants.ts b/src/lib/utils/BushConstants.ts index e58380b..68393c4 100644 --- a/src/lib/utils/BushConstants.ts +++ b/src/lib/utils/BushConstants.ts @@ -1,4 +1,68 @@ +interface bushColors { + default: '#1FD8F1'; + error: '#EF4947'; + warn: '#FEBA12'; + success: '#3BB681'; + info: '#3B78FF'; + red: '#ff0000'; + blue: '#0055ff'; + aqua: '#00bbff'; + purple: '#8400ff'; + blurple: '#5440cd'; + pink: '#ff00e6'; + green: '#00ff1e'; + darkGreen: '#008f11'; + gold: '#b59400'; + yellow: '#ffff00'; + white: '#ffffff'; + gray: '#a6a6a6'; + lightGray: '#cfcfcf'; + darkGray: '#7a7a7a'; + black: '#000000'; + orange: '#E86100'; +} export class BushConstants { + public static emojis = { + success: '<:checkmark:837109864101707807>', + warn: '<:warn:848726900876247050>', + error: '<:error:837123021016924261>', + successFull: '<:checkmark_full:850118767576088646>', + warnFull: '<:warn_full:850118767391539312>', + errorFull: '<:error_full:850118767295201350>', + mad: '<:mad:783046135392239626>', + join: '<:join:850198029809614858>', + leave: '<:leave:850198048205307919>', + loading: '<a:Loading:853419254619963392>', + offlineCircle: '<:offline:787550565382750239>', + dndCircle: '<:dnd:787550487633330176>', + idleCircle: '<:idle:787550520956551218>', + onlineCircle: '<:online:787550449435803658>' + }; + + public static colors: bushColors = { + default: '#1FD8F1', + error: '#EF4947', + warn: '#FEBA12', + success: '#3BB681', + info: '#3B78FF', + red: '#ff0000', + blue: '#0055ff', + aqua: '#00bbff', + purple: '#8400ff', + blurple: '#5440cd', + pink: '#ff00e6', + green: '#00ff1e', + darkGreen: '#008f11', + gold: '#b59400', + yellow: '#ffff00', + white: '#ffffff', + gray: '#a6a6a6', + lightGray: '#cfcfcf', + darkGray: '#7a7a7a', + black: '#000000', + orange: '#E86100' + }; + // Somewhat stolen from @Mzato0001 public static TimeUnits: { [key: string]: { match: RegExp; value: number } } = { years: { diff --git a/src/lib/utils/BushLogger.ts b/src/lib/utils/BushLogger.ts index 60817b9..e716e68 100644 --- a/src/lib/utils/BushLogger.ts +++ b/src/lib/utils/BushLogger.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import chalk from 'chalk'; -import { MessageEmbed, Util } from 'discord.js'; +import { Message, MessageEmbed, Util } from 'discord.js'; import { inspect } from 'util'; import { BushSendMessageType } from '../extensions/discord-akairo/BushClient'; @@ -69,9 +69,9 @@ export class BushLogger { } /** Sends a message to the error channel */ - public static async channelError(message: BushSendMessageType): Promise<void> { + public static async channelError(message: BushSendMessageType): Promise<Message> { const channel = await util.getConfigChannel('error'); - await channel.send(message).catch(() => {}); + return await channel.send(message); } /** @@ -177,6 +177,7 @@ export class BushLogger { .setColor(util.colors.error) .setTimestamp(); await this.channelError({ embeds: [embed] }); + return; } /** |