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>
31 lines
809 B
TypeScript
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;
|
|
}
|