deno fmt
This commit is contained in:
parent
d769ac0e5a
commit
a8bcdb346b
|
@ -3,9 +3,6 @@ import {
|
||||||
// Discordeno deps
|
// Discordeno deps
|
||||||
DiscordenoMessage,
|
DiscordenoMessage,
|
||||||
hasGuildPermissions,
|
hasGuildPermissions,
|
||||||
// Log4Deno deps
|
|
||||||
log,
|
|
||||||
LT,
|
|
||||||
} from '../../deps.ts';
|
} from '../../deps.ts';
|
||||||
import apiCommands from './apiCmd/_index.ts';
|
import apiCommands from './apiCmd/_index.ts';
|
||||||
import { failColor } from '../commandUtils.ts';
|
import { failColor } from '../commandUtils.ts';
|
||||||
|
|
|
@ -2,9 +2,6 @@ import { dbClient } from '../../db.ts';
|
||||||
import {
|
import {
|
||||||
// Discordeno deps
|
// Discordeno deps
|
||||||
DiscordenoMessage,
|
DiscordenoMessage,
|
||||||
// Log4Deno deps
|
|
||||||
log,
|
|
||||||
LT,
|
|
||||||
} from '../../../deps.ts';
|
} from '../../../deps.ts';
|
||||||
import { generateApiFailed, generateApiSuccess } from '../../commandUtils.ts';
|
import { generateApiFailed, generateApiSuccess } from '../../commandUtils.ts';
|
||||||
import utils from '../../utils.ts';
|
import utils from '../../utils.ts';
|
||||||
|
@ -12,7 +9,7 @@ import utils from '../../utils.ts';
|
||||||
export const allowBlock = async (message: DiscordenoMessage, apiArg: string) => {
|
export const allowBlock = async (message: DiscordenoMessage, apiArg: string) => {
|
||||||
let errorOutInitial = false;
|
let errorOutInitial = false;
|
||||||
const guildQuery = await dbClient.query(`SELECT guildid, channelid FROM allowed_guilds WHERE guildid = ? AND channelid = ?`, [message.guildId, message.channelId]).catch((e0) => {
|
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));
|
message.send(generateApiFailed(apiArg)).catch((e: Error) => utils.commonLoggers.messageSendError('allowBlock.ts:16', message, e));
|
||||||
errorOutInitial = true;
|
errorOutInitial = true;
|
||||||
});
|
});
|
||||||
|
@ -23,7 +20,7 @@ export const allowBlock = async (message: DiscordenoMessage, apiArg: string) =>
|
||||||
// Since guild is not in our DB, add it in
|
// 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(
|
await dbClient.execute(`INSERT INTO allowed_guilds(guildid,channelid,active) values(?,?,?)`, [message.guildId, message.channelId, (apiArg === 'allow' || apiArg === 'enable') ? 1 : 0]).catch(
|
||||||
(e0) => {
|
(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));
|
message.send(generateApiFailed(apiArg)).catch((e: Error) => utils.commonLoggers.messageSendError('allowBlock.ts:27', message, e));
|
||||||
errorOut = true;
|
errorOut = true;
|
||||||
},
|
},
|
||||||
|
@ -32,7 +29,7 @@ export const allowBlock = async (message: DiscordenoMessage, apiArg: string) =>
|
||||||
// Since guild is in our DB, update it
|
// 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(
|
await dbClient.execute(`UPDATE allowed_guilds SET active = ? WHERE guildid = ? AND channelid = ?`, [(apiArg === 'allow' || apiArg === 'enable') ? 1 : 0, message.guildId, message.channelId]).catch(
|
||||||
(e0) => {
|
(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));
|
message.send(generateApiFailed(apiArg)).catch((e: Error) => utils.commonLoggers.messageSendError('allowBlock.ts:36', message, e));
|
||||||
errorOut = true;
|
errorOut = true;
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,9 +2,6 @@ import { dbClient } from '../../db.ts';
|
||||||
import {
|
import {
|
||||||
// Discordeno deps
|
// Discordeno deps
|
||||||
DiscordenoMessage,
|
DiscordenoMessage,
|
||||||
// Log4Deno deps
|
|
||||||
log,
|
|
||||||
LT,
|
|
||||||
} from '../../../deps.ts';
|
} from '../../../deps.ts';
|
||||||
import { failColor, successColor } from '../../commandUtils.ts';
|
import { failColor, successColor } from '../../commandUtils.ts';
|
||||||
import utils from '../../utils.ts';
|
import utils from '../../utils.ts';
|
||||||
|
@ -12,7 +9,7 @@ import utils from '../../utils.ts';
|
||||||
export const deleteGuild = async (message: DiscordenoMessage) => {
|
export const deleteGuild = async (message: DiscordenoMessage) => {
|
||||||
let errorOut = false;
|
let errorOut = false;
|
||||||
await dbClient.execute(`DELETE FROM allowed_guilds WHERE guildid = ? AND channelid = ?`, [message.guildId, message.channelId]).catch((e0) => {
|
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({
|
message.send({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
color: failColor,
|
color: failColor,
|
||||||
|
|
|
@ -2,9 +2,6 @@ import { dbClient } from '../../db.ts';
|
||||||
import {
|
import {
|
||||||
// Discordeno deps
|
// Discordeno deps
|
||||||
DiscordenoMessage,
|
DiscordenoMessage,
|
||||||
// Log4Deno deps
|
|
||||||
log,
|
|
||||||
LT,
|
|
||||||
} from '../../../deps.ts';
|
} from '../../../deps.ts';
|
||||||
import { generateApiFailed, generateApiSuccess } from '../../commandUtils.ts';
|
import { generateApiFailed, generateApiSuccess } from '../../commandUtils.ts';
|
||||||
import utils from '../../utils.ts';
|
import utils from '../../utils.ts';
|
||||||
|
|
|
@ -2,9 +2,6 @@ import { dbClient } from '../../db.ts';
|
||||||
import {
|
import {
|
||||||
// Discordeno deps
|
// Discordeno deps
|
||||||
DiscordenoMessage,
|
DiscordenoMessage,
|
||||||
// Log4Deno deps
|
|
||||||
log,
|
|
||||||
LT,
|
|
||||||
} from '../../../deps.ts';
|
} from '../../../deps.ts';
|
||||||
import { failColor, generateApiStatus } from '../../commandUtils.ts';
|
import { failColor, generateApiStatus } from '../../commandUtils.ts';
|
||||||
import utils from '../../utils.ts';
|
import utils from '../../utils.ts';
|
||||||
|
|
|
@ -3,9 +3,6 @@ import { dbClient } from '../db.ts';
|
||||||
import {
|
import {
|
||||||
// Discordeno deps
|
// Discordeno deps
|
||||||
DiscordenoMessage,
|
DiscordenoMessage,
|
||||||
// Log4Deno deps
|
|
||||||
log,
|
|
||||||
LT,
|
|
||||||
} from '../../deps.ts';
|
} from '../../deps.ts';
|
||||||
import auditCommands from './auditCmd/_index.ts';
|
import auditCommands from './auditCmd/_index.ts';
|
||||||
import { failColor } from '../commandUtils.ts';
|
import { failColor } from '../commandUtils.ts';
|
||||||
|
|
|
@ -3,9 +3,6 @@ import {
|
||||||
// Discordeno deps
|
// Discordeno deps
|
||||||
DiscordenoMessage,
|
DiscordenoMessage,
|
||||||
EmbedField,
|
EmbedField,
|
||||||
// Log4Deno deps
|
|
||||||
log,
|
|
||||||
LT,
|
|
||||||
} from '../../../deps.ts';
|
} from '../../../deps.ts';
|
||||||
import { infoColor2 } from '../../commandUtils.ts';
|
import { infoColor2 } from '../../commandUtils.ts';
|
||||||
import { compilingStats } from '../../commonEmbeds.ts';
|
import { compilingStats } from '../../commonEmbeds.ts';
|
||||||
|
|
|
@ -3,9 +3,6 @@ import { dbClient } from '../db.ts';
|
||||||
import {
|
import {
|
||||||
// Discordeno deps
|
// Discordeno deps
|
||||||
DiscordenoMessage,
|
DiscordenoMessage,
|
||||||
// Log4Deno deps
|
|
||||||
log,
|
|
||||||
LT,
|
|
||||||
} from '../../deps.ts';
|
} from '../../deps.ts';
|
||||||
import { infoColor2 } from '../commandUtils.ts';
|
import { infoColor2 } from '../commandUtils.ts';
|
||||||
import utils from '../utils.ts';
|
import utils from '../utils.ts';
|
||||||
|
|
|
@ -2,9 +2,6 @@ import { dbClient } from '../db.ts';
|
||||||
import {
|
import {
|
||||||
// Discordeno deps
|
// Discordeno deps
|
||||||
DiscordenoMessage,
|
DiscordenoMessage,
|
||||||
// Log4Deno deps
|
|
||||||
log,
|
|
||||||
LT,
|
|
||||||
} from '../../deps.ts';
|
} from '../../deps.ts';
|
||||||
import { infoColor2 } from '../commandUtils.ts';
|
import { infoColor2 } from '../commandUtils.ts';
|
||||||
import utils from '../utils.ts';
|
import utils from '../utils.ts';
|
||||||
|
|
|
@ -2,9 +2,6 @@ import { dbClient } from '../db.ts';
|
||||||
import {
|
import {
|
||||||
// Discordeno deps
|
// Discordeno deps
|
||||||
DiscordenoMessage,
|
DiscordenoMessage,
|
||||||
// Log4Deno deps
|
|
||||||
log,
|
|
||||||
LT,
|
|
||||||
} from '../../deps.ts';
|
} from '../../deps.ts';
|
||||||
import { generatePing } from '../commandUtils.ts';
|
import { generatePing } from '../commandUtils.ts';
|
||||||
import utils from '../utils.ts';
|
import utils from '../utils.ts';
|
||||||
|
|
|
@ -3,9 +3,6 @@ import { dbClient } from '../db.ts';
|
||||||
import {
|
import {
|
||||||
// Discordeno deps
|
// Discordeno deps
|
||||||
DiscordenoMessage,
|
DiscordenoMessage,
|
||||||
// Log4Deno deps
|
|
||||||
log,
|
|
||||||
LT,
|
|
||||||
} from '../../deps.ts';
|
} from '../../deps.ts';
|
||||||
import { infoColor1 } from '../commandUtils.ts';
|
import { infoColor1 } from '../commandUtils.ts';
|
||||||
import utils from '../utils.ts';
|
import utils from '../utils.ts';
|
||||||
|
|
|
@ -3,9 +3,6 @@ import { dbClient } from '../db.ts';
|
||||||
import {
|
import {
|
||||||
// Discordeno deps
|
// Discordeno deps
|
||||||
DiscordenoMessage,
|
DiscordenoMessage,
|
||||||
// Log4Deno deps
|
|
||||||
log,
|
|
||||||
LT,
|
|
||||||
// Discordeno deps
|
// Discordeno deps
|
||||||
sendMessage,
|
sendMessage,
|
||||||
} from '../../deps.ts';
|
} from '../../deps.ts';
|
||||||
|
|
|
@ -2,9 +2,6 @@ import { dbClient } from '../db.ts';
|
||||||
import {
|
import {
|
||||||
// Discordeno deps
|
// Discordeno deps
|
||||||
DiscordenoMessage,
|
DiscordenoMessage,
|
||||||
// Log4Deno deps
|
|
||||||
log,
|
|
||||||
LT,
|
|
||||||
} from '../../deps.ts';
|
} from '../../deps.ts';
|
||||||
import { infoColor2 } from '../commandUtils.ts';
|
import { infoColor2 } from '../commandUtils.ts';
|
||||||
import utils from '../utils.ts';
|
import utils from '../utils.ts';
|
||||||
|
|
|
@ -3,9 +3,6 @@ import { dbClient } from '../db.ts';
|
||||||
import {
|
import {
|
||||||
// Discordeno deps
|
// Discordeno deps
|
||||||
DiscordenoMessage,
|
DiscordenoMessage,
|
||||||
// Log4Deno deps
|
|
||||||
log,
|
|
||||||
LT,
|
|
||||||
} from '../../deps.ts';
|
} from '../../deps.ts';
|
||||||
import { infoColor1, infoColor2, successColor } from '../commandUtils.ts';
|
import { infoColor1, infoColor2, successColor } from '../commandUtils.ts';
|
||||||
import utils from '../utils.ts';
|
import utils from '../utils.ts';
|
||||||
|
|
|
@ -4,9 +4,6 @@ import {
|
||||||
cache,
|
cache,
|
||||||
cacheHandlers,
|
cacheHandlers,
|
||||||
DiscordenoMessage,
|
DiscordenoMessage,
|
||||||
// Log4Deno deps
|
|
||||||
log,
|
|
||||||
LT,
|
|
||||||
} from '../../deps.ts';
|
} from '../../deps.ts';
|
||||||
import { generateStats } from '../commandUtils.ts';
|
import { generateStats } from '../commandUtils.ts';
|
||||||
import { compilingStats } from '../commonEmbeds.ts';
|
import { compilingStats } from '../commonEmbeds.ts';
|
||||||
|
|
|
@ -3,9 +3,6 @@ import { dbClient } from '../db.ts';
|
||||||
import {
|
import {
|
||||||
// Discordeno deps
|
// Discordeno deps
|
||||||
DiscordenoMessage,
|
DiscordenoMessage,
|
||||||
// Log4Deno deps
|
|
||||||
log,
|
|
||||||
LT,
|
|
||||||
} from '../../deps.ts';
|
} from '../../deps.ts';
|
||||||
import { infoColor1 } from '../commandUtils.ts';
|
import { infoColor1 } from '../commandUtils.ts';
|
||||||
import utils from '../utils.ts';
|
import utils from '../utils.ts';
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
import config from '../../../config.ts';
|
import config from '../../../config.ts';
|
||||||
import { dbClient } from '../../db.ts';
|
import { dbClient } from '../../db.ts';
|
||||||
import {
|
import {
|
||||||
// Log4Deno deps
|
|
||||||
log,
|
|
||||||
LT,
|
|
||||||
// nanoid deps
|
// nanoid deps
|
||||||
nanoid,
|
nanoid,
|
||||||
// Discordeno deps
|
// Discordeno deps
|
||||||
|
|
|
@ -1,9 +1,4 @@
|
||||||
import { dbClient } from '../../db.ts';
|
import { dbClient } from '../../db.ts';
|
||||||
import {
|
|
||||||
// Log4Deno deps
|
|
||||||
log,
|
|
||||||
LT,
|
|
||||||
} from '../../../deps.ts';
|
|
||||||
import stdResp from '../stdResponses.ts';
|
import stdResp from '../stdResponses.ts';
|
||||||
import utils from '../../utils.ts';
|
import utils from '../../utils.ts';
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
import config from '../../../config.ts';
|
import config from '../../../config.ts';
|
||||||
import { dbClient } from '../../db.ts';
|
import { dbClient } from '../../db.ts';
|
||||||
import {
|
import {
|
||||||
// Log4Deno deps
|
|
||||||
log,
|
|
||||||
LT,
|
|
||||||
// nanoid deps
|
// nanoid deps
|
||||||
nanoid,
|
nanoid,
|
||||||
// Discordeno deps
|
// Discordeno deps
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
import config from '../../../config.ts';
|
import config from '../../../config.ts';
|
||||||
import { dbClient } from '../../db.ts';
|
import { dbClient } from '../../db.ts';
|
||||||
import {
|
import {
|
||||||
// Log4Deno deps
|
|
||||||
log,
|
|
||||||
LT,
|
|
||||||
// nanoid deps
|
// nanoid deps
|
||||||
nanoid,
|
nanoid,
|
||||||
} from '../../../deps.ts';
|
} from '../../../deps.ts';
|
||||||
|
|
|
@ -1,9 +1,4 @@
|
||||||
import { dbClient } from '../../db.ts';
|
import { dbClient } from '../../db.ts';
|
||||||
import {
|
|
||||||
// Log4Deno deps
|
|
||||||
log,
|
|
||||||
LT,
|
|
||||||
} from '../../../deps.ts';
|
|
||||||
import stdResp from '../stdResponses.ts';
|
import stdResp from '../stdResponses.ts';
|
||||||
import utils from '../../utils.ts';
|
import utils from '../../utils.ts';
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,4 @@
|
||||||
import { dbClient } from '../../db.ts';
|
import { dbClient } from '../../db.ts';
|
||||||
import {
|
|
||||||
// Log4Deno deps
|
|
||||||
log,
|
|
||||||
LT,
|
|
||||||
} from '../../../deps.ts';
|
|
||||||
import stdResp from '../stdResponses.ts';
|
import stdResp from '../stdResponses.ts';
|
||||||
import utils from '../../utils.ts';
|
import utils from '../../utils.ts';
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,5 @@
|
||||||
import config from '../../../config.ts';
|
import config from '../../../config.ts';
|
||||||
import { dbClient } from '../../db.ts';
|
import { dbClient } from '../../db.ts';
|
||||||
import {
|
|
||||||
// Log4Deno deps
|
|
||||||
log,
|
|
||||||
LT,
|
|
||||||
} from '../../../deps.ts';
|
|
||||||
import stdResp from '../stdResponses.ts';
|
import stdResp from '../stdResponses.ts';
|
||||||
import utils from '../../utils.ts';
|
import utils from '../../utils.ts';
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,5 @@
|
||||||
import config from '../../../config.ts';
|
import config from '../../../config.ts';
|
||||||
import { dbClient } from '../../db.ts';
|
import { dbClient } from '../../db.ts';
|
||||||
import {
|
|
||||||
// Log4Deno deps
|
|
||||||
log,
|
|
||||||
LT,
|
|
||||||
} from '../../../deps.ts';
|
|
||||||
import stdResp from '../stdResponses.ts';
|
import stdResp from '../stdResponses.ts';
|
||||||
import utils from '../../utils.ts';
|
import utils from '../../utils.ts';
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,9 @@ const handleRollWorker = async (rq: QueuedRoll) => {
|
||||||
|
|
||||||
if (rq.apiRoll || DEVMODE && config.logRolls) {
|
if (rq.apiRoll || DEVMODE && config.logRolls) {
|
||||||
// If enabled, log rolls so we can see what went wrong
|
// 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 {
|
} else {
|
||||||
let n: DiscordenoMessage | void;
|
let n: DiscordenoMessage | void;
|
||||||
|
|
Loading…
Reference in New Issue