-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
Re-use the Client for the web server #63
Comments
In theory I think there's no harm exposing Also, generally, I'm interested in expanding slack-ruby-bot with support for web hooks and such, maybe merging parts or all of https://github.com/dblock/slack-bot-server or turning the latter into a framework (see slack-ruby/slack-ruby-bot-server#3). |
Ok, good, I thought I was really missing something when looking at the code. The "hack" with I'll take a look at the referenced issues. I think there's something missing between "Running a bot that only replies to chat" and "Running a full slack integration available to others" ;) |
@klaustopher I think https://github.com/dblock/slack-ruby-bot-server is the beginning of the answer for the missing link. |
@dblock Thanks, this looks good. I'll definitely take a look ;) |
This is related to https://github.com/dblock/slack-ruby-bot-server/issues/6. I think we should either expose |
Has there been any progress on exposing client? I have a bot running very nicely, but I'd like the ability to have the bot message users after a specific rails api call too. I'm not familiar with the send(:client) hack mentioned above, could someone elaborate a bit? |
This issue seems to revolve around the same discussion as supporting slash commands and webhooks. I'm also extremely interested in this and I ran into the same issues as @klaustopher. I was previously using Lita, which includes a built-in web server, but this library is much nicer for working with Slack so it would be nice if it could also include a web server. I'm not a Ruby expert. @dblock do you think it makes more sense to look into slack-ruby-bot-server or to try the hacky |
See my comment above for |
Slash commands and webhooks require a web server. I've released https://github.com/slack-ruby/slack-ruby-bot-server-events that has full support for those. |
Hey,
I have been playing around with the framework over the weekend and I want to implement a bot that listens to chat but also has some webhooks (i.e. hook it up to GitHub to react to events that happen with our pull-requests). I set it up like you did in the tutorial and everything worked when I stayed within the Slack world ...
But when I wanted to send something to the chat room from the web server I ran into an issue. The
client
property on theSlackMathbot::Bot
is private and I cannot access it from the sinatra app. In #20 and #31 you basically suggest to useSlack::Web::Client.new
directly... But since my bot already has a connection to the server open, I don't really see why it should be needed to create another connection to the Slack server.Am I just missing a way to access the client directly?
The text was updated successfully, but these errors were encountered: