src/ApiClient.php
public function postMessage(Message $message)
    {
        $options = [
            'text' => $message->getText(),
            'channel' => $message->data['channel'],
            'as_user' => true,
        ];

        if ($message->hasAttachments()) {
            $options['attachments'] = json_encode($message->getAttachments());
        }

        return $this->apiCall('chat.postMessage', $options);
    }
public function postMessage(Message $message)
    {
        $options = [
            'text' => $message->getText(),
            'channel' => $message->data['channel'],
            'as_user' => true,
        ];

        if ($message->hasAttachments()) {
            $options['attachments'] = json_encode($message->getAttachments());
        }

        return $this->apiCall('chat.postMessage', $options);
    }
public function postMessage ( Message $ message ) { $ options = [ 'text' => $ message -> getText ( ) , 'channel' => $ message -> data [ 'channel' ] , 'as_user' => true , ] ; if ( $ message -> hasAttachments ( ) ) { $ options [ 'attachments' ] = json_encode ( $ message -> getAttachments ( ) ) ; } return $ this -> apiCall ( 'chat.postMessage' , $ options ) ; }
Posts a message.

@param \Slack\Message\Message $message The message to post.

@return \React\Promise\PromiseInterface
Posts a message .