Comments (9)
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?
from slack-ruby-bot.
In theory I think there's no harm exposing client
, outside of the bot, you might want to test it with .send(:client)
and if that works feel free to PR a change. You might want to reach into client.web_client
if you need the web one that was used to open the connection in the first place.
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).
from slack-ruby-bot.
Ok, good, I thought I was really missing something when looking at the code. The "hack" with send(:client)
is what I ended up doing, but it felt so ugly that I had to wash my hands after writing this code 😂
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" ;)
from slack-ruby-bot.
@klaustopher I think https://github.com/dblock/slack-ruby-bot-server is the beginning of the answer for the missing link.
from slack-ruby-bot.
@dblock Thanks, this looks good. I'll definitely take a look ;)
from slack-ruby-bot.
This is related to https://github.com/dblock/slack-ruby-bot-server/issues/6.
I think we should either expose client
as is, or delegate calls to it. Thoughts? PRs?
from slack-ruby-bot.
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 .send(:client)
? @klaustopher do you have any sample code you could share for your .send(:client)
solution?
from slack-ruby-bot.
See my comment above for client
, but generally I would like native webhook support in slack-ruby-bot-server.
from slack-ruby-bot.
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.
from slack-ruby-bot.
Related Issues (20)
- Getting lots of 429 rate limit errors on https://slack.com/api/rtm.start calls HOT 7
- Graceful shutdown HOT 1
- Testing other code execution inside a command HOT 8
- Deployment tutorial needs update HOT 2
- DMing self produces Sorry @Slackbot, I don't understand that command! HOT 1
- Migration to non-legacy bots HOT 6
- Consider splitting RSpec shared behaviours and development dependencies HOT 4
- Where can i find more info on the client.say method? HOT 7
- Remove support for Giphy
- Extract attachments text
- without mention in channel bot can't reply HOT 1
- Upload a file? HOT 1
- Pongbot does not run on linux mint 19 HOT 4
- Testing for two outputs from a command HOT 5
- When a command is posted in thread, its again posted as direct message automatically HOT 4
- is there an example for how to implement a conversational bot using slack-ruby-bot? HOT 1
- Missing concurrency - Add faye-websocket to your gemfile -- It's already in my Gemfile HOT 1
- Clarification of MIGRATION.md HOT 8
- Is this repo really legacy, there is still a use case? HOT 3
- Repeated 429 (ratelimited) errors from slack HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slack-ruby-bot.