From c42ec074dfb2543356df68effd40c8d1767b622c Mon Sep 17 00:00:00 2001 From: czyt Date: Fri, 13 Feb 2026 16:04:36 +0800 Subject: [PATCH] Revert "fix telegram not response" This reverts commit 9edfe98ba1bd1c09d6d7a01eb71e80671e26a92c. --- pkg/channels/telegram.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/pkg/channels/telegram.go b/pkg/channels/telegram.go index f1e13bfd5..3ad4818c3 100644 --- a/pkg/channels/telegram.go +++ b/pkg/channels/telegram.go @@ -359,7 +359,7 @@ func (c *TelegramChannel) handleMessage(ctx context.Context, update telego.Updat "is_group": fmt.Sprintf("%t", message.Chat.Type != "private"), } - c.HandleMessage(senderID, fmt.Sprintf("%d", chatID), content, mediaPaths, metadata) + c.HandleMessage(fmt.Sprintf("%d", user.ID), fmt.Sprintf("%d", chatID), content, mediaPaths, metadata) } func (c *TelegramChannel) downloadPhoto(ctx context.Context, fileID string) string { @@ -470,11 +470,8 @@ func extractCodeBlocks(text string) codeBlockMatch { codes = append(codes, match[1]) } - idx := 0 text = re.ReplaceAllStringFunc(text, func(m string) string { - s := fmt.Sprintf("\x00CB%d\x00", idx) - idx++ - return s + return fmt.Sprintf("\x00CB%d\x00", len(codes)-1) }) return codeBlockMatch{text: text, codes: codes} @@ -494,11 +491,8 @@ func extractInlineCodes(text string) inlineCodeMatch { codes = append(codes, match[1]) } - idx := 0 text = re.ReplaceAllStringFunc(text, func(m string) string { - s := fmt.Sprintf("\x00IC%d\x00", idx) - idx++ - return s + return fmt.Sprintf("\x00IC%d\x00", len(codes)-1) }) return inlineCodeMatch{text: text, codes: codes}