From eed331b1b15858af9a0f37f5a8113257c434ffba Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sun, 21 Mar 2021 22:10:33 +0100 Subject: [PATCH] Do not copy empty messages --- pyrogram/types/messages_and_media/message.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyrogram/types/messages_and_media/message.py b/pyrogram/types/messages_and_media/message.py index f1cce01d..6f31ec74 100644 --- a/pyrogram/types/messages_and_media/message.py +++ b/pyrogram/types/messages_and_media/message.py @@ -2902,6 +2902,9 @@ class Message(Object, Update): elif self.game and not await self._client.storage.is_bot(): log.warning(f"Users cannot send messages with Game media type. " f"chat_id: {self.chat.id}, message_id: {self.message_id}") + elif self.empty: + log.warning(f"Empty messages cannot be copied. " + f"chat_id: {self.chat.id}, message_id: {self.message_id}") elif self.text: return await self._client.send_message( chat_id,