2026-06-01 21:44:29 +07:00
|
|
|
import type { Router } from "express";
|
|
|
|
|
import express from "express";
|
2026-06-02 00:11:29 +07:00
|
|
|
import {
|
|
|
|
|
handleConnectVoice,
|
|
|
|
|
handleDisconnectVoice,
|
|
|
|
|
handleGetVoiceChannels,
|
|
|
|
|
handleGetVoiceStatus,
|
2026-06-08 22:55:11 +07:00
|
|
|
handleVoiceCommand,
|
2026-06-02 00:11:29 +07:00
|
|
|
} from "./voice.controller.js";
|
2026-06-01 21:44:29 +07:00
|
|
|
|
|
|
|
|
export function createVoiceRouter(): Router {
|
|
|
|
|
const router = express.Router();
|
|
|
|
|
|
2026-06-02 00:11:29 +07:00
|
|
|
// 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);
|
2026-06-01 21:44:29 +07:00
|
|
|
|
2026-06-08 22:55:11 +07:00
|
|
|
// POST /api/command — send arbitrary voice command (transmit start/stop)
|
|
|
|
|
router.post("/command", handleVoiceCommand);
|
|
|
|
|
|
2026-06-01 21:44:29 +07:00
|
|
|
return router;
|
|
|
|
|
}
|