summary refs log tree commit diff
diff options
context:
space:
mode:
authorIntevel ツ <59223342+Intevel@users.noreply.github.com>2021-04-24 10:28:25 +0200
committerIntevel ツ <59223342+Intevel@users.noreply.github.com>2021-04-24 10:28:25 +0200
commitf41f2cb251132ff5d2915cf98a4411f1fb0d2942 (patch)
tree076f475e9df54579274f72a81b4114a053f7fe3e
parentPOST /users/@me/channels (diff)
downloadserver-f41f2cb251132ff5d2915cf98a4411f1fb0d2942.tar.xz
Update channels.ts
-rw-r--r--src/routes/users/@me/channels.ts12
1 files changed, 1 insertions, 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();