feat: Implement custom error classes, a Drizzle transaction utility, and update Discord.js ephemeral message flags.

This commit is contained in:
syntaxbullet
2025-12-15 22:14:17 +01:00
parent 3c81fd8396
commit 7e986fae5a
14 changed files with 112 additions and 114 deletions

15
src/lib/db.ts Normal file
View File

@@ -0,0 +1,15 @@
import { DrizzleClient } from "./DrizzleClient";
import type { Transaction } from "./types";
export const withTransaction = async <T>(
callback: (tx: Transaction) => Promise<T>,
tx?: Transaction
): Promise<T> => {
if (tx) {
return await callback(tx);
} else {
return await DrizzleClient.transaction(async (newTx) => {
return await callback(newTx);
});
}
};