Send a message.

        Records the message in the log.
547460
def send(self, target, nick, msg, msgtype, ignore_length=False, filters=None):
        
        if not isinstance(msg, str):
            raise Exception("Trying to send a %s to irc, only strings allowed." % type(msg).__name__)
        if filters is None:
            filters = self.outputfilter[target]
        for i in filters:
            if target != self.config['core']['ctrlchan']:
                msg = i(msg)
        # Avoid spam from commands that produce excessive output.
        if not ignore_length:
            # Ignore everything after the first 800 chars.
            msg = misc.truncate_msg(msg, 800)

        # We can't send messages > 512 bytes to irc.
        max_len = misc.get_max_length(target, msgtype)
        msgs = self.build_split_msg(msg, max_len)

        for i in msgs:
            self.do_log(target, nick, i, msgtype)
            if msgtype == 'action':
                self.rate_limited_send('action', target, i)
            else:
                self.rate_limited_send('privmsg', target, i)
706531
def send_message(self, msg_id, msg_data):
        """"""
        if self._error.has_error() or self._force_close_time > 0:
            return False

        byte_msg = self.message_packer.pack(msg_id, msg_data)
        length = struct.calcsize(self.__class__.message_packer.size_fmt) + len(byte_msg)

        if length > self.__class__.max_message_size:
            raise MessageSizeOverflowError(msg_id, length, self.__class__.max_message_size)

        self._out_buffer += struct.pack(self.__class__.message_packer.size_fmt, length)
        self._out_buffer += byte_msg
        return True
962337
def send_message(self, message):
        
        if self._error:
            raise compat.saved_exc(self._error)
        elif self._transport is None:
            raise JsonRpcError('not connected')
        self._version.check_message(message)
        self._writer.write(serialize(message))
435379
def write(self, msg, level=logging.INFO):
        
        if msg is not None and len(msg.strip()) > 0:
            self.logger.log(level, msg)
1195534
def send(self, message):
        
        future = self.post(message)
        future.join()
        return future.result
1009365
def send_message(self, message):
        """"""
        self.print_debug_message(message)
        self.socket.send(message)
13769
def send_to_observer(self, msg, frm):
        
        logger.debug("{} sending message to observer: {}".
                     format(self, (msg, frm)))
        self._observer.append_input(msg, frm)
741195
def send(self, message):
        """"""
        serialized = message.SerializeToString()

        log_binary(_LOGGER, '>> Send', Data=serialized)
        if self._chacha:
            serialized = self._chacha.encrypt(serialized)
            log_binary(_LOGGER, '>> Send', Encrypted=serialized)

        data = write_variant(len(serialized)) + serialized
        self._transport.write(data)
        _LOGGER.debug('>> Send: Protobuf=%s', message)
945807
def send(self, msg, stat=None) -> None:
        
        self.logger.trace("{} sending {}".format(self, msg.__class__.__name__),
                          extra={"cli": True, "tags": ['sending']})
        self.logger.trace("{} sending {}".format(self, msg))
        if stat:
            self.stats.inc(stat)
        self.outBox.append(msg)
583324
def write_message(self, message):
        
        logging.debug("Sending message {mes} to {usr}".format(mes=message, usr=self.id))
        self.handler.write_message(message)
961792
async def send(self, message_type, message_content, timeout=None):
        
        return await self._sender.send(
            message_type, message_content, timeout=timeout)
1020524
def write(self, msg):
        
        self._current_stream.write(msg)
        for log in self._logs.values():
            log.append(msg)
731910
def send_message(self, message):
        """"""
        if not isinstance(message, dict):
            logger = self.logger if self.logger else log
            logger.error(
                "%s.%d attempted to send a non dict message to Storm: " "%r",
                self.component_name,
                self.pid,
                message,
            )
            return
        self.serializer.send_message(message)
588154
def send(self, s):
        
        self._print_header('======== Sending ({0}) ========'.format(len(s)))

        self._log_send(s)
        out = len(s)

        while s:
            s = s[self._send(s):]
        return out
1038709
def send(self, message):  # usually a json string...
        
        for transport in self.transports.values():
            transport.protocol.sendMessage(message)
1004115
public function send(): void
	{	
		$sentMessage = $this->baseMethod->send();
		$this->messageId = $sentMessage->getMessageId();
		$this->chatId = $sentMessage->getChat()->getId();

		$this->saveState();
	}
423494
def _send(self, message, fail_silently=False):
        
        seeds = '1234567890qwertyuiopasdfghjklzxcvbnm'
        file_part1 = datetime.now().strftime('%Y%m%d%H%M%S')
        file_part2 = ''.join(sample(seeds, 4))
        filename = join(self.tld, '%s_%s.msg' % (file_part1, file_part2))
        with open(filename, 'w') as fd:
            fd.write(str(message.to_message()))