botman / botman/driver-slack

Command Parameters is null for interactive request from slack

Open
#49 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
51
Forks
54
PR merge metrics
No merged PRs in 30d

Description

I send a message to a user with some buttons.
```
$botman->say('What do you want to do?', [
'attachments' => json_encode([
[
"fallback" => "Shame... buttons aren't supported in this land",
"callback_id" => "menu_button",
"color" => "#3AA3E3",
"attachment_type" => "default",
'actions' => [
[
"name" => "study",
"text" => "study",
"type" => "button",
"value" => "study",
],
]
],
[
"fallback" => "Shame... buttons aren't supported in this land",
"callback_id" => "menu_button",
"color" => "#3AA3E3",
"attachment_type" => "default",
'actions' => [
[
"name" => "share_knowledge",
"text" => "share_knowledge",
"type" => "button",
"value" => "share_knowledge",
]
]
],
])
]);
```

And I expect parameter {buttonId} to catch any button value.
```
**
* @Route("/interactive", name="botman_interactive")
*/
public function interactive()
{
$this->botman->hears('{buttonId}', function ($bot, $buttonId) {
$bot->reply('You click button with id . $buttonId);
});

$this->botman->listen();

return new Response();
}
```

But $buttonId var is always null

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.