Delivers a message to an IRC channel.

 @param bot [Cinch::Bot] the IRC bot
 @param message [Message] the message to deliver
324009
def deliver(bot, message)
      channel = bot.Channel(message.channel.name)
      message.format.to_a.each do |msg|
        channel.send msg
      end
    end
1275815
def monitor
      if @bot.irc.isupport["MONITOR"] > 0
        @bot.irc.send "MONITOR + #@name"
      else
        refresh
        @monitored_timer = Timer.new(@bot, interval: 30) {
          refresh
        }
        @monitored_timer.start
      end

      @monitored = true
    end
384330
function Channel_sendMessage(message) {
  if (!this._websocket) return

  message = JSON.stringify(message)
  this._websocket.send(message)
}
1286161
def deliver(self, message, to):
        
        # Send the message via local SMTP server.
        s = smtplib.SMTP(self.host, self.port)
        # sendmail function takes 3 arguments: sender's address, recipient's address
        # and message to send - here it is sent as one string.
        s.sendmail(message['From'], to, message.as_string())
        s.quit()
        return
481700
def listen
      perform_with_bot do |bot|
        bot.listen do |message|
          next if message.nil?
          text = message.text
          next if text.nil?
          yield text
        end
      end
    end
1016962
def send_encoded(self, message, auth_header=None, **kwargs):
        
        client_string = 'raven-python/%s' % (raven.VERSION,)

        if not auth_header:
            timestamp = time.time()
            auth_header = get_auth_header(
                protocol=self.protocol_version,
                timestamp=timestamp,
                client=client_string,
                api_key=self.remote.public_key,
                api_secret=self.remote.secret_key,
            )

        headers = {
            'User-Agent': client_string,
            'X-Sentry-Auth': auth_header,
            'Content-Encoding': self.get_content_encoding(),
            'Content-Type': 'application/octet-stream',
        }

        return self.send_remote(
            url=self.remote.store_endpoint,
            data=message,
            headers=headers,
            **kwargs
        )
1176635
def send(self, message):
        
        if isinstance(message, dict):
            response = self.client.mail.send.post(request_body=message)
        else:
            response = self.client.mail.send.post(request_body=message.get())
        return response
486142
def handle_message(self, connection, sender, target, message):
        
        parts = message.strip().split(' ', 2)
        if parts and parts[0].lower() == '!bot':
            try:
                command = parts[1].lower()
            except IndexError:
                self.safe_send(connection, target, "No command given")
                return

            try:
                payload = parts[2]
            except IndexError:
                payload = ""

            self.__pool.enqueue(self._handle_command,
                                connection, sender, target, command, payload)
398300
def forward_message(self, from_chat_id, message_id):
        
        return self.bot.api_call(
            "forwardMessage",
            chat_id=self.id,
            from_chat_id=from_chat_id,
            message_id=message_id,
        )
455348
def send_conversation_message(from, to, params={})
      ConversationMessage.new(conversation_request(
        :post,
        'send', 
        params.merge({
          :from => from,
          :to => to,
        })))
    end
880222
def send_to_queue(self, message):
        
        if not self.queue_delivery:
            raise RuntimeError("No queue_path provided")

        return self.queue_delivery.send(*self._message_args(message))
33950
def post_message(text, options = {})
      payload = {
        username: @options['name'],
        channel:  @options['channel'],
        text:     text,
        as_user:  true
      }.merge(options)

      unless direct_message?(payload[:channel])
        payload[:channel] = enforce_leading_hash(payload[:channel])
        @api.join(payload[:channel])
      end

      @api.post_message(payload)
      return nil # be quiet in webhook reply
    end
872456
def send_message(self, message):
        
        if not self.live():
            raise IOError("Connection is not live.")

        message.add_flag(BEGIN_END_FLAG)
        self.write(message.buffer)
791348
def pins
      msgs = API::Channel.pinned_messages(@bot.token, @id)
      JSON.parse(msgs).map { |msg| Message.new(msg, @bot) }
    end
635770
async def message(self, target, message):
        
        hostmask = self._format_user_mask(self.nickname)
        # Leeway.
        chunklen = protocol.MESSAGE_LENGTH_LIMIT - len(
            '{hostmask} PRIVMSG {target} :'.format(hostmask=hostmask, target=target)) - 25

        for line in message.replace('\r', '').split('\n'):
            for chunk in chunkify(line, chunklen):
                # Some IRC servers respond with "412 Bot :No text to send" on empty messages.
                await self.rawmsg('PRIVMSG', target, chunk or ' ')
93564
def load_message(message_id)
      response = API::Channel.message(@bot.token, @id, message_id)
      Message.new(JSON.parse(response), @bot)
    rescue RestClient::ResourceNotFound
      nil
    end
549310
def handle(self, message):
        '''
        
        '''

        logger.debug(message)
        if Utilities.isNotEmpty(message['metadata']['opts']):
            target = message['metadata']['opts']['target']
            self.botThread.create_message(target, message['text'])