from telethon.tl.mtproto_request import MTProtoRequest


class InputGameShortName(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    inputGameShortName#c331e80a bot_id:InputUser short_name:string = InputGame"""

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

    def __init__(self, bot_id, short_name):
        """
        :param bot_id: Telegram type: «InputUser».
        :param short_name: Telegram type: «string».
        """
        super().__init__()

        self.bot_id = bot_id
        self.short_name = short_name

    def on_send(self, writer):
        writer.write_int(InputGameShortName.constructor_id, signed=False)
        self.bot_id.on_send(writer)
        writer.tgwrite_string(self.short_name)

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

    def on_response(self, reader):
        self.bot_id = reader.tgread_object()
        self.short_name = reader.tgread_string()

    def __repr__(self):
        return 'inputGameShortName#c331e80a bot_id:InputUser short_name:string = InputGame'

    def __str__(self):
        return '(inputGameShortName (ID: 0xc331e80a) = (bot_id={}, short_name={}))'.format(str(self.bot_id), str(self.short_name))
