Preserve threading from telegram replies (telegram) (#1776)

* Preserve threading from telegram replies

* Add fallback for unthreaded telegram message

* Fix linter issue
This commit is contained in:
Alexander
2022-03-25 23:58:52 +03:00
committed by GitHub
parent cc36ebf1c9
commit 5d9604cd15
3 changed files with 28 additions and 4 deletions

View File

@@ -199,6 +199,11 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) {
rmsg.ID = strconv.Itoa(message.MessageID)
rmsg.Channel = strconv.FormatInt(message.Chat.ID, 10)
// preserve threading from telegram reply
if message.ReplyToMessage != nil {
rmsg.ParentID = strconv.Itoa(message.ReplyToMessage.MessageID)
}
// handle entities (adding URLs)
b.handleEntities(&rmsg, message)