def data_out(self, text=None, **kwargs):
        """
        Evennia -> IMC2.

        Kwargs:
           text (str): Outgoing text.
           packet_type (str):
                - broadcast: Send to everyone on IMC channel.
                - tell: Send a tell (see target keyword).
                - whois: Get whois information (see target keyword).
           sender (str): Used by tell to identify the mud sending.
           target (str): Key identifier of target to tells or whois. If not
               given "Unknown" will be used.
          destination (str): Used by tell to specify mud
            destination to send to.

        """

        if self.sequence:
            # This gets incremented with every command.
            self.sequence += 1

        packet_type = kwargs.get("packet_type", "imcbroadcast")

        if packet_type == "broadcast":
            # broadcast to everyone on IMC channel

            if text.startswith("bot_data_out"):
                text = text.split(" ", 1)[1]
            else:
                return

            # we remove the extra channel info since imc2 supplies this anyway
            if ":" in text:
                header, message = [part.strip() for part in text.split(":", 1)]
            # Create imc2packet and send it
            self._send_packet(pck.IMC2PacketIceMsgBroadcasted(self.servername,
                                                        self.channel,
                                                        header, text))
        elif packet_type == "tell":
            # send an IMC2 tell
            sender = kwargs.get("sender", self.mudname)
            target = kwargs.get("target", "Unknown")
            destination = kwargs.get("destination", "Unknown")
            self._send_packet(pck.IMC2PacketTell(sender, target, destination, text))

        elif packet_type == "whois":
            # send a whois request
            sender = kwargs.get("sender", self.mudname)
            target = kwargs.get("target", "Unknown")
            self._send_packet(pck.IMC2PacketWhois(sender, target))
dataset/ETHPy150Open evennia/evennia/evennia/server/portal/imc2.py/IMC2Bot.data_out/original