1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-11 05:02:37 +01:00

🐛 fix typing

This commit is contained in:
Flam3rboy 2021-10-17 01:53:29 +02:00
parent f41a0fe748
commit 41e49be9b3

View File

@ -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,