2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-29 05:18:10 +00:00

Update utils to accommodate changes on get_messages

This commit is contained in:
Dan 2018-10-28 17:24:05 +01:00
parent daee188fa5
commit 6cf6d49634

View File

@ -638,7 +638,8 @@ def parse_messages(
while True: while True:
try: try:
m.reply_to_message = client.get_messages( m.reply_to_message = client.get_messages(
m.chat.id, message.reply_to_msg_id, m.chat.id,
reply_to_message_ids=message.id,
replies=replies - 1 replies=replies - 1
) )
except FloodWait as e: except FloodWait as e:
@ -750,8 +751,8 @@ def parse_messages(
while True: while True:
try: try:
m.pinned_message = client.get_messages( m.pinned_message = client.get_messages(
m.chat.id, message.reply_to_msg_id, m.chat.id,
replies=0 message_ids=message.reply_to_msg_id
) )
except FloodWait as e: except FloodWait as e:
log.warning("get_messages flood: waiting {} seconds".format(e.x)) log.warning("get_messages flood: waiting {} seconds".format(e.x))
@ -948,7 +949,7 @@ def parse_chat_full(
if full_chat.pinned_msg_id: if full_chat.pinned_msg_id:
parsed_chat.pinned_message = client.get_messages( parsed_chat.pinned_message = client.get_messages(
parsed_chat.id, parsed_chat.id,
full_chat.pinned_msg_id message_ids=full_chat.pinned_msg_id
) )
if isinstance(full_chat.exported_invite, types.ChatInviteExported): if isinstance(full_chat.exported_invite, types.ChatInviteExported):