Changed logs

This commit is contained in:
nefrace 2022-12-12 13:23:37 +03:00
parent 90617d751d
commit 49147208d1
2 changed files with 3 additions and 2 deletions

View File

@ -17,7 +17,7 @@ func userJoined(b *bot, update *tb.Update) error {
captcha := captchagen.GenCaptcha() captcha := captchagen.GenCaptcha()
bytes, err := captcha.ToBytes() bytes, err := captcha.ToBytes()
if err != nil { 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}) b.SendMessage("Не могу создать капчу, @nefrace, проверь логи.", update.Message.From.ID, &tb.MessageOptions{MessageThreadID: update.Message.ThreadID})
} }
message := update.Message message := update.Message

View File

@ -18,7 +18,7 @@ type TaskBot struct {
func TaskKickOldUsers(b *tb.API) { func TaskKickOldUsers(b *tb.API) {
d := db.GetDatabase() d := db.GetDatabase()
log.Print("STARTING KICKING TASK") // log.Print("STARTING KICKING TASK")
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
defer cancel() defer cancel()
now := time.Now().Unix() now := time.Now().Unix()
@ -37,6 +37,7 @@ func TaskKickOldUsers(b *tb.API) {
log.Println("User was not banned: ", err) log.Println("User was not banned: ", err)
continue continue
} }
log.Printf("User %s was banned", user.Id)
b.DeleteMessage(user.ChatId, user.CaptchaMessage) b.DeleteMessage(user.ChatId, user.CaptchaMessage)
b.DeleteMessage(user.ChatId, user.JoinedMessage) b.DeleteMessage(user.ChatId, user.JoinedMessage)
d.RemoveUser(ctx, user) d.RemoveUser(ctx, user)