Changed logs
This commit is contained in:
parent
90617d751d
commit
49147208d1
|
@ -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
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue