Files
GMW/services/backend/src/modules/voice/voice.routes.ts
T
MythEclipseandClaude Opus 4.8 a4c2b93314 fix(voice): correct Express route for voice command
Route was POST /api/command (mounted at /api + /command)
Fixed to POST /api/voice/command (mounted at /api + /voice/command)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 00:13:00 +07:00

31 lines
809 B
TypeScript

import type { Router } from "express";
import express from "express";
import {
handleConnectVoice,
handleDisconnectVoice,
handleGetVoiceChannels,
handleGetVoiceStatus,
handleVoiceCommand,
} from "./voice.controller.js";
export function createVoiceRouter(): Router {
const router = express.Router();
// GET /api/status
router.get("/status", handleGetVoiceStatus);
// POST /api/connect
router.post("/connect", handleConnectVoice);
// POST /api/disconnect
router.post("/disconnect", handleDisconnectVoice);
// GET /api/guilds/:guildId/voice-channels
router.get("/guilds/:guildId/voice-channels", handleGetVoiceChannels);
// POST /api/voice/command — send arbitrary voice command (transmit start/stop)
router.post("/voice/command", handleVoiceCommand);
return router;
}