Compare commits

...

4 Commits

2 changed files with 3 additions and 2 deletions

View File

@ -21,7 +21,7 @@ func userJoined(b *bot, update *tb.Update) error {
}
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

View File

@ -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)