forked from lug/matterbridge
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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user