mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 18:04:59 +00:00
fix(telegram): make reaction handling soft-fail and message-id resilient (#20236)
* Telegram: soft-fail reactions and fallback to inbound message id * Telegram: soft-fail missing reaction message id * Update CHANGELOG.md --------- Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
This commit is contained in:
@@ -253,8 +253,22 @@ const DOCKS: Record<ChatChannelId, ChannelDock> = {
|
||||
},
|
||||
threading: {
|
||||
resolveReplyToMode: ({ cfg }) => cfg.channels?.telegram?.replyToMode ?? "off",
|
||||
buildToolContext: ({ context, hasRepliedRef }) =>
|
||||
buildThreadToolContextFromMessageThreadOrReply({ context, hasRepliedRef }),
|
||||
buildToolContext: ({ context, hasRepliedRef }) => {
|
||||
// Telegram auto-threading should only use actual thread/topic IDs.
|
||||
// ReplyToId is a message ID and causes invalid message_thread_id in DMs.
|
||||
const threadId = context.MessageThreadId;
|
||||
const rawCurrentMessageId = context.CurrentMessageId;
|
||||
const currentMessageId =
|
||||
typeof rawCurrentMessageId === "number"
|
||||
? rawCurrentMessageId
|
||||
: rawCurrentMessageId?.trim() || undefined;
|
||||
return {
|
||||
currentChannelId: context.To?.trim() || undefined,
|
||||
currentThreadTs: threadId != null ? String(threadId) : undefined,
|
||||
currentMessageId,
|
||||
hasRepliedRef,
|
||||
};
|
||||
},
|
||||
},
|
||||
},
|
||||
whatsapp: {
|
||||
|
||||
Reference in New Issue
Block a user