Skip to content

Commit

Permalink
replace underscore with escaped underscore (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
bugrakocabay authored Jul 8, 2023
1 parent d514378 commit 0e2f527
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/providers/telegram/telegram.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package telegram

import (
"fmt"
"strings"

"github.com/containrrr/shoutrrr"
"github.com/pkg/errors"
Expand Down Expand Up @@ -48,6 +49,7 @@ func (p *Provider) Send(message, CliFormat string) error {
pr.TelegramParseMode = "None"
}
url := fmt.Sprintf("telegram://%s@telegram?channels=%s&parsemode=%s", pr.TelegramAPIKey, pr.TelegramChatID, pr.TelegramParseMode)
msg = strings.ReplaceAll(msg, "_", "\\_")
err := shoutrrr.Send(url, msg)
if err != nil {
err = errors.Wrap(err, fmt.Sprintf("failed to send telegram notification for id: %s ", pr.ID))
Expand Down

0 comments on commit 0e2f527

Please sign in to comment.