from ...tl.mtproto_request import MTProtoRequest


class MessageMediaGame(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    messageMediaGame#fdb19008 game:Game = MessageMedia"""

    # Telegram's constructor ID (and unique identifier) for this class
    constructor_id = 0xfdb19008

    def __init__(self, game):
        """
        :param game: Telegram type: «Game».

        Constructor for MessageMedia: Instance of either MessageMediaEmpty, MessageMediaPhoto, MessageMediaGeo, MessageMediaContact, MessageMediaUnsupported, MessageMediaDocument, MessageMediaWebPage, MessageMediaVenue, MessageMediaGame, MessageMediaInvoice.
        """
        super().__init__()

        self.game = game

    def on_send(self, writer):
        writer.write_int(MessageMediaGame.constructor_id, signed=False)
        self.game.on_send(writer)

    @staticmethod
    def empty():
        """Returns an "empty" instance (all attributes are None)"""
        return MessageMediaGame(None)

    def on_response(self, reader):
        self.game = reader.tgread_object()

    def __repr__(self):
        return 'messageMediaGame#fdb19008 game:Game = MessageMedia'

    def __str__(self):
        return '(messageMediaGame (ID: 0xfdb19008) = (game={}))'.format(str(self.game))
