Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,918 changes: 1,254 additions & 1,664 deletions package-lock.json

Large diffs are not rendered by default.

15 changes: 10 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,17 @@
"discord.js": "^14.25.1",
"dotenv": "^17.3.1",
"jiti": "^2.6.1",
"openai": "^4.0.0",
"openai": "^7.62.0",
"pino": "^10.1.0",
"prom-client": "^15.1.3",
"zod": "^3.25.76"
"zod": "^4.6.7"
},
"devDependencies": {
"@eslint/js": "^9.12.0",
"@types/better-sqlite3": "^7.6.13",
"@types/node": "^25.5.0",
"@typescript-eslint/eslint-plugin": "^8.73.0",
"@typescript-eslint/parser": "^8.73.0",
"@vitest/coverage-v8": "^4.0.16",
"eslint": "^9.12.0",
"eslint-config-prettier": "^10.1.8",
Expand All @@ -52,16 +54,19 @@
"pino-pretty": "^13.1.3",
"prettier": "^3.8.3",
"ts-node": "^10.9.2",
"typescript": "^5.9.3",
"typescript-eslint": "^8.59.0",
"typescript": "^6.0.3",
"typescript-eslint": "^8.73.0",
"vitest": "^4.0.16"
},
"overrides": {
"ajv": "^6.14.0",
"minimatch": "^3.1.3",
"@typescript-eslint/typescript-estree": {
"minimatch": "^9.0.6"
"minimatch": "^11.0.1"
},
"undici": "^6.23.0"
},
"allowScripts": {
"better-sqlite3@12.11.1": true
}
}
3 changes: 1 addition & 2 deletions src/commands/core/config/config.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ describe("config integration", () => {
});
await execute(mock);
const replyArg = (mock.reply as ReturnType<typeof vi.fn>).mock.calls[0]?.[0] as
| { content?: string }
| undefined;
{ content?: string } | undefined;
expect(replyArg?.content).toContain("Mod");
expect(replyArg?.content).toContain("/admin");
const rows = getDb()
Expand Down
3 changes: 1 addition & 2 deletions src/commands/core/info/handlers/userInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ export async function handleUserInfo(
): Promise<void> {
const targetUser = interaction.options.getUser("user") ?? interaction.user;
const member = interaction.guild?.members.cache.get(targetUser.id) as
| GuildMember
| undefined;
GuildMember | undefined;

const embed = new EmbedBuilder()
.setTitle(`${targetUser.username}`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@ export async function handleChallenge(
try {
const playerId = buttonInteraction.user.id;
const action = buttonInteraction.customId.split(":")[2] as
| "throw"
| "decline"
| "extend";
"throw" | "decline" | "extend";

if (action === "extend") {
if (playerId !== challenger.id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ export function getRandomWord(difficulty?: HangmanDifficulty): string | null {
"SELECT word FROM hangman_words WHERE difficulty = ? ORDER BY RANDOM() LIMIT 1",
);
const row = (difficulty == null ? stmt.get() : stmt.get(difficulty)) as
| { word: string }
| undefined;
{ word: string } | undefined;
return row?.word ?? null;
}

Expand Down
4 changes: 1 addition & 3 deletions src/commands/games/fun/subcommands/games-b/rps/challenge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ export async function handleChallenge(
}

const action = buttonInteraction.customId.split(":")[2] as
| Choice
| "decline"
| "extend";
Choice | "decline" | "extend";

if (action === "extend") {
if (playerId !== challenger.id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
// Trivia question data and selection logic.

export type TriviaCategory =
| "general"
| "science"
| "history"
| "geography"
| "entertainment"
| "sports";
"general" | "science" | "history" | "geography" | "entertainment" | "sports";

export type Difficulty = "easy" | "medium" | "hard";

Expand Down
3 changes: 1 addition & 2 deletions src/commands/games/giveaway/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ export async function handleEnd(interaction: ChatInputCommandInteraction): Promi

try {
const channel = interaction.guild?.channels.cache.get(giveaway.channel_id) as
| TextChannel
| undefined;
TextChannel | undefined;
if (channel && giveaway.message_id) {
const message = await channel.messages.fetch(giveaway.message_id);
const updatedGiveaway = getGiveaway(giveawayId)!;
Expand Down
3 changes: 1 addition & 2 deletions src/services/games/gameEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ export type GameState = {
};

export type MoveResult =
| { ok: true; winner?: string; draw?: boolean }
| { ok: false; error: string };
{ ok: true; winner?: string; draw?: boolean } | { ok: false; error: string };

/**
* Get public game state for API/Discord. Does not return internal-only fields.
Expand Down
6 changes: 1 addition & 5 deletions src/services/games/randomEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
// Configurable probability; events are rare by default.

export type RandomEventKind =
| "lucky_spin"
| "double_xp"
| "bonus_coins"
| "jackpot_boost"
| "none";
"lucky_spin" | "double_xp" | "bonus_coins" | "jackpot_boost" | "none";

export type RandomEventConfig = {
/** Probability 0–1 that any event triggers (before kind roll). Default 0.02 (2%). */
Expand Down
3 changes: 1 addition & 2 deletions src/services/games/sessionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ export function getSessionInternal(
COALESCE(status, 'active') AS status
FROM game_sessions WHERE game_id = ?`;
const row = db.prepare(sql).get(...(activeOnly ? [gameId, now] : [gameId])) as
| Record<string, unknown>
| undefined;
Record<string, unknown> | undefined;
return row ? (row as unknown as GameSession) : null;
}

Expand Down
6 changes: 1 addition & 5 deletions src/services/integrations/notion/notionTemplates.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { notionAddTemplatesConfig as rawTemplateConfig } from "../../../config/notionAddTemplates.js";

export type NotionTemplateFieldType =
| "rich_text"
| "select"
| "multi_select"
| "number"
| "checkbox";
"rich_text" | "select" | "multi_select" | "number" | "checkbox";

export type NotionAddTemplateField = {
id: string;
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"target": "ES2022",
"module": "ES2022",
"lib": ["ES2022"],
"moduleResolution": "node",
"moduleResolution": "bundler",
"rootDir": "./src",
"outDir": "./dist",
"esModuleInterop": true,
Expand Down
Loading