from telethon.tl.mtproto_request import MTProtoRequest


class MessageActionChannelCreate(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    messageActionChannelCreate#95d2ac92 title:string = MessageAction"""

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

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

        self.title = title

    def on_send(self, writer):
        writer.write_int(MessageActionChannelCreate.constructor_id, signed=False)
        writer.tgwrite_string(self.title)

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

    def on_response(self, reader):
        self.title = reader.tgread_string()

    def __repr__(self):
        return 'messageActionChannelCreate#95d2ac92 title:string = MessageAction'

    def __str__(self):
        return '(messageActionChannelCreate (ID: 0x95d2ac92) = (title={}))'.format(str(self.title))
