proxy optionally

This commit is contained in:
3err0 2019-06-24 11:20:08 +08:00
parent 0f100b15ab
commit 572afd89b4
2 changed files with 4 additions and 2 deletions

View File

@ -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'

View File

@ -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)