1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-10-18 17:10:11 +00:00

Compare commits

..

3 Commits

Author SHA1 Message Date
478b40d0ff
Telegram: Escape exclamation marks, remove for images
![alt](link) becomes [alt](link), telegram seems to pick up that they're
images anyway.
2021-05-22 23:38:21 +01:00
8b816dc725
merge translations 2021-05-22 23:26:49 +01:00
81a58f628b
Add -H=windowsgui in goreleaser 2021-05-22 23:26:13 +01:00
2 changed files with 5 additions and 2 deletions

View File

@ -50,7 +50,7 @@ builds:
flags: flags:
- -tags=tray - -tags=tray
ldflags: ldflags:
- -s -w -X main.version={{.Env.JFA_GO_VERSION}} -X main.commit={{.ShortCommit}} -X main.updater=binary - -s -w -X main.version={{.Env.JFA_GO_VERSION}} -X main.commit={{.ShortCommit}} -X main.updater=binary -H=windowsgui
goos: goos:
- windows - windows
goarch: goarch:

View File

@ -148,7 +148,10 @@ func (t *TelegramDaemon) Send(message *Message, ID ...int64) error {
if message.Markdown == "" { if message.Markdown == "" {
msg = tg.NewMessage(id, message.Text) msg = tg.NewMessage(id, message.Text)
} else { } else {
msg = tg.NewMessage(id, strings.ReplaceAll(message.Markdown, ".", "\\.")) text := strings.ReplaceAll(message.Markdown, ".", "\\.")
text = strings.ReplaceAll(text, "![", "[")
text = strings.ReplaceAll(text, "!", "\\!")
msg = tg.NewMessage(id, text)
msg.ParseMode = "MarkdownV2" msg.ParseMode = "MarkdownV2"
} }
_, err := t.bot.Send(msg) _, err := t.bot.Send(msg)