Comments (8)
Slash commands are not supported out of the box, partly because this is usually implemented with a web front-end. I'll label this as a feature request though.
from slack-ruby-bot.
Thanks! Is it supported in https://github.com/dblock/slack-bot-server ?
Maybe it belongs there because of the web front-end.
2016-04-25 16:41 GMT+02:00 Daniel Doubrovkine (dB.) @dblockdotorg <
[email protected]>:
Slash commands are not supported out of the box, partly because this is
usually implemented with a web front-end. I'll label this as a feature
request though.—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/dblock/slack-ruby-bot/issues/68#issuecomment-214365139
from slack-ruby-bot.
Not really. You have all the parts to build it there though.
What I'd like is a DSL and documentation on how to support slash commands in slack-ruby-bot. Implementing something in slack-bot-server is how I'd start with it and then see what it looks like and how to make this a feature of slack-ruby-bot.
from slack-ruby-bot.
Is it supported now?
from slack-ruby-bot.
No, please feel free to contribute @mabdelfattah.
from slack-ruby-bot.
out of the box, is there a way to ignore slash commands? in my case, i've an app that handles slash commands from the slack API, but i also have a bot using this library that seems to catch all these slash commands and responds with I don't understand that command!
- just looking for catch all
from slack-ruby-bot.
ahh nevermind...
match /^\/(.*)/ do |client, data, match|
cmd = data['text']
client.say(channel: data.channel, text: "ignoring slash commands: #{cmd}")
end
that'll work !
from slack-ruby-bot.
I actually manage to call slash commands from my bot like this:
Create a helper method that reverts the token to a "legacy" one (they start with xoxp
instead of xoxb
):
def self.with_legacy_token(client)
old_token = client.token
begin
client.token = ENV['SLACK_LEGACY_TOKEN']
client.web_client.token = client.token
yield(client)
ensure
client.token = old_token
client.web_client.token = client.token
end
end
Then you can call slash commands like this:
Lib::GeneralHelper.with_legacy_token(client) do |legacy_client|
legacy_client.web_client.chat_command(channel: data.channel,
command: slash_cmd,
text: slash_cmd_arg)
end
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.