Fix message parsing in case of reply to story

This commit is contained in:
KurimuzonAkuma 2024-02-18 18:15:35 +03:00
parent 4ccc71685a
commit d516397089
2 changed files with 6 additions and 3 deletions

View File

@ -16,6 +16,8 @@
# You should have received a copy of the GNU Lesser General Public License # You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>. # along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from typing import List
import pyrogram import pyrogram
from pyrogram import enums from pyrogram import enums
from pyrogram import raw, utils, types from pyrogram import raw, utils, types
@ -38,7 +40,7 @@ class RequestedChats(Object):
self, *, self, *,
client: "pyrogram.Client" = None, client: "pyrogram.Client" = None,
button_id: int, button_id: int,
chats: bool, chats: List["types.Chat"],
): ):
super().__init__(client) super().__init__(client)

View File

@ -1069,9 +1069,9 @@ class Message(Object, Update):
parsed_message.reply_to_message_id = message.reply_to.reply_to_msg_id parsed_message.reply_to_message_id = message.reply_to.reply_to_msg_id
parsed_message.reply_to_top_message_id = message.reply_to.reply_to_top_id parsed_message.reply_to_top_message_id = message.reply_to.reply_to_top_id
else: elif isinstance(message.reply_to, raw.types.MessageReplyStoryHeader):
parsed_message.reply_to_story_id = message.reply_to.story_id parsed_message.reply_to_story_id = message.reply_to.story_id
parsed_message.reply_to_story_user_id = message.reply_to.user_id parsed_message.reply_to_story_user_id = utils.get_peer_id(message.reply_to.peer)
if replies: if replies:
if parsed_message.reply_to_message_id: if parsed_message.reply_to_message_id:
@ -4429,3 +4429,4 @@ class Message(Object, Update):
chat_id=self.chat.id, chat_id=self.chat.id,
message_id=self.id message_id=self.id
) )