Skip to content

Commit

Permalink
fixes: debug removed from uvicorn eternnoir#1767
Browse files Browse the repository at this point in the history
  • Loading branch information
batmanscode committed Oct 30, 2022
1 parent 2037616 commit 92ecfde
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
8 changes: 2 additions & 6 deletions telebot/__init__.py
Expand Up @@ -451,8 +451,7 @@ def run_webhooks(self,
drop_pending_updates: Optional[bool] = None,
timeout: Optional[int]=None,
secret_token: Optional[str]=None,
secret_token_length: Optional[int]=20,
debug: Optional[bool]=False):
secret_token_length: Optional[int]=20,):
"""
This class sets webhooks and listens to a given url and port.
Expand Down Expand Up @@ -501,9 +500,6 @@ def run_webhooks(self,
:param secret_token_length: Length of a secret token, defaults to 20
:type secret_token_length: :obj:`int`, optional
:param debug: set True if you want to set debugging on for webserver, defaults to False
:type debug: :obj:`bool`, optional
:raises ImportError: If necessary libraries were not installed.
"""

Expand Down Expand Up @@ -544,7 +540,7 @@ def run_webhooks(self,
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 = SyncWebhookListener(self, secret_token, listen, port, ssl_context, '/'+url_path)
self.webhook_listener.run_app()


Expand Down
6 changes: 0 additions & 6 deletions telebot/ext/aio/webhooks.py
Expand Up @@ -29,7 +29,6 @@ def __init__(self, bot,
port: Optional[int]=443,
ssl_context: Optional[tuple]=None,
url_path: Optional[str]=None,
debug: Optional[bool]=False
) -> None:
"""
Aynchronous implementation of webhook listener
Expand All @@ -55,9 +54,6 @@ def __init__(self, bot,
:param url_path: Webhook url path
:type url_path: str
:param debug: Debug mode
:type debug: bool
:raises ImportError: If FastAPI or uvicorn is not installed.
:raises ImportError: If Starlette version is too old.
Expand All @@ -72,7 +68,6 @@ def __init__(self, bot,
self._host = host
self._ssl_context = ssl_context
self._url_path = url_path
self._debug = debug
self._prepare_endpoint_urls()


Expand Down Expand Up @@ -119,7 +114,6 @@ async def run_app(self):
config = Config(app=self.app,
host=self._host,
port=self._port,
debug=self._debug,
ssl_certfile=self._ssl_context[0],
ssl_keyfile=self._ssl_context[1]
)
Expand Down
6 changes: 0 additions & 6 deletions telebot/ext/sync/webhooks.py
Expand Up @@ -25,7 +25,6 @@ def __init__(self, bot,
port: Optional[int]=443,
ssl_context: Optional[tuple]=None,
url_path: Optional[str]=None,
debug: Optional[bool]=False
) -> None:
"""
Synchronous implementation of webhook listener
Expand All @@ -51,9 +50,6 @@ def __init__(self, bot,
:param url_path: Webhook url path
:type url_path: str
:param debug: Debug mode
:type debug: bool
:raises ImportError: If FastAPI or uvicorn is not installed.
:raises ImportError: If Starlette version is too old.
Expand All @@ -68,7 +64,6 @@ def __init__(self, bot,
self._host = host
self._ssl_context = ssl_context
self._url_path = url_path
self._debug = debug
self._prepare_endpoint_urls()


Expand Down Expand Up @@ -115,7 +110,6 @@ def run_app(self):
uvicorn.run(app=self.app,
host=self._host,
port=self._port,
debug=self._debug,
ssl_certfile=self._ssl_context[0],
ssl_keyfile=self._ssl_context[1]
)

0 comments on commit 92ecfde

Please sign in to comment.