Fix Typing event so that it returns undefined rather than null

Added clean data to message entity so it respects json tags.
This commit is contained in:
whinis authored and Rory& committed 2026-04-13 12:11:07 +02:00
1 parent f9147b78ca
commit 310d292e9a
4 files changed
+11 -22

No files matched your search

@@ -508,7 +508,7 @@ router.post(
channel_id: channel_id,
data: message.toJSON(),
} satisfies MessageCreateEvent),
message.guild_id ? Member.update({ id: req.user_id, guild_id: message.guild_id }, { last_message_id: message.id }) : null,
message.guild_id ? Member.update({ id: req.user_id, guild_id: message.guild_id }, { last_message_id: message.id }) : undefined,
]);
// no await as it shouldnt block the message send function and silently catch error
@@ -58,7 +58,7 @@ router.post(
channel_id,
timestamp,
user_id,
guild_id: channel.guild_id,
guild_id: channel.guild_id ?? undefined,
},
} satisfies TypingStartEvent);