jolicode / slack-php-api

:hash: PHP Slack Client based on the official OpenAPI specification
https://jolicode.github.io/slack-php-api/
MIT License
224 stars 56 forks source link

chatPostMessage Interactive Buttons #82

Closed Jasonlbc closed 4 years ago

Jasonlbc commented 4 years ago

trying to send buttons as messages, but nothing happens. Code is based off of the example [https://api.slack.com/reference/block-kit/block-elements#button] $result = $client->chatPostMessage([ 'username' => 'Bot', 'channel' => 'general', 'text' => 'Hello', 'blocks' => json_encode([ [ "type"=> "button", "text"=> [ "type"=> "plain_text", "text"=> "Click Me" ], "value"=> "click_me_123", "action_id"=> "button" ]) ] ]);

Jasonlbc commented 4 years ago

This block works 'blocks' => json_encode([ [ "type"=> "section", "text"=> [ "type"=> "mrkdwn", "text"=> "Hello" ] ], [ "type"=> "actions", "elements"=> [ [ "type"=> "button", "text"=> [ "type"=> "plain_text", "text"=> "Click Here", "emoji"=> false ] ] ] ] ]),