Skip to content

Commit

Permalink
Merge pull request #59 from LucaBernstein/minor-fixes
Browse files Browse the repository at this point in the history
Minor fixes
  • Loading branch information
LucaBernstein authored Dec 10, 2021
2 parents 3c42414 + 67ad8b1 commit 77532d4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions bot/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,20 @@ func (bc *BotController) configHandleAbout(m *tb.Message, params ...string) {
if version == "" {
version = "not specified"
}
_, err := bc.Bot.Send(m.Sender, fmt.Sprintf(`Version information about [LucaBernstein/beancount\-bot\-tg](https://github.com/LucaBernstein/beancount\-bot\-tg)
_, err := bc.Bot.Send(m.Sender, escapeCharacters(fmt.Sprintf(`Version information about [LucaBernstein/beancount-bot-tg](https://github.com/LucaBernstein/beancount-bot-tg)
Version: [%s](%s)`,
version,
strings.ReplaceAll(versionLink, "-", "\\-"),
), tb.ModeMarkdownV2)
versionLink,
), ".", "-"), tb.ModeMarkdownV2)
if err != nil {
bc.Logf(ERROR, m, "Sending bot message failed: %s", err.Error())
}
}

func escapeCharacters(s string, c ...string) string {
for _, char := range c {
s = strings.ReplaceAll(s, char, "\\"+char)
}
return s
}
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
- POSTGRES_USER=$POSTGRES_USER
- POSTGRES_PASSWORD=$POSTGRES_PASSWORD
app:
image: ghcr.io/lucabernstein/beancount-bot-tg:main
image: ghcr.io/lucabernstein/beancount-bot-tg:release
container_name: bc_tg_bot
restart: unless-stopped
networks:
Expand Down

0 comments on commit 77532d4

Please sign in to comment.