Compare commits

..

5 Commits

2 changed files with 4 additions and 3 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
@ -99,7 +99,7 @@ func checkCaptcha(b *bot, update *tb.Update) error {
solved = true
b.DeleteMessage(message.Chat.ID, message.ID)
b.DeleteMessage(message.Chat.ID, user.CaptchaMessage)
msg := fmt.Sprintf("Приветствую тебя, *[%s](tg://user?id=%d)* успешно прошёл капчу\\!", EscapeText(tb.MarkdownV2, user.FirstName), user.Id)
msg := fmt.Sprintf("*[%s](tg://user?id=%d)* только что успешно прошёл капчу\\!", EscapeText(tb.MarkdownV2, user.FirstName), user.Id)
options := tb.MessageOptions{
ParseMode: tb.MarkdownV2,
}

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)