diff --git a/davtelepot/__init__.py b/davtelepot/__init__.py index ce27688..353d272 100644 --- a/davtelepot/__init__.py +++ b/davtelepot/__init__.py @@ -11,7 +11,7 @@ __author__ = "Davide Testa" __email__ = "davide@davte.it" __credits__ = ["Marco Origlia", "Nick Lee @Nickoala"] __license__ = "GNU General Public License v3.0" -__version__ = "2.7.5" +__version__ = "2.7.6" __maintainer__ = "Davide Testa" __contact__ = "t.me/davte" diff --git a/davtelepot/bot.py b/davtelepot/bot.py index 8132444..281847b 100644 --- a/davtelepot/bot.py +++ b/davtelepot/bot.py @@ -1896,7 +1896,7 @@ class Bot(TelegramBot, ObjectWithDatabase, MultiLanguageObject): ) return sent_update - async def send_document(self, chat_id: Union[int, str], document=None, + async def send_document(self, chat_id: Union[int, str] = None, document=None, thumb=None, caption: str = None, parse_mode: str = None, @@ -1937,6 +1937,9 @@ class Bot(TelegramBot, ObjectWithDatabase, MultiLanguageObject): update = update['message'] if chat_id is None and 'chat' in update: chat_id = self.get_chat_id(update) + if chat_id is None: + logging.error("Attempt to send document without providing a chat_id") + return if reply_to_update and 'message_id' in update: reply_to_message_id = update['message_id'] if chat_id > 0: