Skip to content

Commit

Permalink
code(pkg/notifier/telegram) - use out http client
Browse files Browse the repository at this point in the history
  • Loading branch information
PxyUp committed Feb 9, 2024
1 parent 38c9192 commit 09daac1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/notifier/telegram.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"github.com/PxyUp/fitter/pkg/builder"
"github.com/PxyUp/fitter/pkg/config"
"github.com/PxyUp/fitter/pkg/http_client"
"github.com/PxyUp/fitter/pkg/logger"
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
)
Expand Down Expand Up @@ -64,6 +65,8 @@ func (t *telegramBot) sendMessage(msg string, record *singleRecord, input builde
if err != nil {
return err
}
botApi.Client = http_client.GetDefaultClient()

for _, id := range t.cfg.UsersId {
msgForSend := tgbotapi.NewMessage(id, msg)
_, errSend := botApi.Send(msgForSend)
Expand Down

0 comments on commit 09daac1

Please sign in to comment.