mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 04:35:24 +00:00
Fix message parsing in case of reply to story
This commit is contained in:
parent
4ccc71685a
commit
d516397089
@ -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)
|
||||||
|
|
||||||
|
@ -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
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user