diff options
author | TymanWasTaken <tyman@tyman.tech> | 2021-05-16 20:30:34 -0400 |
---|---|---|
committer | TymanWasTaken <tyman@tyman.tech> | 2021-05-16 20:30:34 -0400 |
commit | 372718e567e060cead16dde5d6d190666b4dd575 (patch) | |
tree | 1fad29305b6277838833a7e8ae4381136212f301 /src/lib/extensions/Util.ts | |
parent | 1db014860c3cf6070bb29f75b6a8cf08070e5b9a (diff) | |
download | tanzanite-372718e567e060cead16dde5d6d190666b4dd575.tar.gz tanzanite-372718e567e060cead16dde5d6d190666b4dd575.tar.bz2 tanzanite-372718e567e060cead16dde5d6d190666b4dd575.zip |
add colored logging and improved logging code, fix a few moderation command issues, add more logging, and make ban check run every 30s not 60s
Diffstat (limited to 'src/lib/extensions/Util.ts')
-rw-r--r-- | src/lib/extensions/Util.ts | 49 |
1 files changed, 1 insertions, 48 deletions
diff --git a/src/lib/extensions/Util.ts b/src/lib/extensions/Util.ts index 4243ebf..661392f 100644 --- a/src/lib/extensions/Util.ts +++ b/src/lib/extensions/Util.ts @@ -1,12 +1,9 @@ import { ClientUtil } from 'discord-akairo'; import { BotClient } from './BotClient'; -import { User } from 'discord.js'; import { promisify } from 'util'; import { exec } from 'child_process'; import got from 'got'; -import { TextChannel } from 'discord.js'; -import { MessageEmbed } from 'discord.js'; -import { GuildMember } from 'discord.js'; +import { MessageEmbed, GuildMember, User } from 'discord.js'; interface hastebinRes { key: string; @@ -120,14 +117,6 @@ export class Util extends ClientUtil { } /** - * Logs something but only in dev mode - * @param content The thing to log - */ - public devLog(content: unknown): void { - if (this.client.config.dev) console.log(content); - } - - /** * Resolves a user-provided string into a user object, if possible * @param text The text to try and resolve * @returns The user resolved or null @@ -184,42 +173,6 @@ export class Util extends ClientUtil { } /** - * Logs a message to console and log channel as info - * @param message The message to send - */ - public async info(message: string): Promise<void> { - console.log(`INFO: ${message}`); - const channel = (await this.client.channels.fetch( - this.client.config.channels.log - )) as TextChannel; - await channel.send(`INFO: ${message}`); - } - - /** - * Logs a message to console and log channel as a warning - * @param message The message to send - */ - public async warn(message: string): Promise<void> { - console.warn(`WARN: ${message}`); - const channel = (await this.client.channels.fetch( - this.client.config.channels.log - )) as TextChannel; - await channel.send(`WARN: ${message}`); - } - - /** - * Logs a message to console and log channel as an error - * @param message The message to send - */ - public async error(message: string): Promise<void> { - console.error(`ERROR: ${message}`); - const channel = (await this.client.channels.fetch( - this.client.config.channels.error - )) as TextChannel; - await channel.send(`ERROR: ${message}`); - } - - /** * The colors used throught the bot */ public colors = { |