def data_out(self, text=None, **kwargs):

        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))
Evennia -> IMC2.
dataset/ETHPy150Open evennia/evennia/evennia/server/portal/imc2.py/IMC2Bot.data_out