diff --git a/common.py b/common.py index b03d889..92fa417 100644 --- a/common.py +++ b/common.py @@ -2,6 +2,13 @@ import logging import os import re +try: + import uvloop, asyncio + + asyncio.set_event_loop_policy(uvloop.EventLoopPolicy()) +except ImportError: + uvloop = None + BOT_TOKEN = os.getenv("BOT_TOKEN") ADMIN = [int(i) for i in os.getenv("BOT_ADMIN").split(",")] diff --git a/requirements.txt b/requirements.txt index 52d2bcd..5317463 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ python-telegram-bot[webhooks]~=21.3 -httpx[http2]~=0.27.0 \ No newline at end of file +httpx[http2]~=0.27.0 +uvloop~=0.19.0; sys_platform != 'win32' \ No newline at end of file