summary refs log tree commit diff
path: root/api/src/routes
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-17 01:53:29 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-17 01:53:29 +0200
commit41e49be9b390f1aa107eb5c03fed8ebac5df0c73 (patch)
treea897f8210105e975911491343cbe10ecde11ff7b /api/src/routes
parent:bug: fix typo in custom status (diff)
downloadserver-41e49be9b390f1aa107eb5c03fed8ebac5df0c73.tar.xz
:bug: fix typing
Diffstat (limited to 'api/src/routes')
-rw-r--r--api/src/routes/channels/#channel_id/typing.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/api/src/routes/channels/#channel_id/typing.ts b/api/src/routes/channels/#channel_id/typing.ts
index 45ed76db..56652368 100644
--- a/api/src/routes/channels/#channel_id/typing.ts
+++ b/api/src/routes/channels/#channel_id/typing.ts
@@ -9,14 +9,13 @@ router.post("/", route({ permission: "SEND_MESSAGES" }), async (req: Request, re
 	const user_id = req.user_id;
 	const timestamp = Date.now();
 	const channel = await Channel.findOneOrFail({ id: channel_id });
-	const member = await Member.findOneOrFail({ where: { id: user_id }, relations: ["roles", "user"] });
+	const member = await Member.findOne({ where: { id: user_id, guild_id: channel.guild_id }, relations: ["roles", "user"] });
 
 	await emitEvent({
 		event: "TYPING_START",
 		channel_id: channel_id,
 		data: {
-			// this is the paylod
-			member: { ...member, roles: member.roles?.map((x) => x.id) },
+			...(member ? { member: { ...member, roles: member?.roles?.map((x) => x.id) } } : null),
 			channel_id,
 			timestamp,
 			user_id,