1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00
This commit is contained in:
_run 2022-07-18 14:01:14 +05:00
parent 147278733b
commit 49d3b463ed

View File

@ -1,5 +1,7 @@
import asyncio # for future uses
import ssl
import aiohttp
import certifi
from telebot import types
try:
@ -27,11 +29,13 @@ REQUEST_LIMIT = 50
class SessionManager:
def __init__(self) -> None:
self.session = None
self.ssl_context = ssl.create_default_context(cafile=certifi.where())
async def create_session(self):
self.session = aiohttp.ClientSession(connector=aiohttp.TCPConnector(
limit=REQUEST_LIMIT
limit=REQUEST_LIMIT,
ssl_context=self.ssl_context
))
return self.session