From 776bd53cc1544108887378367746c7b365f4b4ec Mon Sep 17 00:00:00 2001 From: EgorKhabarov Date: Fri, 26 Apr 2024 16:14:10 +0400 Subject: [PATCH] Fixed a bug with hiding the token --- telebot/__init__.py | 2 ++ telebot/async_telebot.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/telebot/__init__.py b/telebot/__init__.py index 067d24d76..3da8952be 100644 --- a/telebot/__init__.py +++ b/telebot/__init__.py @@ -1034,6 +1034,8 @@ def __hide_token(self, message: str) -> str: if self.token in message: code = self.token.split(':')[1] return message.replace(code, "*" * len(code)) + else: + return message def infinity_polling(self, timeout: Optional[int]=20, skip_pending: Optional[bool]=False, long_polling_timeout: Optional[int]=20, logger_level: Optional[int]=logging.ERROR, allowed_updates: Optional[List[str]]=None, diff --git a/telebot/async_telebot.py b/telebot/async_telebot.py index 36b6d007b..fa4a0a7eb 100644 --- a/telebot/async_telebot.py +++ b/telebot/async_telebot.py @@ -391,6 +391,8 @@ def __hide_token(self, message: str) -> str: if self.token in message: code = self.token.split(':')[1] return message.replace(code, "*" * len(code)) + else: + return message async def _process_polling(self, non_stop: bool=False, interval: int=0, timeout: int=20, request_timeout: int=None, allowed_updates: Optional[List[str]]=None):