fix MarkdownV2 support in Telegram

This commit is contained in:
an.groshev
2020-07-02 09:07:42 +03:00
parent 2977a5957e
commit 0fb0dfb48b
2 changed files with 7 additions and 0 deletions

View File

@@ -322,6 +322,9 @@ func (b *Btelegram) handleEdit(msg *config.Message, chatid int64) (string, error
case "Markdown":
b.Log.Debug("Using mode markdown")
m.ParseMode = tgbotapi.ModeMarkdown
case "MarkdownV2":
b.Log.Debug("Using mode MarkdownV2")
m.ParseMode = "MarkdownV2"
}
if strings.ToLower(b.GetString("MessageFormat")) == HTMLNick {
b.Log.Debug("Using mode HTML - nick only")

View File

@@ -126,6 +126,10 @@ func (b *Btelegram) sendMessage(chatid int64, username, text string) (string, er
b.Log.Debug("Using mode markdown")
m.ParseMode = tgbotapi.ModeMarkdown
}
if b.GetString("MessageFormat") == "MarkdownV2" {
b.Log.Debug("Using mode MarkdownV2")
m.ParseMode = "MarkdownV2"
}
if strings.ToLower(b.GetString("MessageFormat")) == HTMLNick {
b.Log.Debug("Using mode HTML - nick only")
m.Text = username + html.EscapeString(text)