From 49147208d1a3905844fc79e31fa165b974e68653 Mon Sep 17 00:00:00 2001 From: nefrace Date: Mon, 12 Dec 2022 13:23:37 +0300 Subject: [PATCH] Changed logs --- kicker/handlers.go | 2 +- kicker/tasks.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kicker/handlers.go b/kicker/handlers.go index 0420258..688193d 100644 --- a/kicker/handlers.go +++ b/kicker/handlers.go @@ -17,7 +17,7 @@ func userJoined(b *bot, update *tb.Update) error { captcha := captchagen.GenCaptcha() bytes, err := captcha.ToBytes() if err != nil { - fmt.Printf("Error creating captcha bytes: %v", bytes) + log.Printf("Error creating captcha bytes: %v", bytes) b.SendMessage("Не могу создать капчу, @nefrace, проверь логи.", update.Message.From.ID, &tb.MessageOptions{MessageThreadID: update.Message.ThreadID}) } message := update.Message diff --git a/kicker/tasks.go b/kicker/tasks.go index bd0c58e..305d6a2 100644 --- a/kicker/tasks.go +++ b/kicker/tasks.go @@ -18,7 +18,7 @@ type TaskBot struct { func TaskKickOldUsers(b *tb.API) { d := db.GetDatabase() - log.Print("STARTING KICKING TASK") +// log.Print("STARTING KICKING TASK") ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) defer cancel() now := time.Now().Unix() @@ -37,6 +37,7 @@ func TaskKickOldUsers(b *tb.API) { log.Println("User was not banned: ", err) continue } + log.Printf("User %s was banned", user.Id) b.DeleteMessage(user.ChatId, user.CaptchaMessage) b.DeleteMessage(user.ChatId, user.JoinedMessage) d.RemoveUser(ctx, user)