Skip to content

Commit 932e7d1

Browse files
Merge pull request #139 from Pdzly/feature/starboard
2 parents b983ce2 + 59f76c0 commit 932e7d1

16 files changed

Lines changed: 813 additions & 83 deletions

File tree

.github/workflows/lint.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,11 @@ jobs:
182182
with:
183183
name: node-modules-${{ runner.os }}-${{ hashFiles('bun.lock') }}
184184
path: node_modules
185+
185186
- name: Run Unit Tests with coverage
186-
run: bun test:retry --coverage --coverage-reporter=lcov
187-
- name: Upload coverage report
187+
run: CLICOLOR=1 bun test:retry --coverage --coverage-reporter=lcov
188188

189+
- name: Upload coverage report
189190
uses: actions/upload-artifact@v4
190191
with:
191192
name: coverage-${{ runner.os }}-${{ github.run_id }}

bun.lock

Lines changed: 59 additions & 80 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,13 @@
3535
"@sequelize/core": "^7.0.0-alpha.46",
3636
"@sequelize/postgres": "^7.0.0-alpha.46",
3737
"@sequelize/sqlite3": "^7.0.0-alpha.46",
38+
"@types/fluent-ffmpeg": "^2.1.27",
3839
"bufferutil": "^4.0.9",
3940
"canvas": "3.2.0",
4041
"discord.js": "^14.21.0",
4142
"djs-slash-helper": "git+https://github.com/bristermitten/djs-slash-helper.git#97726a356be094f4d187637734b116e4e1c89be5",
4243
"expiry-map": "^2.0.0",
44+
"fluent-ffmpeg": "^2.1.3",
4345
"lru-cache": "^11.1.0",
4446
"mariadb": "^3.4.5",
4547
"node-fetch": "^3.3.2",

src/Config.prod.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ export const config: Config = {
1313
introductions: "888142541592076347",
1414
general: "821743100657270876",
1515
},
16+
starboard: {
17+
emojiId: "⭐",
18+
channel: "1407366658552631296",
19+
threshold: 1,
20+
},
1621
commands: {
1722
daily: "1059214166075912225",
1823
},

src/Config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ export const config: Config = {
1212
auditLog: "994623474557538415",
1313
general: "904478147351806015",
1414
},
15+
starboard: {
16+
emojiId: "⭐",
17+
channel: "1407366658552631296",
18+
threshold: 1,
19+
},
1520
commands: {
1621
daily: "1029850807794937949",
1722
},

src/config.type.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ export interface Config {
2020
introductions?: string;
2121
general: string;
2222
};
23+
starboard: {
24+
emojiId: string;
25+
channel: string;
26+
threshold: number;
27+
};
2328
suggest: {
2429
suggestionsChannel: string;
2530
archiveChannel: string;

src/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ import { initSentry } from "./sentry.js";
2424
import { logger } from "./logging.js";
2525
import { startHealthCheck } from "./healthcheck.js";
2626
import { ModerationModule } from "./modules/moderation/moderation.module.js";
27+
import { StarboardModule } from "./modules/starboard/starboard.module.js";
28+
import * as schedule from "node-schedule";
2729
import SuggestModule from "./modules/suggest/suggest.module.js";
2830

2931
const client = new Client({
@@ -59,6 +61,7 @@ export const moduleManager = new ModuleManager(
5961
XpModule,
6062
SuggestModule,
6163
ModerationModule,
64+
StarboardModule,
6265
],
6366
);
6467

@@ -91,6 +94,13 @@ async function main() {
9194
}
9295
}
9396

97+
// Clean up jobs on application shutdown
98+
process.on("SIGINT", function () {
99+
console.log("Gracefully shutting down scheduled jobs");
100+
schedule.gracefulShutdown();
101+
process.exit(0);
102+
});
103+
94104
try {
95105
startHealthCheck();
96106
await main();

0 commit comments

Comments
 (0)