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
This commit is contained in:
Soloam
2021-12-07 14:53:52 +00:00
committed by GitHub
parent 80d3033456
commit 2be3c39689

View File

@@ -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)