First attempt at introducing replies for media captions

Not entirely sure how to quote other non-text messages so I added an error message instead.
This commit is contained in:
Justin Leung
2018-09-04 21:02:56 +10:00
parent cc2bd03ec9
commit 3399e96959

View File

@@ -232,7 +232,13 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) {
usernameReply = "unknown"
}
if !b.GetBool("QuoteDisable") {
rmsg.Text = b.handleQuote(rmsg.Text, usernameReply, message.ReplyToMessage.Text)
if message.ReplyToMessage.Text != "" {
rmsg.Text = b.handleQuote(rmsg.Text, usernameReply, message.ReplyToMessage.Text)
} else if message.ReplyToMessage.Caption != "" {
rmsg.Text = b.handleQuote(rmsg.Text, usernameReply, message.ReplyToMessage.Caption)
} else {
rmsg.Text = b.handleQuote(rmsg.Text, usernameReply, "matterbridge: Unsupported message content")
}
}
}