chat.postMessage

        This method posts a message to a channel.

        https://api.slack.com/methods/chat.postMessage
542086
def chat_post_message(self, channel, text, **params):
        
        method = 'chat.postMessage'
        params.update({
            'channel': channel,
            'text': text,
        })
        return self._make_request(method, params)
680680
public boolean sendMessage(SocketChannel channel, Message message) {
    return sendResponse(REQID.zeroREQID, channel, message);
  }
276527
@Override
	public Message<?> postReceive(Message<?> message, MessageChannel channel) {
		if (emptyMessage(message)) {
			return message;
		}
		MessageHeaderAccessor headers = mutableHeaderAccessor(message);
		TraceContextOrSamplingFlags extracted = this.extractor.extract(headers);
		Span span = this.threadLocalSpan.next(extracted);
		MessageHeaderPropagation.removeAnyTraceHeaders(headers,
				this.tracing.propagation().keys());
		this.injector.inject(span.context(), headers);
		if (!span.isNoop()) {
			span.kind(Span.Kind.CONSUMER).name("receive").start();
			span.remoteServiceName(REMOTE_SERVICE_NAME);
			addTags(message, span, channel);
		}
		if (log.isDebugEnabled()) {
			log.debug("Created a new span in post receive " + span);
		}
		headers.setImmutable();
		if (message instanceof ErrorMessage) {
			ErrorMessage errorMessage = (ErrorMessage) message;
			return new ErrorMessage(errorMessage.getPayload(),
					headers.getMessageHeaders(), errorMessage.getOriginalMessage());
		}
		return new GenericMessage<>(message.getPayload(), headers.getMessageHeaders());
	}
759244
def onmessage(msg)
      msg = Oj.strict_load(msg)

      msg['data'] = Oj.strict_load(msg['data']) if msg['data'].is_a? String

      event = msg['event'].gsub(/\Apusher:/, 'pusher_')

      if event =~ /\Aclient-/
        msg['socket_id'] = connection.socket_id
        Channel.send_client_message msg
      elsif respond_to? event, true
        send event, msg
      end

    rescue JSON::ParserError
      error({ code: 5001, message: "Invalid JSON" })
    rescue Exception => e
      error({ code: 500, message: "#{e.message}\n #{e.backtrace.join "\n"}" })
    end
437480
function sendMessage(client, to, message, callback) {
	resolveID(client, to, function(channelID) {
		client._req('post', Endpoints.MESSAGES(channelID), message, function(err, res) {
			handleResCB("Unable to send messages", err, res, callback);
		});
	});
}
756035
def publish(self, message, channel=None):
        
        if not self.master:
            return
        channel = channel or ''
        data = json.dumps(message)
        self.publisher.send_string("%s %s" % (channel, data))
604477
function _returnMessage(message, target) {
                return this.circuit.run(function (success, failure) {
                    try {
                        var initiated = this.messageChannel.postMessage.call(this.messageChannel, message, target);

                        if (false === initiated) {
                            failure();
                        }
                        else {
                            success();
                        }
                    }
                    catch (ex) {
                        failure();
                    }
                }.bind(this));
            }
247849
def send_slack_message(channel, text):
    """"""
    http = httplib2.Http()
    return http.request(SLACK_MESSAGE_URL, 'POST', body=json.dumps({
        'channel': channel,
        'text': text,
    }))
1251483
function logMessage(message)
    {
        // post the message
        var msg = WebInspector.ConsoleMessage.create(
            WebInspector.ConsoleMessage.MessageSource.Other,
            messageLevel || WebInspector.ConsoleMessage.MessageLevel.Debug,
            message);

        self.console.addMessage(msg);
        if (showConsole)
            WebInspector.showConsole();
    }
859989
def post_message(self, msg):
        ''''''
        if '_posted' in msg.__dict__:
            return
        msg._posted = True
        msg._timestamp = time.time()
        type = msg.get_type()
        if type != 'HEARTBEAT' or (msg.type != mavlink.MAV_TYPE_GCS and msg.type != mavlink.MAV_TYPE_GIMBAL):
            self.messages[type] = msg

        if 'usec' in msg.__dict__:
            self.uptime = msg.usec * 1.0e-6
        if 'time_boot_ms' in msg.__dict__:
            self.uptime = msg.time_boot_ms * 1.0e-3

        if self._timestamp is not None:
            if self.notimestamps:
                msg._timestamp = self.uptime
            else:
                msg._timestamp = self._timestamp

        src_system = msg.get_srcSystem()
        src_component = msg.get_srcComponent()
        src_tuple = (src_system, src_component)
        radio_tuple = (ord('3'), ord('D'))
        if not (src_tuple == radio_tuple or msg.get_type() == 'BAD_DATA'):
            if not src_tuple in self.last_seq:
                last_seq = -1
            else:
                last_seq = self.last_seq[src_tuple]
            seq = (last_seq+1) % 256
            seq2 = msg.get_seq()
            if seq != seq2 and last_seq != -1:
                diff = (seq2 - seq) % 256
                self.mav_loss += diff
                #print("lost %u seq=%u seq2=%u last_seq=%u src_system=%u %s" % (diff, seq, seq2, last_seq, src_system, msg.get_type()))
            self.last_seq[src_tuple] = seq2
            self.mav_count += 1
        
        self.timestamp = msg._timestamp
        if type == 'HEARTBEAT' and msg.get_srcComponent() != mavlink.MAV_COMP_ID_GIMBAL:
            self.target_system = msg.get_srcSystem()
            self.target_component = msg.get_srcComponent()
            if float(mavlink.WIRE_PROTOCOL_VERSION) >= 1 and msg.type != mavlink.MAV_TYPE_GCS:
                self.flightmode = mode_string_v10(msg)
                self.mav_type = msg.type
                self.base_mode = msg.base_mode
        elif type == 'PARAM_VALUE':
            s = str(msg.param_id)
            self.params[str(msg.param_id)] = msg.param_value
            if msg.param_index+1 == msg.param_count:
                self.param_fetch_in_progress = False
                self.param_fetch_complete = True
        elif type == 'SYS_STATUS' and mavlink.WIRE_PROTOCOL_VERSION == '0.9':
            self.flightmode = mode_string_v09(msg)
        elif type == 'GPS_RAW':
            if self.messages['HOME'].fix_type < 2:
                self.messages['HOME'] = msg
        elif type == 'GPS_RAW_INT':
            if self.messages['HOME'].fix_type < 3:
                self.messages['HOME'] = msg
        for hook in self.message_hooks:
            hook(self, msg)

        if (msg.get_signed() and
            self.mav.signing.link_id == 0 and
            msg.get_link_id() != 0 and
            self.target_system == msg.get_srcSystem() and
            self.target_component == msg.get_srcComponent()):
            # change to link_id from incoming packet
            self.mav.signing.link_id = msg.get_link_id()
431843
def post_chat_message(self, merchant_id, channel_id, message):
        

        return self.do_req('POST',
                           self.base_url + '/chat/v1/merchant/%s/channel/%s/message/' % (merchant_id, channel_id),
                           message)
1368598
function Message (params) {
  var self = this
  if (!(self instanceof Message)) return new Message(params)

  var message = params['chat_message'] || params
  var header = message['header']
  var body = message['body'] || { }
  var media = body['media']
  var type = body['type']

  self.identifier = message['id']
  self.messageIdentifier = message['chat_message_id']
  self.pagination = params['iter_token']
  self.messageKind = constants.messageKindFromString(type)
  self.created = new Date(+message['timestamp'])

  if (self.messageKind === null) {
    debug('invalid MessageKind (%s %j)', type, params)
  } else if (self.messageKind === constants.MessageKind.Text.value) {
    self.text = body['text']
  } else if (media) {
    self.mediaIdentifier = media['media_id']
    self.mediaSize = {
      'width': media['width'] | 0,
      'height': media['height'] | 0
    }
    self.mediaIV = media['iv']
    self.mediaKey = media['key']
    self.mediaType = media['media_type']

    if (self.mediaType) {
      self.mediaType = 'UNSPECIFIED'
    } else if (self.mediaType !== 'VIDEO') {
      debug('new message type (%s)', self.mediaType)
    }
  }

  self.conversationIdentifier = header['conv_id']

  self.recipients = header['to']
  self.sender = header['from']

  self.index = message['seq_num'] | 0
  self.savedState = message['saved_state']
  self.type = message['type']

  if (self.type !== 'chat_message') {
    debug('unknown chat message type (%s %j)', self.type, params)
  }
}
168410
def close(self, channel):
        
        self.params.update({
            'channel': channel,
            })
        return FromUrl('https://slack.com/api/im.close', self._requests)(data=self.params).post()
2110
def on_message(msg, server):
    """"""
    text = msg.get("text", "")
    match = re.findall(r"!gif (.*)", text)
    if not match:
        return

    res = gif(match[0])
    if not res:
        return

    attachment = {
        "fallback": match[0],
        "title": match[0],
        "title_link": res,
        "image_url": res
    }
    server.slack.post_message(
        msg['channel'],
        '',
        as_user=server.slack.username,
        attachments=json.dumps([attachment]))
791348
def pins
      msgs = API::Channel.pinned_messages(@bot.token, @id)
      JSON.parse(msgs).map { |msg| Message.new(msg, @bot) }
    end
629342
def sendMessage(self, message, thread_id=None, thread_type=ThreadType.USER):
        
        return self.send(
            Message(text=message), thread_id=thread_id, thread_type=thread_type
        )
1067074
def chat_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/chats"
        return self.call(api_path, method="POST", data=data, **kwargs)