1
1
mirror of https://github.com/Burn-E99/TheArtificer.git synced 2026-06-04 09:03:50 -04:00

linting/type cleanup

This commit is contained in:
Ean Milligan
2025-04-26 22:44:39 -04:00
parent 103ad8a8f5
commit 74c733308f
8 changed files with 18 additions and 10 deletions

View File

@@ -9,7 +9,7 @@ import auditCommands from './auditCmd/_index.ts';
import { failColor } from '../commandUtils.ts';
import utils from '../utils.ts';
export const audit = async (message: DiscordenoMessage, args: string[]) => {
export const audit = (message: DiscordenoMessage, args: string[]) => {
// Light telemetry to see how many times a command is being run
dbClient.execute(queries.callIncCnt('audit')).catch((e) => utils.commonLoggers.dbError('audit.ts:16', 'call sproc INC_CNT on', e));

View File

@@ -8,6 +8,12 @@ import { infoColor2 } from '../../commandUtils.ts';
import { compilingStats } from '../../commonEmbeds.ts';
import utils from '../../utils.ts';
interface DBSizeData {
table: string;
size: string;
rows: number;
}
export const auditDB = async (message: DiscordenoMessage) => {
try {
const m = await message.send(compilingStats);
@@ -17,7 +23,7 @@ export const auditDB = async (message: DiscordenoMessage) => {
// Turn all tables into embed fields, currently only properly will handle 25 tables, but we'll fix that when artificer gets 26 tables
const embedFields: Array<EmbedField> = [];
auditQuery.forEach((row: any) => {
auditQuery.forEach((row: DBSizeData) => {
embedFields.push({
name: `${row.table}`,
value: `**Size:** ${row.size} MB
@@ -39,6 +45,6 @@ export const auditDB = async (message: DiscordenoMessage) => {
],
}).catch((e: Error) => utils.commonLoggers.messageEditError('auditDB.ts:43', message, e));
} catch (e) {
utils.commonLoggers.messageSendError('auditDB.ts:45', message, e);
utils.commonLoggers.messageSendError('auditDB.ts:45', message, e as Error);
}
};

View File

@@ -9,7 +9,7 @@ import { failColor, infoColor2 } from '../commandUtils.ts';
import utils from '../utils.ts';
import intervals from '../intervals.ts';
export const heatmap = async (message: DiscordenoMessage) => {
export const heatmap = (message: DiscordenoMessage) => {
// Light telemetry to see how many times a command is being run
dbClient.execute(queries.callIncCnt('heatmap')).catch((e) => utils.commonLoggers.dbError('heatmap.ts:14', 'call sproc INC_CNT on', e));

View File

@@ -31,7 +31,7 @@ export const optIn = async (message: DiscordenoMessage) => {
],
})
.catch((e: Error) => utils.commonLoggers.messageSendError('optIn.ts:27', message, e));
} catch (err) {
} catch (_e) {
message
.reply({
embeds: [

View File

@@ -29,7 +29,7 @@ export const optOut = async (message: DiscordenoMessage) => {
],
})
.catch((e: Error) => utils.commonLoggers.messageSendError('optOut.ts:25', message, e));
} catch (err) {
} catch (_e) {
message
.reply({
embeds: [

View File

@@ -16,6 +16,6 @@ export const ping = async (message: DiscordenoMessage) => {
const m = await message.send(generatePing(-1));
m.edit(generatePing(m.timestamp - message.timestamp));
} catch (e) {
utils.commonLoggers.messageSendError('ping.ts:23', message, e);
utils.commonLoggers.messageSendError('ping.ts:23', message, e as Error);
}
};

View File

@@ -44,6 +44,6 @@ export const stats = async (message: DiscordenoMessage) => {
),
).catch((e: Error) => utils.commonLoggers.messageEditError('stats.ts:38', m, e));
} catch (e) {
utils.commonLoggers.messageSendError('stats.ts:41', message, e);
utils.commonLoggers.messageSendError('stats.ts:41', message, e as Error);
}
};