from telethon.tl.mtproto_request import MTProtoRequest


class MessageActionChatJoinedByLink(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    messageActionChatJoinedByLink#f89cf5e8 inviter_id:int = MessageAction"""

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

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

        self.inviter_id = inviter_id

    def on_send(self, writer):
        writer.write_int(MessageActionChatJoinedByLink.constructor_id, signed=False)
        writer.write_int(self.inviter_id)

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

    def on_response(self, reader):
        self.inviter_id = reader.read_int()

    def __repr__(self):
        return 'messageActionChatJoinedByLink#f89cf5e8 inviter_id:int = MessageAction'

    def __str__(self):
        return '(messageActionChatJoinedByLink (ID: 0xf89cf5e8) = (inviter_id={}))'.format(str(self.inviter_id))
