from ...tl.tlobject import TLObject


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

    # Telegram's constructor (U)ID for this class
    constructor_id = 0xc331e80a
    # Also the ID of its resulting type for fast checks
    subclass_of_id = 0x48d15883

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

        Constructor for InputGame: Instance of either InputGameID, InputGameShortName.
        """
        super().__init__()

        self.bot_id = bot_id
        self.short_name = short_name

    def to_dict(self):
        return {
            'bot_id': None if self.bot_id is None else self.bot_id.to_dict(),
            'short_name': self.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 (attributes=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 TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)
