chore: update dependencies and improve code formatting
- Added `vendor/discord-video-stream` to pnpm workspace. - Refactored `llmModerationClient.ts` for better readability and consistency. - Adjusted imports in `recordingsRoutes.ts` for clarity. - Updated `webserver.ts` to correctly import `createRecordingsRoutes`. - Enhanced test cases in `llmModerationClient.test.ts` for improved readability. - Updated submodule references for `better-sqlite3`, `discord-video-stream`, `discord.js-selfbot-v13`, `drizzle-orm`, and `node-datachannel`. - Created documentation for deprecated dependency removal plan and design.
This commit is contained in:
@@ -91,15 +91,16 @@ export function parseModerationResponse(
|
||||
message_id: msgId,
|
||||
status: (parsed as any).status || "clean",
|
||||
flags: (parsed as any).flags || [],
|
||||
score: (parsed as any).score !== undefined ? (parsed as any).score : 0.1,
|
||||
score:
|
||||
(parsed as any).score !== undefined ? (parsed as any).score : 0.1,
|
||||
analysis: (parsed as any).analysis || "",
|
||||
},
|
||||
],
|
||||
};
|
||||
} else {
|
||||
// Look for any array property (result, data, messages, moderation, etc.)
|
||||
const arrayKey = Object.keys(parsed).find(
|
||||
(key) => Array.isArray((parsed as any)[key]),
|
||||
const arrayKey = Object.keys(parsed).find((key) =>
|
||||
Array.isArray((parsed as any)[key]),
|
||||
);
|
||||
if (arrayKey) {
|
||||
parsed.results = (parsed as any)[arrayKey];
|
||||
@@ -537,7 +538,8 @@ Return ONLY valid JSON, no other text.`;
|
||||
try {
|
||||
parsed = parseModerationResponse(content, targetIds);
|
||||
} catch (parseError) {
|
||||
const errorMsg = parseError instanceof Error ? parseError.message : String(parseError);
|
||||
const errorMsg =
|
||||
parseError instanceof Error ? parseError.message : String(parseError);
|
||||
log.error(
|
||||
{
|
||||
error: errorMsg,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {
|
||||
Router,
|
||||
type NextFunction,
|
||||
type Request,
|
||||
type Response,
|
||||
type NextFunction,
|
||||
Router,
|
||||
} from "express";
|
||||
import { listVoiceRecordings } from "../database/voiceRecordingRepo";
|
||||
import { AppError } from "../errors";
|
||||
|
||||
+1
-1
@@ -25,10 +25,10 @@ import { discordPlayer } from "./player";
|
||||
import { createAnalysisRoutes } from "./routes/analysisRoutes";
|
||||
import { createMediaRoutes } from "./routes/mediaRoutes";
|
||||
import { createMessageRoutes } from "./routes/messageRoutes";
|
||||
import { createRecordingsRoutes } from "./routes/recordingsRoutes";
|
||||
import { createSyncRoutes } from "./routes/syncRoutes";
|
||||
import { createUIStateRoutes } from "./routes/uiStateRoutes";
|
||||
import { createVoiceRoutes } from "./routes/voiceRoutes";
|
||||
import { createRecordingsRoutes } from "./routes/recordingsRoutes";
|
||||
import { Streamer } from "./streaming";
|
||||
import type { VoiceController } from "./voiceController";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user