2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-28 21:07:59 +00:00

Fix bad behaviours of get_messages

This commit is contained in:
Dan 2018-10-28 17:44:24 +01:00
parent 005c24e4bd
commit 229b8df9cd
2 changed files with 3 additions and 2 deletions

View File

@ -752,7 +752,8 @@ def parse_messages(
try:
m.pinned_message = client.get_messages(
m.chat.id,
message_ids=message.reply_to_msg_id
reply_to_message_ids=message.id,
replies=0
)
except FloodWait as e:
log.warning("get_messages flood: waiting {} seconds".format(e.x))

View File

@ -69,7 +69,7 @@ class GetMessages(BaseClient):
is_iterable = not isinstance(ids, int)
ids = list(ids) if is_iterable else [ids]
ids = [types.InputMessageID(i) for i in ids]
ids = [ids_type(i) for i in ids]
if isinstance(peer, types.InputPeerChannel):
rpc = functions.channels.GetMessages(channel=peer, id=ids)