effective way to keep alive

This commit is contained in:
2017-08-31 01:12:57 +08:00
parent c93b3c20b3
commit 4d18f729c6

6
bot.py
View File

@ -144,9 +144,13 @@ with open('users.json', 'r') as f:
MessageLoop(bot, on_chat).run_as_thread() MessageLoop(bot, on_chat).run_as_thread()
print("Started! Service is available.") print("Started! Service is available.")
count = 0
while True: while True:
time.sleep(1) time.sleep(1)
count += 1
if count == 5:
bot.getMe()
count = 0
# backup # backup
users_backup = {} users_backup = {}