slack-ruby / slack-ruby-bot-server

A library that enables you to write a complete Slack bot service with Slack button integration, in Ruby.
MIT License
268 stars 74 forks source link

What about this gem sets it up to show the Add To Slack button? #150

Closed Altonymous closed 1 year ago

Altonymous commented 1 year ago

I ask because the README suggest the button will appear auto-magically? I have a brand new rails app I've created to learn how to do this. I don't see the Add to Slack button.. I would assume I need to generate a new Controller, setup the default route, and add the code from the Slack documentation to see it?

Is that not required? Did I mess something up that should do it for me?

https://github.com/slack-ruby/slack-ruby-bot-server/blob/2f910810396c1f044bdbde9b1b73d08bab9dfd7c/README.md?plain=1#L150

dblock commented 1 year ago

Since this gem was written there has been ... changes. I would start with https://github.com/slack-ruby/slack-ruby-bot-server-events-sample today, and for Rails I found https://github.com/CrazyOptimist/slack-rails-bot-starter that seems like it gets you somewhere.

Otherwise for this specific question here's the index.html.erb that has the button. If that gets rendered, you should see it. There's more work to do with Rails, none of the tutorials here use Rails.

Altonymous commented 1 year ago

I switched over to the sample you suggested above and it's working great.

Side note: I am curious though.. if I want to add additional api end points for my own purposes within this sample, is there an easy way to do that?

dblock commented 1 year ago

@Altonymous Yes.

I opened https://github.com/slack-ruby/slack-ruby-bot-server/issues/151 to document it and typed out an example that I think should work. Care to help with trying it out and PRing some documentation? And maybe code to improve this capability that doesn't require monkey-patching?