From 212f65db842293242710732bdd96518c95e304bf Mon Sep 17 00:00:00 2001 From: PinLin Date: Thu, 7 Sep 2017 02:09:42 +0800 Subject: [PATCH] update function backup and keep alive --- bot.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/bot.py b/bot.py index 71198b7..b37da63 100644 --- a/bot.py +++ b/bot.py @@ -138,14 +138,12 @@ with open('users.json', 'r') as f: MessageLoop(bot, on_chat).run_as_thread() print("Started! Service is available.") -count = 0 -while True: - time.sleep(1) - count += 1 - if count == 5: - bot.getMe() - count = 0 +while True: + time.sleep(60) + + # keep alive + bot.getMe() # backup users_backup = {} for key in users.keys():