From a8bcdb346bd21ab4d48384fefa7f8dc03870975f Mon Sep 17 00:00:00 2001 From: "Ean Milligan (Bastion)" Date: Fri, 24 Jun 2022 21:06:45 -0400 Subject: [PATCH] deno fmt --- src/commands/apiCmd.ts | 3 --- src/commands/apiCmd/allowBlock.ts | 9 +++------ src/commands/apiCmd/deleteGuild.ts | 5 +---- src/commands/apiCmd/showHideWarn.ts | 3 --- src/commands/apiCmd/status.ts | 3 --- src/commands/audit.ts | 3 --- src/commands/auditCmd/auditDB.ts | 3 --- src/commands/help.ts | 3 --- src/commands/info.ts | 3 --- src/commands/ping.ts | 3 --- src/commands/privacy.ts | 3 --- src/commands/report.ts | 3 --- src/commands/rip.ts | 3 --- src/commands/rollHelp.ts | 3 --- src/commands/stats.ts | 3 --- src/commands/version.ts | 3 --- src/endpoints/deletes/apiKeyDelete.ts | 3 --- src/endpoints/gets/apiChannel.ts | 5 ----- src/endpoints/gets/apiKey.ts | 3 --- src/endpoints/gets/apiKeyAdmin.ts | 3 --- src/endpoints/posts/apiChannelAdd.ts | 5 ----- src/endpoints/puts/apiChannelManageActive.ts | 5 ----- src/endpoints/puts/apiChannelManageBan.ts | 5 ----- src/endpoints/puts/apiKeyManage.ts | 5 ----- src/solver/rollQueue.ts | 4 +++- 25 files changed, 7 insertions(+), 87 deletions(-) diff --git a/src/commands/apiCmd.ts b/src/commands/apiCmd.ts index bfb97de..8d5d684 100644 --- a/src/commands/apiCmd.ts +++ b/src/commands/apiCmd.ts @@ -3,9 +3,6 @@ import { // Discordeno deps DiscordenoMessage, hasGuildPermissions, - // Log4Deno deps - log, - LT, } from '../../deps.ts'; import apiCommands from './apiCmd/_index.ts'; import { failColor } from '../commandUtils.ts'; diff --git a/src/commands/apiCmd/allowBlock.ts b/src/commands/apiCmd/allowBlock.ts index 0b22b0a..620e07f 100644 --- a/src/commands/apiCmd/allowBlock.ts +++ b/src/commands/apiCmd/allowBlock.ts @@ -2,9 +2,6 @@ import { dbClient } from '../../db.ts'; import { // Discordeno deps DiscordenoMessage, - // Log4Deno deps - log, - LT, } from '../../../deps.ts'; import { generateApiFailed, generateApiSuccess } from '../../commandUtils.ts'; import utils from '../../utils.ts'; @@ -12,7 +9,7 @@ import utils from '../../utils.ts'; export const allowBlock = async (message: DiscordenoMessage, apiArg: string) => { let errorOutInitial = false; const guildQuery = await dbClient.query(`SELECT guildid, channelid FROM allowed_guilds WHERE guildid = ? AND channelid = ?`, [message.guildId, message.channelId]).catch((e0) => { - utils.commonLoggers.dbError('allowBlock.ts:15', 'query', e0) + utils.commonLoggers.dbError('allowBlock.ts:15', 'query', e0); message.send(generateApiFailed(apiArg)).catch((e: Error) => utils.commonLoggers.messageSendError('allowBlock.ts:16', message, e)); errorOutInitial = true; }); @@ -23,7 +20,7 @@ export const allowBlock = async (message: DiscordenoMessage, apiArg: string) => // Since guild is not in our DB, add it in await dbClient.execute(`INSERT INTO allowed_guilds(guildid,channelid,active) values(?,?,?)`, [message.guildId, message.channelId, (apiArg === 'allow' || apiArg === 'enable') ? 1 : 0]).catch( (e0) => { - utils.commonLoggers.dbError('allowBlock:26', 'insert into', e0) + utils.commonLoggers.dbError('allowBlock:26', 'insert into', e0); message.send(generateApiFailed(apiArg)).catch((e: Error) => utils.commonLoggers.messageSendError('allowBlock.ts:27', message, e)); errorOut = true; }, @@ -32,7 +29,7 @@ export const allowBlock = async (message: DiscordenoMessage, apiArg: string) => // Since guild is in our DB, update it await dbClient.execute(`UPDATE allowed_guilds SET active = ? WHERE guildid = ? AND channelid = ?`, [(apiArg === 'allow' || apiArg === 'enable') ? 1 : 0, message.guildId, message.channelId]).catch( (e0) => { - utils.commonLoggers.dbError('allowBlock.ts:35', 'update', e0) + utils.commonLoggers.dbError('allowBlock.ts:35', 'update', e0); message.send(generateApiFailed(apiArg)).catch((e: Error) => utils.commonLoggers.messageSendError('allowBlock.ts:36', message, e)); errorOut = true; }, diff --git a/src/commands/apiCmd/deleteGuild.ts b/src/commands/apiCmd/deleteGuild.ts index 96d6e74..3cfcf17 100644 --- a/src/commands/apiCmd/deleteGuild.ts +++ b/src/commands/apiCmd/deleteGuild.ts @@ -2,9 +2,6 @@ import { dbClient } from '../../db.ts'; import { // Discordeno deps DiscordenoMessage, - // Log4Deno deps - log, - LT, } from '../../../deps.ts'; import { failColor, successColor } from '../../commandUtils.ts'; import utils from '../../utils.ts'; @@ -12,7 +9,7 @@ import utils from '../../utils.ts'; export const deleteGuild = async (message: DiscordenoMessage) => { let errorOut = false; await dbClient.execute(`DELETE FROM allowed_guilds WHERE guildid = ? AND channelid = ?`, [message.guildId, message.channelId]).catch((e0) => { - utils.commonLoggers.dbError('deleteGuild.ts:15', 'query', e0) + utils.commonLoggers.dbError('deleteGuild.ts:15', 'query', e0); message.send({ embeds: [{ color: failColor, diff --git a/src/commands/apiCmd/showHideWarn.ts b/src/commands/apiCmd/showHideWarn.ts index c3f7827..3e9cbbc 100644 --- a/src/commands/apiCmd/showHideWarn.ts +++ b/src/commands/apiCmd/showHideWarn.ts @@ -2,9 +2,6 @@ import { dbClient } from '../../db.ts'; import { // Discordeno deps DiscordenoMessage, - // Log4Deno deps - log, - LT, } from '../../../deps.ts'; import { generateApiFailed, generateApiSuccess } from '../../commandUtils.ts'; import utils from '../../utils.ts'; diff --git a/src/commands/apiCmd/status.ts b/src/commands/apiCmd/status.ts index a3f4031..7615983 100644 --- a/src/commands/apiCmd/status.ts +++ b/src/commands/apiCmd/status.ts @@ -2,9 +2,6 @@ import { dbClient } from '../../db.ts'; import { // Discordeno deps DiscordenoMessage, - // Log4Deno deps - log, - LT, } from '../../../deps.ts'; import { failColor, generateApiStatus } from '../../commandUtils.ts'; import utils from '../../utils.ts'; diff --git a/src/commands/audit.ts b/src/commands/audit.ts index ed3127b..43eea83 100644 --- a/src/commands/audit.ts +++ b/src/commands/audit.ts @@ -3,9 +3,6 @@ import { dbClient } from '../db.ts'; import { // Discordeno deps DiscordenoMessage, - // Log4Deno deps - log, - LT, } from '../../deps.ts'; import auditCommands from './auditCmd/_index.ts'; import { failColor } from '../commandUtils.ts'; diff --git a/src/commands/auditCmd/auditDB.ts b/src/commands/auditCmd/auditDB.ts index 2dbb0b3..31930c3 100644 --- a/src/commands/auditCmd/auditDB.ts +++ b/src/commands/auditCmd/auditDB.ts @@ -3,9 +3,6 @@ import { // Discordeno deps DiscordenoMessage, EmbedField, - // Log4Deno deps - log, - LT, } from '../../../deps.ts'; import { infoColor2 } from '../../commandUtils.ts'; import { compilingStats } from '../../commonEmbeds.ts'; diff --git a/src/commands/help.ts b/src/commands/help.ts index 6c04e7b..7f7a2a8 100644 --- a/src/commands/help.ts +++ b/src/commands/help.ts @@ -3,9 +3,6 @@ import { dbClient } from '../db.ts'; import { // Discordeno deps DiscordenoMessage, - // Log4Deno deps - log, - LT, } from '../../deps.ts'; import { infoColor2 } from '../commandUtils.ts'; import utils from '../utils.ts'; diff --git a/src/commands/info.ts b/src/commands/info.ts index 449d188..b918c5c 100644 --- a/src/commands/info.ts +++ b/src/commands/info.ts @@ -2,9 +2,6 @@ import { dbClient } from '../db.ts'; import { // Discordeno deps DiscordenoMessage, - // Log4Deno deps - log, - LT, } from '../../deps.ts'; import { infoColor2 } from '../commandUtils.ts'; import utils from '../utils.ts'; diff --git a/src/commands/ping.ts b/src/commands/ping.ts index 32f3aa1..56e32d7 100644 --- a/src/commands/ping.ts +++ b/src/commands/ping.ts @@ -2,9 +2,6 @@ import { dbClient } from '../db.ts'; import { // Discordeno deps DiscordenoMessage, - // Log4Deno deps - log, - LT, } from '../../deps.ts'; import { generatePing } from '../commandUtils.ts'; import utils from '../utils.ts'; diff --git a/src/commands/privacy.ts b/src/commands/privacy.ts index cf7577e..5a4716d 100644 --- a/src/commands/privacy.ts +++ b/src/commands/privacy.ts @@ -3,9 +3,6 @@ import { dbClient } from '../db.ts'; import { // Discordeno deps DiscordenoMessage, - // Log4Deno deps - log, - LT, } from '../../deps.ts'; import { infoColor1 } from '../commandUtils.ts'; import utils from '../utils.ts'; diff --git a/src/commands/report.ts b/src/commands/report.ts index e984748..106eaad 100644 --- a/src/commands/report.ts +++ b/src/commands/report.ts @@ -3,9 +3,6 @@ import { dbClient } from '../db.ts'; import { // Discordeno deps DiscordenoMessage, - // Log4Deno deps - log, - LT, // Discordeno deps sendMessage, } from '../../deps.ts'; diff --git a/src/commands/rip.ts b/src/commands/rip.ts index 1f9da7d..ed2945e 100644 --- a/src/commands/rip.ts +++ b/src/commands/rip.ts @@ -2,9 +2,6 @@ import { dbClient } from '../db.ts'; import { // Discordeno deps DiscordenoMessage, - // Log4Deno deps - log, - LT, } from '../../deps.ts'; import { infoColor2 } from '../commandUtils.ts'; import utils from '../utils.ts'; diff --git a/src/commands/rollHelp.ts b/src/commands/rollHelp.ts index 8547486..92043ff 100644 --- a/src/commands/rollHelp.ts +++ b/src/commands/rollHelp.ts @@ -3,9 +3,6 @@ import { dbClient } from '../db.ts'; import { // Discordeno deps DiscordenoMessage, - // Log4Deno deps - log, - LT, } from '../../deps.ts'; import { infoColor1, infoColor2, successColor } from '../commandUtils.ts'; import utils from '../utils.ts'; diff --git a/src/commands/stats.ts b/src/commands/stats.ts index bc2613f..ad220d7 100644 --- a/src/commands/stats.ts +++ b/src/commands/stats.ts @@ -4,9 +4,6 @@ import { cache, cacheHandlers, DiscordenoMessage, - // Log4Deno deps - log, - LT, } from '../../deps.ts'; import { generateStats } from '../commandUtils.ts'; import { compilingStats } from '../commonEmbeds.ts'; diff --git a/src/commands/version.ts b/src/commands/version.ts index 0ab3385..d4e72d0 100644 --- a/src/commands/version.ts +++ b/src/commands/version.ts @@ -3,9 +3,6 @@ import { dbClient } from '../db.ts'; import { // Discordeno deps DiscordenoMessage, - // Log4Deno deps - log, - LT, } from '../../deps.ts'; import { infoColor1 } from '../commandUtils.ts'; import utils from '../utils.ts'; diff --git a/src/endpoints/deletes/apiKeyDelete.ts b/src/endpoints/deletes/apiKeyDelete.ts index 236a4f1..c8752e8 100644 --- a/src/endpoints/deletes/apiKeyDelete.ts +++ b/src/endpoints/deletes/apiKeyDelete.ts @@ -1,9 +1,6 @@ import config from '../../../config.ts'; import { dbClient } from '../../db.ts'; import { - // Log4Deno deps - log, - LT, // nanoid deps nanoid, // Discordeno deps diff --git a/src/endpoints/gets/apiChannel.ts b/src/endpoints/gets/apiChannel.ts index 13fe4b8..98e9158 100644 --- a/src/endpoints/gets/apiChannel.ts +++ b/src/endpoints/gets/apiChannel.ts @@ -1,9 +1,4 @@ import { dbClient } from '../../db.ts'; -import { - // Log4Deno deps - log, - LT, -} from '../../../deps.ts'; import stdResp from '../stdResponses.ts'; import utils from '../../utils.ts'; diff --git a/src/endpoints/gets/apiKey.ts b/src/endpoints/gets/apiKey.ts index 3bc8578..36d6c90 100644 --- a/src/endpoints/gets/apiKey.ts +++ b/src/endpoints/gets/apiKey.ts @@ -1,9 +1,6 @@ import config from '../../../config.ts'; import { dbClient } from '../../db.ts'; import { - // Log4Deno deps - log, - LT, // nanoid deps nanoid, // Discordeno deps diff --git a/src/endpoints/gets/apiKeyAdmin.ts b/src/endpoints/gets/apiKeyAdmin.ts index bda7cdb..7390d26 100644 --- a/src/endpoints/gets/apiKeyAdmin.ts +++ b/src/endpoints/gets/apiKeyAdmin.ts @@ -1,9 +1,6 @@ import config from '../../../config.ts'; import { dbClient } from '../../db.ts'; import { - // Log4Deno deps - log, - LT, // nanoid deps nanoid, } from '../../../deps.ts'; diff --git a/src/endpoints/posts/apiChannelAdd.ts b/src/endpoints/posts/apiChannelAdd.ts index bc3fa9b..12a360b 100644 --- a/src/endpoints/posts/apiChannelAdd.ts +++ b/src/endpoints/posts/apiChannelAdd.ts @@ -1,9 +1,4 @@ import { dbClient } from '../../db.ts'; -import { - // Log4Deno deps - log, - LT, -} from '../../../deps.ts'; import stdResp from '../stdResponses.ts'; import utils from '../../utils.ts'; diff --git a/src/endpoints/puts/apiChannelManageActive.ts b/src/endpoints/puts/apiChannelManageActive.ts index d3b0993..e0c4dd5 100644 --- a/src/endpoints/puts/apiChannelManageActive.ts +++ b/src/endpoints/puts/apiChannelManageActive.ts @@ -1,9 +1,4 @@ import { dbClient } from '../../db.ts'; -import { - // Log4Deno deps - log, - LT, -} from '../../../deps.ts'; import stdResp from '../stdResponses.ts'; import utils from '../../utils.ts'; diff --git a/src/endpoints/puts/apiChannelManageBan.ts b/src/endpoints/puts/apiChannelManageBan.ts index e8375c8..e9f78fe 100644 --- a/src/endpoints/puts/apiChannelManageBan.ts +++ b/src/endpoints/puts/apiChannelManageBan.ts @@ -1,10 +1,5 @@ import config from '../../../config.ts'; import { dbClient } from '../../db.ts'; -import { - // Log4Deno deps - log, - LT, -} from '../../../deps.ts'; import stdResp from '../stdResponses.ts'; import utils from '../../utils.ts'; diff --git a/src/endpoints/puts/apiKeyManage.ts b/src/endpoints/puts/apiKeyManage.ts index 0897b12..ee23ae9 100644 --- a/src/endpoints/puts/apiKeyManage.ts +++ b/src/endpoints/puts/apiKeyManage.ts @@ -1,10 +1,5 @@ import config from '../../../config.ts'; import { dbClient } from '../../db.ts'; -import { - // Log4Deno deps - log, - LT, -} from '../../../deps.ts'; import stdResp from '../stdResponses.ts'; import utils from '../../utils.ts'; diff --git a/src/solver/rollQueue.ts b/src/solver/rollQueue.ts index 78cc4fe..2da271f 100644 --- a/src/solver/rollQueue.ts +++ b/src/solver/rollQueue.ts @@ -77,7 +77,9 @@ const handleRollWorker = async (rq: QueuedRoll) => { if (rq.apiRoll || DEVMODE && config.logRolls) { // If enabled, log rolls so we can see what went wrong - dbClient.execute(queries.insertRollLogCmd(rq.apiRoll ? 1 : 0, 1), [rq.originalCommand, returnmsg.errorCode, rq.apiRoll ? null : rq.dd.m.id]).catch((e) => utils.commonLoggers.dbError('rollQueue.ts:82', 'insert into', e)); + dbClient.execute(queries.insertRollLogCmd(rq.apiRoll ? 1 : 0, 1), [rq.originalCommand, returnmsg.errorCode, rq.apiRoll ? null : rq.dd.m.id]).catch((e) => + utils.commonLoggers.dbError('rollQueue.ts:82', 'insert into', e) + ); } } else { let n: DiscordenoMessage | void;