Compare commits

..

5 Commits

3 changed files with 13 additions and 9 deletions

View File

@ -10,7 +10,7 @@ services:
env_file: env_file:
- bot.env - bot.env
mongo: mongo:
image: mongo image: mongo:4
restart: always restart: always
env_file: env_file:
- mongo.env - mongo.env
@ -20,13 +20,13 @@ services:
- mongodata:/data/db - mongodata:/data/db
- mongoconfig:/data/configdb - mongoconfig:/data/configdb
mongo-express: # mongo-express:
image: mongo-express # image: mongo-express
restart: always # restart: always
ports: # ports:
- ${HOST}:8090:8081 # - ${HOST}:8090:8081
env_file: # env_file:
- mongo.env # - mongo.env
volumes: volumes:
mongodata: mongodata:

View File

@ -152,7 +152,7 @@ func checkCaptcha(b *bot, update *echotron.Update) error {
if err != nil { if err != nil {
log.Printf("Can't send welcome message: %s", err) log.Printf("Can't send welcome message: %s", err)
} }
go waitAndDelete(&b.API, res.Result, timeout*time.Second) go waitAndDelete(&b.API, res.Result, timeout)
// time.Sleep(time.Second * 10) // time.Sleep(time.Second * 10)
// _, err = b.DeleteMessage(message.Chat.ID, res.Result.ID) // _, err = b.DeleteMessage(message.Chat.ID, res.Result.ID)
if err != nil { if err != nil {

View File

@ -33,6 +33,10 @@ func TaskKickOldUsers(b *echotron.API) {
continue continue
} }
log.Printf("User %s was banned", user.FirstName) log.Printf("User %s was banned", user.FirstName)
_, err = b.DeleteMessage(user.ChatId, user.CaptchaMessage)
if err != nil {
log.Println("ERR: Captcha message not deleted: ", err)
}
store.DeleteByID(ctx, user.Id) store.DeleteByID(ctx, user.Id)
} }
} }