summary refs log tree commit diff
path: root/src/api/util
diff options
context:
space:
mode:
authorMathMan05 <mathmanrm@gmail.com>2025-12-01 16:51:02 -0600
committerRory& <root@rory.gay>2026-01-28 21:46:45 +0100
commitcc15a5d219ee78ce6de918252a80423591c74058 (patch)
tree0c059cd156f35d182ade7e13cc015499493556da /src/api/util
parentthread API start (diff)
downloadserver-ts-cc15a5d219ee78ce6de918252a80423591c74058.tar.xz
initial recipients work
Diffstat (limited to 'src/api/util')
-rw-r--r--src/api/util/handlers/Message.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/api/util/handlers/Message.ts b/src/api/util/handlers/Message.ts

index 5d1b9fed..c81de300 100644 --- a/src/api/util/handlers/Message.ts +++ b/src/api/util/handlers/Message.ts
@@ -106,6 +106,15 @@ export async function handleMessage(opts: MessageOptions): Promise<Message> { components: opts.components ?? undefined, // Fix Discord-Go? }); const ephermal = (message.flags & (1 << 6)) !== 0; + if (!ephermal && channel.type === ChannelType.GUILD_PUBLIC_THREAD) { + const rep = Channel.getRepository(); + console.log(channel.id); + await rep.increment({ id: channel.id }, "message_count", 1); + await rep.increment({ id: channel.id }, "total_message_sent", 1); + } + if (!ephermal) { + channel.last_message_id = message.id; + } if (cloudAttachments && cloudAttachments.length > 0) { console.log("[Message] Processing attachments for message", message.id, ":", message.attachments);