From 572afd89b40f74be05ec932bfee4ef08a5abcd8f Mon Sep 17 00:00:00 2001 From: 3err0 Date: Mon, 24 Jun 2019 11:20:08 +0800 Subject: [PATCH] proxy optionally --- config.py | 3 ++- main.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config.py b/config.py index 1665423..f370ff0 100644 --- a/config.py +++ b/config.py @@ -1,6 +1,7 @@ pid = '/var/run/bot.pid' bot_token='' -proxy = 'socks5h://proxy.addr' +proxy = True +proxy_addr = 'socks5h://proxy.addr' zabbix_api = 'http://127.0.0.1/api_jsonrpc.php' zabbix_user = 'api' zabbix_pass = 'pass' diff --git a/main.py b/main.py index 62f5125..e633306 100644 --- a/main.py +++ b/main.py @@ -8,7 +8,8 @@ from telebot import apihelper, types from importer import Importer import os -apihelper.proxy = {'https': config.proxy} +if config.proxy: + apihelper.proxy = {'https': config.proxy_addr} bot = telebot.TeleBot(config.bot_token)