summaryrefslogtreecommitdiffstats
path: root/bridge/telegram/telegram.go
diff options
context:
space:
mode:
authorAndrey Groshev <greenx@yandex.ru>2020-07-12 23:40:22 +0300
committerGitHub <noreply@github.com>2020-07-12 22:40:22 +0200
commita94fe558868c39282530284110b059bd02e67a2d (patch)
treed64dcf11fa18e6fc3eff0c2dcaa08a5528e7bc0f /bridge/telegram/telegram.go
parent9b22f164970c1e01f4701db922aaddbe93999fb6 (diff)
downloadmatterbridge-msglm-a94fe558868c39282530284110b059bd02e67a2d.tar.gz
matterbridge-msglm-a94fe558868c39282530284110b059bd02e67a2d.tar.bz2
matterbridge-msglm-a94fe558868c39282530284110b059bd02e67a2d.zip
Fix MarkdownV2 support in Telegram (#1169)
Diffstat (limited to 'bridge/telegram/telegram.go')
-rw-r--r--bridge/telegram/telegram.go5
1 files changed, 5 insertions, 0 deletions
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)