From f41f2cb251132ff5d2915cf98a4411f1fb0d2942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Intevel=20=E3=83=84?= <59223342+Intevel@users.noreply.github.com> Date: Sat, 24 Apr 2021 10:28:25 +0200 Subject: [PATCH] Update channels.ts --- src/routes/users/@me/channels.ts | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/routes/users/@me/channels.ts b/src/routes/users/@me/channels.ts index b5a53be7..45371b34 100644 --- a/src/routes/users/@me/channels.ts +++ b/src/routes/users/@me/channels.ts @@ -50,22 +50,12 @@ router.get("/", async (req: Request, res: Response) => { router.post("/", check(DmChannelCreateSchema), async (req, res) => { const body = req.body as DmChannelCreateSchema; - switch (body.type) { - case ChannelType.GUILD_CATEGORY: - case ChannelType.GUILD_TEXT: - case ChannelType.GUILD_VOICE: - throw new HTTPError("You can't create a dm channel in a guild"); - // TODO: - case ChannelType.GUILD_STORE: - throw new HTTPError("Not yet supported"); - case ChannelType.GUILD_NEWS: - // TODO: check if guild is community server - } const channel = { ...body, owner_id: req.user_id, id: Snowflake.generate(), + type: ChannelType.DM, created_at: new Date(), }; await new ChannelModel(channel).save();