From a94fe558868c39282530284110b059bd02e67a2d Mon Sep 17 00:00:00 2001 From: Andrey Groshev Date: Sun, 12 Jul 2020 23:40:22 +0300 Subject: Fix MarkdownV2 support in Telegram (#1169) --- bridge/telegram/telegram.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bridge/telegram/telegram.go') diff --git a/bridge/telegram/telegram.go b/bridge/telegram/telegram.go index ac45985e..29f2f291 100644 --- a/bridge/telegram/telegram.go +++ b/bridge/telegram/telegram.go @@ -15,6 +15,7 @@ const ( unknownUser = "unknown" HTMLFormat = "HTML" HTMLNick = "htmlnick" + MarkdownV2 = "MarkdownV2" ) type Btelegram struct { @@ -126,6 +127,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) -- cgit v1.2.3