generated from nhcarrigan/template
feat: set up Discord bot scaffolding
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 48s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 48s
- Add Rondelle interface with discord client and database - Add logger utility using @nhcarrigan/logger - Add database utility for Prisma client instantiation - Update index.ts with bot startup logic - Update .gitignore to exclude prod/ build output
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* @copyright 2026
|
||||
* @license Naomi's Public License
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
import { PrismaClient } from "@prisma/client";
|
||||
import { logger } from "./logger.js";
|
||||
|
||||
/**
|
||||
* Creates and connects a Prisma client instance.
|
||||
* @returns The connected Prisma client.
|
||||
*/
|
||||
const instantiatePrisma = async(): Promise<PrismaClient> => {
|
||||
const client = new PrismaClient();
|
||||
await client.$connect();
|
||||
await logger.log("info", "Connected to database.");
|
||||
return client;
|
||||
};
|
||||
|
||||
export { instantiatePrisma };
|
||||
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @copyright 2026
|
||||
* @license Naomi's Public License
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
import { Logger } from "@nhcarrigan/logger";
|
||||
|
||||
const logger = new Logger(
|
||||
"rondelle",
|
||||
process.env.LOG_TOKEN ?? "",
|
||||
);
|
||||
|
||||
export { logger };
|
||||
Reference in New Issue
Block a user