mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-07-10 16:12:22 +03:00
Fix _get_response_message when integers are given #1151
This commit is contained in:
parent
2fb560624d
commit
9598e1877c
|
@ -131,9 +131,10 @@ class MessageParseMethods(UserMethods):
|
||||||
update.message._finish_init(self, entities, input_chat)
|
update.message._finish_init(self, entities, input_chat)
|
||||||
return update.message
|
return update.message
|
||||||
|
|
||||||
if not utils.is_list_like(request.random_id):
|
random_id = request if isinstance(request, int) else request.random_id
|
||||||
if request.random_id in random_to_id:
|
if not utils.is_list_like(random_id):
|
||||||
return id_to_message[random_to_id[request.random_id]]
|
if random_id in random_to_id:
|
||||||
|
return id_to_message[random_to_id[random_id]]
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
|
@ -144,6 +145,6 @@ class MessageParseMethods(UserMethods):
|
||||||
# `random_to_id[rnd]` would `KeyError`.
|
# `random_to_id[rnd]` would `KeyError`.
|
||||||
return [id_to_message[random_to_id[rnd]]
|
return [id_to_message[random_to_id[rnd]]
|
||||||
if rnd in random_to_id else None
|
if rnd in random_to_id else None
|
||||||
for rnd in request.random_id]
|
for rnd in random_id]
|
||||||
|
|
||||||
# endregion
|
# endregion
|
||||||
|
|
Loading…
Reference in New Issue
Block a user