slacker icon indicating copy to clipboard operation
slacker copied to clipboard

Add support for using response_url when making posts

Open raveious opened this issue 8 years ago • 3 comments

For using slash commands and other interactive buttons, you're given the option to respond using the response_url field value instead of just a normal return within the 3 second limit.

raveious avatar Dec 02 '16 13:12 raveious

Hi, @raveious. I'm not sure if I'm following. Could you provide more details on this?

os avatar Jan 28 '17 09:01 os

Sure,

When receiving a message from Slack, it will often include a response_url field. https://api.slack.com/slash-commands#responding_to_a_command

If you post to this URL instread of the generic one, slack will handling this differently and renders this differently. This is particularlly useful for when hosting on a server that is particularly slow cough cough free Heroku instance cough

raveious avatar Jan 28 '17 15:01 raveious

A workaround is to use Slacker.incomingwebhook:

slack = Slacker('<token>', incoming_webhook_url='<response_url>')
slack.incomingwebhook.post({"text": "It's 80 degrees right now."})

rdkr avatar Jul 11 '17 16:07 rdkr