Skip to content

Commit

Permalink
feat: add telegram markdown support
Browse files Browse the repository at this point in the history
Signed-off-by: sergeyWh1te <[email protected]>
  • Loading branch information
sergeyWh1te committed Sep 9, 2024
1 parent 9d0c1d7 commit 164433d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/pkg/notifiler/telegram.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (u *telegram) SendAlert(ctx context.Context, alert *models.Alert) error {
}

func (u *telegram) send(ctx context.Context, message string) error {
requestURL := fmt.Sprintf("https://api.telegram.org/bot%s/sendMessage?chat_id=-%s&text=%s", u.botToken, u.chatID, url.QueryEscape(message))
requestURL := fmt.Sprintf("https://api.telegram.org/bot%s/sendMessage?chat_id=-%s&text=%s&parse_mode=markdown", u.botToken, u.chatID, url.QueryEscape(message))
req, err := http.NewRequestWithContext(ctx, http.MethodGet, requestURL, http.NoBody)
if err != nil {
return fmt.Errorf("could not create telegram request: %w", err)
Expand Down

0 comments on commit 164433d

Please sign in to comment.