from ...tl.mtproto_request import MTProtoRequest


class BotCommand(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    botCommand#c27ac8c7 command:string description:string = BotCommand"""

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

    def __init__(self, command, description):
        """
        :param command: Telegram type: «string».
        :param description: Telegram type: «string».

        Constructor for BotCommand: Instance of BotCommand.
        """
        super().__init__()

        self.command = command
        self.description = description

    def on_send(self, writer):
        writer.write_int(BotCommand.constructor_id, signed=False)
        writer.tgwrite_string(self.command)
        writer.tgwrite_string(self.description)

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

    def on_response(self, reader):
        self.command = reader.tgread_string()
        self.description = reader.tgread_string()

    def __repr__(self):
        return 'botCommand#c27ac8c7 command:string description:string = BotCommand'

    def __str__(self):
        return '(botCommand (ID: 0xc27ac8c7) = (command={}, description={}))'.format(str(self.command), str(self.description))
