diff --git a/api/src/routes/channels/#channel_id/messages/index.ts b/api/src/routes/channels/#channel_id/messages/index.ts
index 1a3150cf..ad590d05 100644
--- a/api/src/routes/channels/#channel_id/messages/index.ts
+++ b/api/src/routes/channels/#channel_id/messages/index.ts
@@ -17,11 +17,15 @@ export function isTextChannel(type: ChannelType): boolean {
switch (type) {
case ChannelType.GUILD_STORE:
case ChannelType.GUILD_VOICE:
+ case ChannelType.GUILD_STAGE_VOICE:
case ChannelType.GUILD_CATEGORY:
throw new HTTPError("not a text channel", 400);
case ChannelType.DM:
case ChannelType.GROUP_DM:
case ChannelType.GUILD_NEWS:
+ case ChannelType.GUILD_NEWS_THREAD:
+ case ChannelType.GUILD_PUBLIC_THREAD:
+ case ChannelType.GUILD_PRIVATE_THREAD:
case ChannelType.GUILD_TEXT:
return true;
}
diff --git a/api/src/routes/guilds/#guild_id/voice-states/#user_id/index.ts b/api/src/routes/guilds/#guild_id/voice-states/#user_id/index.ts
new file mode 100644
index 00000000..02951f81
--- /dev/null
+++ b/api/src/routes/guilds/#guild_id/voice-states/#user_id/index.ts
@@ -0,0 +1,15 @@
+import { check } from "../../../../../util/instanceOf";
+import { VoiceStateUpdateSchema } from "../../../../../schema";
+import { Request, Response, Router } from "express";
+import { updateVoiceState } from "../../../../../util/VoiceState";
+
+const router = Router();
+
+router.patch("/", check(VoiceStateUpdateSchema), async (req: Request, res: Response) => {
+ const body = req.body as VoiceStateUpdateSchema;
+ const { guild_id, user_id } = req.params;
+ await updateVoiceState(body, guild_id, req.user_id, user_id)
+ return res.sendStatus(204);
+});
+
+export default router;
\ No newline at end of file
diff --git a/api/src/routes/guilds/#guild_id/voice-states/@me/index.ts b/api/src/routes/guilds/#guild_id/voice-states/@me/index.ts
new file mode 100644
index 00000000..42ba543e
--- /dev/null
+++ b/api/src/routes/guilds/#guild_id/voice-states/@me/index.ts
@@ -0,0 +1,15 @@
+import { check } from "../../../../../util/instanceOf";
+import { VoiceStateUpdateSchema } from "../../../../../schema";
+import { Request, Response, Router } from "express";
+import { updateVoiceState } from "../../../../../util/VoiceState";
+
+const router = Router();
+
+router.patch("/", check(VoiceStateUpdateSchema), async (req: Request, res: Response) => {
+ const body = req.body as VoiceStateUpdateSchema;
+ const { guild_id } = req.params;
+ await updateVoiceState(body, guild_id, req.user_id)
+ return res.sendStatus(204);
+});
+
+export default router;
\ No newline at end of file
|