From 76def36cd1ec1d0a874a883c81eb12821b48eba9 Mon Sep 17 00:00:00 2001 From: skeris Date: Fri, 16 Feb 2024 15:43:26 +0300 Subject: [PATCH] add logs --- internal/client/telegram.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/client/telegram.go b/internal/client/telegram.go index 39821cd..80b8a8a 100644 --- a/internal/client/telegram.go +++ b/internal/client/telegram.go @@ -35,6 +35,7 @@ func NewTelegram(deps Deps) *Telegram { } func (t *Telegram) SendVerification(data *models.Verification, url string, isUpdate bool) error { + fmt.Println("VERT", data, url,isUpdate) var tplPath string if isUpdate { tplPath = UpdatedVerification @@ -42,14 +43,17 @@ func (t *Telegram) SendVerification(data *models.Verification, url string, isUpd tplPath = NewVerification } + fmt.Println("VERT1", tplPath) var userURL string if url == t.stagingURL { userURL = fmt.Sprintf("%s/users/%s", t.stagingURL, data.UserID) } else { userURL = fmt.Sprintf("https://admin.pena/users/%s", data.UserID) } + fmt.Println("VERT2", userURL) tpl, err := template.New("verification_template").Parse(tplPath) + fmt.Println("VERT333", tpl,err) if err != nil { return fmt.Errorf("error parsing template: %w", err) } @@ -69,12 +73,14 @@ func (t *Telegram) SendVerification(data *models.Verification, url string, isUpd } err = tpl.Execute(&text, toTG) + fmt.Println("VERT433", err) if err != nil { return fmt.Errorf("error executing template: %w", err) } msg := tgbotapi.NewMessage(t.chatID, text.String()) + fmt.Println("VERT433", err, t.ChatID, test.String()) _, err = t.bot.Send(msg) if err != nil { return fmt.Errorf("error sending message: %w", err)