fixed parsemode varname

This commit is contained in:
humorhenker
2021-02-18 09:18:54 +01:00
parent 0ecef4285c
commit d6912b7007

View File

@@ -69,26 +69,26 @@ func (b *Btelegram) JoinChannel(channel config.ChannelInfo) error {
return nil return nil
} }
func TGGetParseMode(b *Btelegram, username string, text string) (textout string, ParseMode string) { func TGGetParseMode(b *Btelegram, username string, text string) (textout string, parsemode string) {
textout = username + text textout = username + text
if b.GetString("MessageFormat") == HTMLFormat { if b.GetString("MessageFormat") == HTMLFormat {
b.Log.Debug("Using mode HTML") b.Log.Debug("Using mode HTML")
ParseMode = tgbotapi.ModeHTML parsemode = tgbotapi.ModeHTML
} }
if b.GetString("MessageFormat") == "Markdown" { if b.GetString("MessageFormat") == "Markdown" {
b.Log.Debug("Using mode markdown") b.Log.Debug("Using mode markdown")
ParseMode = tgbotapi.ModeMarkdown parsemode = tgbotapi.ModeMarkdown
} }
if b.GetString("MessageFormat") == MarkdownV2 { if b.GetString("MessageFormat") == MarkdownV2 {
b.Log.Debug("Using mode MarkdownV2") b.Log.Debug("Using mode MarkdownV2")
ParseMode = MarkdownV2 parsemode = MarkdownV2
} }
if strings.ToLower(b.GetString("MessageFormat")) == HTMLNick { if strings.ToLower(b.GetString("MessageFormat")) == HTMLNick {
b.Log.Debug("Using mode HTML - nick only") b.Log.Debug("Using mode HTML - nick only")
textout = username + html.EscapeString(text) textout = username + html.EscapeString(text)
ParseMode = tgbotapi.ModeHTML parsemode = tgbotapi.ModeHTML
} }
return textout, ParseMode return textout, parsemode
} }
func (b *Btelegram) Send(msg config.Message) (string, error) { func (b *Btelegram) Send(msg config.Message) (string, error) {