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='' 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_api = 'http://127.0.0.1/api_jsonrpc.php'
zabbix_user = 'api' zabbix_user = 'api'
zabbix_pass = 'pass' 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: except Exception as e:
bot.reply_to(message,e ) bot.reply_to(message,e )
#while True: try:
# try: pid = str(os.getpid())
# bot.polling(none_stop=True, interval=0, timeout=10) pidfile = open(config.pid, 'w')
# except Exception as e: pidfile.write(pid)
# print(e) pidfile.close()
# time.sleep(15) bot.polling(none_stop=True, interval=0, timeout=10)
bot.polling(none_stop=True, interval=0, timeout=10) except:
pass