(b *Btelegram, username string, text string)
| 65 | } |
| 66 | |
| 67 | func TGGetParseMode(b *Btelegram, username string, text string) (textout string, parsemode string) { |
| 68 | textout = username + text |
| 69 | if b.GetString("MessageFormat") == HTMLFormat { |
| 70 | b.Log.Debug("Using mode HTML") |
| 71 | parsemode = tgbotapi.ModeHTML |
| 72 | } |
| 73 | if b.GetString("MessageFormat") == "Markdown" { |
| 74 | b.Log.Debug("Using mode markdown") |
| 75 | parsemode = tgbotapi.ModeMarkdown |
| 76 | } |
| 77 | if b.GetString("MessageFormat") == MarkdownV2 { |
| 78 | b.Log.Debug("Using mode MarkdownV2") |
| 79 | parsemode = MarkdownV2 |
| 80 | } |
| 81 | if strings.ToLower(b.GetString("MessageFormat")) == HTMLNick { |
| 82 | b.Log.Debug("Using mode HTML - nick only") |
| 83 | textout = username + html.EscapeString(text) |
| 84 | parsemode = tgbotapi.ModeHTML |
| 85 | } |
| 86 | return textout, parsemode |
| 87 | } |
| 88 | |
| 89 | func (b *Btelegram) Send(msg config.Message) (string, error) { |
| 90 | b.Log.Debugf("=> Receiving %#v", msg) |
no test coverage detected