Closed confact closed 6 years ago
When you say interactive messages, do you mean messages which include buttons etc?
Yes, I mean that. Now I need some way to bridge over the request from a webhook from slack via a controller, or have I misread?
If I understand it correctly I can add the buttons without problems with attachment in the reply or say method. But I would need a way to handle the action of the button. I would like to handle all the bot logic in the bot class, and not send say via remote control.
So my thought was to add a method to remote control class here for just sending the actions from the interactive message's actions to the bot. And have a method in the bot handle that.
What do you think @lazyatom?
In order to do that, I think you'd need to somehow enhance this whole server to be able to respond to the HTTP requests coming from Slack, which I've deliberately delimited as outside of the scope of the bot.
Because this project is designed to complement an existing app, it's the intention that you handle the HTTP requests using the existing app (e.g. with a Rails controller). From within that controller you could certainly then call methods that are defined in files that sit nearby, but it's not really correct to think about them as being received "by the bot" (and it definitely won't be the same literal object instance, since that has to run within a separate process anyway).
I was a bit unclear, I will indeed use a rails controller.
The flow will look like this:
In that way, I would need to have a method for this in remote control and in bot. Shall I just add to my fork or how do you feel?
By all means please do spike some code -- it'll be easier to make sure we're talking about the same thing :)
@lazyatom pushed my solution to the problem. work pretty good with a controller or a grape endpoint. Fixed also the common way to update a message when clicking on the button.
I plan to use this as my bot server but I would need interactive message support.
How would I be able to support that? If you don't have time to do it yourself, could you point some way and I will try to add it, it is important for me that I can do interactive messages.