1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Merge pull request #808 from pikss86/master

Add possibility to create and use custom session, for examle - torpy
This commit is contained in:
Badiboy 2020-05-29 12:17:58 +03:00 committed by GitHub
commit 5facf7de92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,6 +20,7 @@ from telebot import util
logger = telebot.logger logger = telebot.logger
proxy = None proxy = None
session = None
API_URL = None API_URL = None
FILE_URL = None FILE_URL = None
@ -33,7 +34,7 @@ ENABLE_MIDDLEWARE = False
def _get_req_session(reset=False): def _get_req_session(reset=False):
return util.per_thread('req_session', lambda: requests.session(), reset) return util.per_thread('req_session', lambda: session if session else requests.session(), reset)
def _make_request(token, method_name, method='get', params=None, files=None): def _make_request(token, method_name, method='get', params=None, files=None):