Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command Parameters is null for interactive request from slack #49

Open
antony-develop opened this issue Jun 18, 2019 · 0 comments
Open

Comments

@antony-develop
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant