From cf1d6593a6e31bdbb3ce29c9cbadf32494f6633d Mon Sep 17 00:00:00 2001 From: Joan Date: Tue, 4 Jul 2023 22:11:58 +0200 Subject: [PATCH] Actually adding account_checker --- wallamanta/account_checker.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 wallamanta/account_checker.py diff --git a/wallamanta/account_checker.py b/wallamanta/account_checker.py new file mode 100644 index 0000000..37d5d40 --- /dev/null +++ b/wallamanta/account_checker.py @@ -0,0 +1,14 @@ +import helpers +import walladb +import time + +def account_checker(sleep_time): + while True: + user_list = walladb.get_user_list() + for user in user_list: + if walladb.is_user_valid(user['telegram_user_id']): + if walladb.is_user_expired(user['telegram_user_id']): + message = "¡Hola!\n\nTu cuenta ha caducado. Si quieres seguir usando @wallamanta_bot ponte en contacto con @jocarduck\n\n¡Gracias!" + helpers.send_message(user['telegram_user_id'], message) + walladb.deactivate_user(user['telegram_user_id']) + time.sleep(sleep_time)