summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorMathMan05 <mathmanrm@gmail.com>2025-11-19 15:30:58 -0600
committerRory& <root@rory.gay>2025-11-23 00:57:31 +0100
commit0a662cb81cea97ff18d6c35b3b79269d5e492dd2 (patch)
tree016c06ae2fa3360f226d1f147f4c703c97203b33 /src/api
parentuse nonce? (diff)
downloadserver-ts-0a662cb81cea97ff18d6c35b3b79269d5e492dd2.tar.xz
work
Diffstat (limited to 'src/api')
-rw-r--r--src/api/util/handlers/Message.ts13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/api/util/handlers/Message.ts b/src/api/util/handlers/Message.ts

index 1c1c29d93..7f144a0c4 100644 --- a/src/api/util/handlers/Message.ts +++ b/src/api/util/handlers/Message.ts
@@ -91,6 +91,7 @@ export async function handleMessage(opts: MessageOptions): Promise<Message> { mentions: [], components: opts.components ?? undefined, // Fix Discord-Go? }); + const ephermal = (message.flags & (1 << 6)) !== 0; if (cloudAttachments && cloudAttachments.length > 0) { console.log("[Message] Processing attachments for message", message.id, ":", message.attachments); @@ -341,7 +342,17 @@ export async function handleMessage(opts: MessageOptions): Promise<Message> { }), ); } - if ((!!message.content?.match(EVERYONE_MENTION) && permission?.has("MENTION_EVERYONE")) || channel.type === ChannelType.DM || channel.type === ChannelType.GROUP_DM) { + if (ephermal) { + const id = message.interaction_metadata?.user_id; + if (id) { + let pinged = mention_everyone || channel.type === ChannelType.DM || channel.type === ChannelType.GROUP_DM; + if (!pinged) pinged = !!message.mentions.find((user) => user.id === id); + if (!pinged) pinged = !!(await Member.find({ where: { id, roles: Or(...message.mention_roles.map(({ id }) => Equal(id))) } })); + if (pinged) { + //stuff + } + } + } else if ((!!message.content?.match(EVERYONE_MENTION) && permission?.has("MENTION_EVERYONE")) || channel.type === ChannelType.DM || channel.type === ChannelType.GROUP_DM) { if (channel.type === ChannelType.DM || channel.type === ChannelType.GROUP_DM) { if (channel.recipients) { await fillInMissingIDs(channel.recipients.map(({ user_id }) => user_id));