Compare commits
	
		
			3 Commits
		
	
	
		
			echotron
			...
			e02e879378
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| e02e879378 | |||
| 49147208d1 | |||
| 90617d751d | 
@ -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
 | 
			
		||||
 | 
			
		||||
@ -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)
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user