generated from nhcarrigan/template
Compare commits
1 Commits
7997c9f59d
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 2fa1fa1801 |
@@ -1,40 +0,0 @@
|
|||||||
name: CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
ci:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Check dependency pinning
|
|
||||||
uses: naomi-lgbt/dependency-pin-check@main
|
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: 9
|
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: "20"
|
|
||||||
cache: "pnpm"
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Run linter
|
|
||||||
run: pnpm lint
|
|
||||||
|
|
||||||
- name: Build project
|
|
||||||
run: pnpm build
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: pnpm test
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
node_modules
|
|
||||||
prod
|
|
||||||
@@ -1,6 +1,16 @@
|
|||||||
# Rondelle
|
# New Repository Template
|
||||||
|
|
||||||
A Discord bot to facilitate coffee chats or breakouts.
|
This template contains all of our basic files for a new GitHub repository. There is also a handy workflow that will create an issue on a new repository made from this template, with a checklist for the steps we usually take in setting up a new repository.
|
||||||
|
|
||||||
|
If you're starting a Node.JS project with TypeScript, we have a [specific template](https://github.com/naomi-lgbt/nodejs-typescript-template) for that purpose.
|
||||||
|
|
||||||
|
## Readme
|
||||||
|
|
||||||
|
Delete all of the above text (including this line), and uncomment the below text to use our standard readme template.
|
||||||
|
|
||||||
|
<!-- # Project Name
|
||||||
|
|
||||||
|
Project Description
|
||||||
|
|
||||||
## Live Version
|
## Live Version
|
||||||
|
|
||||||
@@ -8,7 +18,7 @@ This page is currently deployed. [View the live website.]
|
|||||||
|
|
||||||
## Feedback and Bugs
|
## Feedback and Bugs
|
||||||
|
|
||||||
If you have feedback or a bug report, please feel free to open a GitHub issue!
|
If you have feedback or a bug report, please [log a ticket on our forum](https://support.nhcarrigan.com).
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
@@ -26,4 +36,4 @@ Copyright held by Naomi Carrigan.
|
|||||||
|
|
||||||
## Contact
|
## Contact
|
||||||
|
|
||||||
We may be contacted through our [Chat Server](http://chat.nhcarrigan.com) or via email at `contact@nhcarrigan.com`.
|
We may be contacted through our [Chat Server](http://chat.nhcarrigan.com) or via email at `contact@nhcarrigan.com`. -->
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
import NaomisConfig from "@nhcarrigan/eslint-config";
|
|
||||||
|
|
||||||
export default [
|
|
||||||
...NaomisConfig,
|
|
||||||
];
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "rondelle",
|
|
||||||
"pnpm": {
|
|
||||||
"onlyBuiltDependencies": [
|
|
||||||
"@prisma/engines",
|
|
||||||
"esbuild",
|
|
||||||
"prisma"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"version": "0.0.0",
|
|
||||||
"description": "",
|
|
||||||
"main": "./prod/index.js",
|
|
||||||
"scripts": {
|
|
||||||
"build": "tsc",
|
|
||||||
"start": "op run --env-file=prod.env -- node prod/index.js",
|
|
||||||
"lint": "eslint src --max-warnings 0",
|
|
||||||
"test": "echo \"No tests yet\" && exit 0"
|
|
||||||
},
|
|
||||||
"keywords": [],
|
|
||||||
"author": "Naomi Carrigan <contact@nhcarrigan.com>",
|
|
||||||
"license": "See LICENSE.md",
|
|
||||||
"type": "module",
|
|
||||||
"devDependencies": {
|
|
||||||
"@nhcarrigan/eslint-config": "5.2.0",
|
|
||||||
"@nhcarrigan/typescript-config": "4.0.0",
|
|
||||||
"@types/node": "22.10.6",
|
|
||||||
"prisma": "6.8.2",
|
|
||||||
"typescript": "5.7.3"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@nhcarrigan/logger": "1.1.1",
|
|
||||||
"@prisma/client": "6.8.2",
|
|
||||||
"discord.js": "14.25.1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Generated
-4397
File diff suppressed because it is too large
Load Diff
@@ -1,35 +0,0 @@
|
|||||||
generator client {
|
|
||||||
provider = "prisma-client-js"
|
|
||||||
}
|
|
||||||
|
|
||||||
datasource db {
|
|
||||||
provider = "mongodb"
|
|
||||||
url = env("MONGO_URI")
|
|
||||||
}
|
|
||||||
|
|
||||||
model ServerEvent {
|
|
||||||
id String @id @default(auto()) @map("_id") @db.ObjectId
|
|
||||||
serverId String
|
|
||||||
eventId String
|
|
||||||
eventName String
|
|
||||||
createdAt DateTime @default(now())
|
|
||||||
createdBy String
|
|
||||||
|
|
||||||
@@unique([serverId, eventId])
|
|
||||||
@@index([serverId])
|
|
||||||
}
|
|
||||||
|
|
||||||
model UserPairingHistory {
|
|
||||||
id String @id @default(auto()) @map("_id") @db.ObjectId
|
|
||||||
userId String
|
|
||||||
serverId String
|
|
||||||
pairings PairingRecord[]
|
|
||||||
|
|
||||||
@@unique([userId, serverId])
|
|
||||||
}
|
|
||||||
|
|
||||||
type PairingRecord {
|
|
||||||
recipientId String
|
|
||||||
eventId String
|
|
||||||
sessionDate DateTime
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# 1Password vault references - safe to commit
|
|
||||||
# Run with: op run --env-file=prod.env -- <command>
|
|
||||||
|
|
||||||
# Example environment variables
|
|
||||||
DATABASE_URL=op://Development/rondelle-database/connection-string
|
|
||||||
API_KEY=op://Development/rondelle-api/api-key
|
|
||||||
SECRET_TOKEN=op://Development/rondelle-secrets/token
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
/**
|
|
||||||
* @copyright 2026
|
|
||||||
* @license Naomi's Public License
|
|
||||||
* @author Naomi Carrigan
|
|
||||||
*/
|
|
||||||
import { Client, GatewayIntentBits } from "discord.js";
|
|
||||||
import { instantiatePrisma } from "./utils/database.js";
|
|
||||||
import { logger } from "./utils/logger.js";
|
|
||||||
import type { Rondelle } from "./interfaces/rondelle.js";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Starts the Discord bot and connects to the database.
|
|
||||||
*/
|
|
||||||
const startBot = async(): Promise<void> => {
|
|
||||||
const rondelle: Rondelle = {
|
|
||||||
database: await instantiatePrisma(),
|
|
||||||
discord: new Client({
|
|
||||||
intents: [ GatewayIntentBits.Guilds, GatewayIntentBits.GuildVoiceStates ],
|
|
||||||
}),
|
|
||||||
};
|
|
||||||
|
|
||||||
rondelle.discord.once("ready", () => {
|
|
||||||
void logger.log("info", `Logged in as ${rondelle.discord.user?.tag ?? "unknown"}`);
|
|
||||||
});
|
|
||||||
|
|
||||||
await rondelle.discord.login(process.env.DISCORD_TOKEN);
|
|
||||||
};
|
|
||||||
|
|
||||||
await startBot().catch(async(error: unknown) => {
|
|
||||||
const actualError = error instanceof Error
|
|
||||||
? error
|
|
||||||
: new Error(String(error));
|
|
||||||
await logger.error("startBot", actualError);
|
|
||||||
});
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
/**
|
|
||||||
* @copyright 2026
|
|
||||||
* @license Naomi's Public License
|
|
||||||
* @author Naomi Carrigan
|
|
||||||
*/
|
|
||||||
import type { PrismaClient } from "@prisma/client";
|
|
||||||
import type { Client } from "discord.js";
|
|
||||||
|
|
||||||
interface Rondelle {
|
|
||||||
database: PrismaClient;
|
|
||||||
discord: Client;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type { Rondelle };
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
/**
|
|
||||||
* @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 };
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
/**
|
|
||||||
* @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 };
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "@nhcarrigan/typescript-config",
|
|
||||||
"compilerOptions": {
|
|
||||||
"rootDir": "./src",
|
|
||||||
"outDir": "./prod",
|
|
||||||
},
|
|
||||||
"include": ["src/**/*"]
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user