From d80d4da50c54e77ce073c5700ec4b2ee3bf074bb Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 8 Aug 2026 15:45:06 +1200 Subject: [PATCH] fix: don't drop role_mentions when hydrating messages `hydrateInternal` resolves incoming payload keys using `keyMapping[key] ?? key` before invoking `functions[targetKey]`. Because `keyMapping` included entries for `mentions` and `replies` but missed `role_mentions`, the target key remained as its raw API string (`role_mentions`). Since no matching handler function existed under that name, it threw an error that was silently caught and logged as "Skipping key ... during hydration!". Because of this missing mapping, `roleMentionIds` was never populated during hydration and its extractor function went completely unused. Any code relying on it received `undefined`. Specifically, `Message.mentioned` checks `roleMentions?.some((role) => role.assigned)`, which meant it could never return true for role-based mentions. Adding `role_mentions` to the key mapping allows the existing extractor function to run as intended. Signed-off-by: Aki Signed-off-by: Aki --- src/hydration/message.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hydration/message.ts b/src/hydration/message.ts index a7fdbb33..b1ef8d4e 100644 --- a/src/hydration/message.ts +++ b/src/hydration/message.ts @@ -40,6 +40,7 @@ export const messageHydration: Hydrate, HydratedMessage> = { system: "systemMessage", edited: "editedAt", mentions: "mentionIds", + role_mentions: "roleMentionIds", replies: "replyIds", }, functions: {