from telethon.tl.mtproto_request import MTProtoRequest


class MessageActionGameScore(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    messageActionGameScore#92a72876 game_id:long score:int = MessageAction"""

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

    def __init__(self, game_id, score):
        """
        :param game_id: Telegram type: «long».
        :param score: Telegram type: «int».
        """
        super().__init__()

        self.game_id = game_id
        self.score = score

    def on_send(self, writer):
        writer.write_int(MessageActionGameScore.constructor_id, signed=False)
        writer.write_long(self.game_id)
        writer.write_int(self.score)

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

    def on_response(self, reader):
        self.game_id = reader.read_long()
        self.score = reader.read_int()

    def __repr__(self):
        return 'messageActionGameScore#92a72876 game_id:long score:int = MessageAction'

    def __str__(self):
        return '(messageActionGameScore (ID: 0x92a72876) = (game_id={}, score={}))'.format(str(self.game_id), str(self.score))
