Fix MemoryError on get_input_media(game)

Because an integer was being passed where a TLObject was expected,
so the serialization with bytes() was actually requesting that many
bytes as opposed to properly converting the expected object.
This commit is contained in:
Lonami Exo
2020-01-04 17:52:31 +01:00
parent 364afd61e1
commit 582a61192a
4 changed files with 25 additions and 3 deletions

View File

@@ -483,7 +483,10 @@ def get_input_media(
file=media, mime_type=mime, attributes=attrs)
if isinstance(media, types.MessageMediaGame):
return types.InputMediaGame(id=media.game.id)
return types.InputMediaGame(id=types.InputGameID(
id=media.game.id,
access_hash=media.game.access_hash
))
if isinstance(media, types.MessageMediaContact):
return types.InputMediaContact(