This commit is contained in:
3err0 2019-06-24 07:08:40 +08:00
parent aa1a142a02
commit 2d82ddda07
2 changed files with 11 additions and 9 deletions

View File

@ -1,6 +1,7 @@
pid = '/var/run/bot.pid'
bot_token=''
proxy = 'socks5h://socks:pr0xy@109.234.36.187:1080'
proxy = 'socks5h://proxy.addr'
zabbix_api = 'http://127.0.0.1/api_jsonrpc.php'
zabbix_user = 'api'
zabbix_pass = 'pass'
users = ['1234', '5678']
users = [1234, 5678]

15
main.py
View File

@ -58,10 +58,11 @@ def handle_file(message):
except Exception as e:
bot.reply_to(message,e )
#while True:
# try:
# bot.polling(none_stop=True, interval=0, timeout=10)
# except Exception as e:
# print(e)
# time.sleep(15)
bot.polling(none_stop=True, interval=0, timeout=10)
try:
pid = str(os.getpid())
pidfile = open(config.pid, 'w')
pidfile.write(pid)
pidfile.close()
bot.polling(none_stop=True, interval=0, timeout=10)
except:
pass