-
-
Notifications
You must be signed in to change notification settings - Fork 224
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
support posting to response_url for message actions (buttons) #113
Comments
It's just an HTTP POST to that URL, no? Examine the error in the 500, you're probably not formatting the message right. Try to build a very simple sample on top of examples and I'll try to help you out. |
Yes, whoops, I don't remember exactly what I was doing the other day, but I think I just needed to call connection.post do |req|
req.url response_url
req.body = {text: 'new message', attachments: [...]}.to_json
end Do you think it makes sense to put a method on If you think it makes sense on |
What's |
I'm using So for instance I can run it on the command line like this: client = Slack::Web::Client.new(token: token)
client.send(:connection).post(response_url, args.to_json) The reason I'm using The reason I thought the new method should be an instance method on |
This is not in a realtime context, right? I mean the response URL appears as a response to what code? I think that response needs to become a class that exposes a |
Actually the |
Oh I see, this is in response to a command, something that I had to do in https://github.com/dblock/slack-market/blob/master/slack-market/api/endpoints/slack_endpoint.rb for example. I guess there's nothing to do in the client indeed. If we wanted to support slash and other commands out of the box that code would belong at a higher level, ie. in slack-ruby-bot-server for example. So you don't even need a token to POST to |
Was there any decision made with regard to how to respond to messages via |
No decision @avand, see my suggestion if you want to try to PR something. |
When creating messages with interactive buttons, one of the ways to update the message after someone hits a button is to use make a request to the
response_url
, which is included in the action payload. It would be very convenient if this client could make those requests.I did some initial poking around: I tried using the
response_url
as theendpoint
, and then put the updated message content in the body, but I gotFaraday::ClientError: the server responded with status 500
, so I think I don't understand Faraday.https://api.slack.com/docs/message-buttons#how_to_respond_to_message_button_actions
The text was updated successfully, but these errors were encountered: