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:
@ -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()
|
||||
|
@ -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()
|
||||
|
Reference in New Issue
Block a user