From 51d3fbd697e6a1972a7872daf54d187a140ad46c Mon Sep 17 00:00:00 2001 From: Thom Dickson Date: Thu, 5 Jan 2023 01:48:30 -0500 Subject: [PATCH] feat: return topic/thread id with /chatId cmd --- bridge/telegram/handlers.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bridge/telegram/handlers.go b/bridge/telegram/handlers.go index 8e674e23..310967bb 100644 --- a/bridge/telegram/handlers.go +++ b/bridge/telegram/handlers.go @@ -20,6 +20,11 @@ func (b *Btelegram) handleUpdate(rmsg *config.Message, message, posted, edited * if posted.Text == "/chatId" { chatID := strconv.FormatInt(posted.Chat.ID, 10) + // Handle chat topics + if posted.IsTopicMessage { + chatID = chatID + "/" + strconv.Itoa(posted.MessageThreadID) + } + _, err := b.Send(config.Message{ Channel: chatID, Text: fmt.Sprintf("ID of this chat: %s", chatID),