{"action":"opened","issue":{"url":"https://api.github.com/repos/botman/botman/issues/720","repository_url":"https://api.github.com/repos/botman/botman","labels_url":"https://api.github.com/repos/botman/botman/issues/720/labels{/name}","comments_url":"https://api.github.com/repos/botman/botman/issues/720/comments","events_url":"https://api.github.com/repos/botman/botman/issues/720/events","html_url":"https://github.com/botman/botman/issues/720","id":298705186,"number":720,"title":"Delayed Slack Slash Commands","user":{"login":"mattevolve","id":12253120,"avatar_url":"https://avatars0.githubusercontent.com/u/12253120?v=4","gravatar_id":"","url":"https://api.github.com/users/mattevolve","html_url":"https://github.com/mattevolve","followers_url":"https://api.github.com/users/mattevolve/followers","following_url":"https://api.github.com/users/mattevolve/following{/other_user}","gists_url":"https://api.github.com/users/mattevolve/gists{/gist_id}","starred_url":"https://api.github.com/users/mattevolve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattevolve/subscriptions","organizations_url":"https://api.github.com/users/mattevolve/orgs","repos_url":"https://api.github.com/users/mattevolve/repos","events_url":"https://api.github.com/users/mattevolve/events{/privacy}","received_events_url":"https://api.github.com/users/mattevolve/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-20T18:44:42Z","updated_at":"2018-02-20T18:44:42Z","closed_at":null,"author_association":"NONE","body":"- BotMan Version: 2.2.0\r\n- PHP Version: 7.2\r\n- Messaging Service(s): Slack\r\n- Slack Driver: 1.0.0\r\n\r\n### Description:\r\nWhat do I have to do to get a delayed response into my Slack workspace? I'm submitting a Slack slash command but there is a delay between the logic and the response and I cannot guarantee the response will be ready and returned within Slack's allotted 3000ms. I have a laravel 5.5 installation with botman and all of my logic is currently within the `routes/botman.php` file.\r\n\r\n```\r\n$botman->hears('/command {var}', function ($bot, $var) {\r\n    $attachments = slackCommand('command', $var); // custom logic happens here\r\n    $bot->sendPayload([\r\n        'attachments' => buildPayload($attachments) // attachment data compiled via custom function\r\n    ]);\r\n});\r\n```\r\n\r\nApologies if this is already documented but I can't figure this out... What must I alter to send a delayed response? Any logic within the closure that delays the response past 3000ms causes this Slack response:\r\n\r\n> Darn - that slash command didn't work (error message: `Timeout was reached`). Manage the command at BotName.\r\n\r\nIs there a way botman could automatically handle delayed responses when detecting a slash command using the slack driver `isSlashCommand` function?\r\n\r\n### TL;DR:\r\nIf I have understood the botman/Slack documentation correctly, when botman listens for a slack command the response should contain a `response_url=https://hooks.slack.com/commands/1234/5678` key and value. I assume I need to take the `response_url` and post to it after my application has performed its logic but this needs to happen separately from the initial `$botman->hears()` closure? Am I thinking about this in the right way and do I need to dispatch a laravel job or something?\r\n\r\nhttps://api.slack.com/slash-commands#responding_to_a_command"}}
{"actor":{"display_login":"mattevolve"}}