From 2be3c39689df8c947292a52a20d94f8b08c6c680 Mon Sep 17 00:00:00 2001 From: Soloam <11949987+soloam@users.noreply.github.com> Date: Tue, 7 Dec 2021 14:53:52 +0000 Subject: [PATCH] Add's comments to message in telegram messages This is a change to handle comments in telegram messages! Some messages in telegram have comments added to the message! This normally is the description in images or links. This changes appends the comment to the message if available. This should fix the issue in #1649 --- bridge/telegram/handlers.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bridge/telegram/handlers.go b/bridge/telegram/handlers.go index 84881f7f..df7e7180 100644 --- a/bridge/telegram/handlers.go +++ b/bridge/telegram/handlers.go @@ -162,6 +162,11 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) { // handle entities (adding URLs) b.handleEntities(&rmsg, message) + + // handle Comments + if rmsg.Comment != "" { + rmsg.Text = rmsg.Text + "\n" + rmsg.Comment + } if rmsg.Text != "" || len(rmsg.Extra) > 0 { rmsg.Text = helper.RemoveEmptyNewLines(rmsg.Text)