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

Divided async and sync versions into aio & sync folders

This commit is contained in:
_run
2022-07-09 22:30:36 +05:00
parent d67ee2a5c5
commit 90a90d4a34
10 changed files with 6 additions and 7 deletions

View File

@ -372,8 +372,8 @@ class TeleBot:
ssl_context = (certificate, certificate_key) if certificate else (None, None)
# webhooks module
try:
from telebot.extensions.synchronous import SyncWebhookListener
except NameError:
from telebot.ext.sync import SyncWebhookListener
except (NameError, ImportError):
raise ImportError("Please install uvicorn and fastapi in order to use `run_webhooks` method.")
self.webhook_listener = SyncWebhookListener(self, secret_token, listen, port, ssl_context, '/'+url_path, debug)
self.webhook_listener.run_app()

View File

@ -1515,8 +1515,8 @@ class AsyncTeleBot:
ssl_context = (certificate, certificate_key) if certificate else (None, None)
# for webhooks
try:
from telebot.extensions.asynchronous import AsyncWebhookListener
except NameError:
from telebot.ext.aio import AsyncWebhookListener
except (NameError, ImportError):
raise ImportError("Please install uvicorn and fastapi in order to use `run_webhooks` method.")
self.webhook_listener = AsyncWebhookListener(self, secret_token, listen, port, ssl_context, '/'+url_path, debug)
await self.webhook_listener.run_app()