From 164433ddfdef939124dc4ee6e2d830d9a5aa91dc Mon Sep 17 00:00:00 2001 From: sergeyWh1te Date: Mon, 9 Sep 2024 16:38:22 +0300 Subject: [PATCH] feat: add telegram markdown support Signed-off-by: sergeyWh1te --- internal/pkg/notifiler/telegram.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/pkg/notifiler/telegram.go b/internal/pkg/notifiler/telegram.go index a0c7c8d..73508d1 100644 --- a/internal/pkg/notifiler/telegram.go +++ b/internal/pkg/notifiler/telegram.go @@ -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)