add pretty console formatting

This commit is contained in:
2025-07-04 18:19:25 +02:00
parent c0fc8bccf2
commit 2fd30bd87e
13 changed files with 60 additions and 37 deletions

View File

@@ -4,6 +4,7 @@ import { getUserRecord } from "../db/dbUser";
import parseCommandArgs from "../lib/parseCommandArgs";
import { changeBalance } from "../lib/changeBalance";
import { User } from "../user";
import { logger } from "..";
export default new Command('donate', ['donate'], 'chatter', async (msg, user) => {
const args = parseCommandArgs(msg.messageText);
@@ -37,7 +38,7 @@ export default new Command('donate', ['donate'], 'chatter', async (msg, user) =>
} else {
// TODO: Rewrite this section
await sendMessage(`Failed to give ${target.displayName} ${amount} qbuck${(amount === 1 ? '' : 's')}`, msg.messageId);
console.error(`WARNING: Qweribucks donation failed: target success: ${data[0] !== false}, donator success: ${data[1] !== false}`);
logger.err(`WARNING: Qweribucks donation failed: target success: ${data[0] !== false}, donator success: ${data[1] !== false}`);
};
await Promise.all([

View File

@@ -1,4 +1,5 @@
import { Command, sendMessage } from ".";
import { logger } from "..";
import type { userRecord } from "../db/connection";
import { getUserRecord } from "../db/dbUser";
import items, { changeItemCount } from "../items";
@@ -41,7 +42,7 @@ export default new Command('give', ['give'], 'chatter', async (msg, user) => {
} else {
// TODO: Rewrite this section
await sendMessage(`Failed to give ${target.displayName} ${amount} ${item.prettyName + (amount === 1 ? '' : item.plural)}`, msg.messageId);
console.error(`WARNING: Item donation failed: target success: ${data[0] !== false}, donator success: ${data[1] !== false}`);
logger.warn(`WARNING: Item donation failed: target success: ${data[0] !== false}, donator success: ${data[1] !== false}`);
};
await user.clearLock();
await target.clearLock();