-
Notifications
You must be signed in to change notification settings - Fork 0
Add /skills slash command support. #38
base: master
Are you sure you want to change the base?
Conversation
FYI, you should be able to test this right now in our Slack with |
So... is this a worthwhile feature? Should I do anything differently? Skip it entirely? |
@@ -36,6 +36,11 @@ export default class BotRunner { | |||
} | |||
} | |||
|
|||
// Find the first bot for which "fn" returns true. | |||
findBot(fn) { | |||
return Object.keys(this.bots).map(k => this.bots[k]).find(fn); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure how well this would scale to a large quantity of bots--seems like we should be making an index by the key we care about for lookups, or bypassing the instantiated bot entirely, somehow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could easily be optimized later, I wrote it to be as generic as possible for now.
This seems like a worthwhile feature if we were going to try to do serverless bots. Outside that context, I'm not sure what value it adds for the end user? |
@tkellen think about it this way, perhaps: How many times will people who haven't read the docs try to type |
I'm totally happy not landing this, but keeping it in mind in case we decide we want this functionality. It's all fine with me! |
👍 that won me over |
How it works
/skills <optional args>
from any channel./command
./skills
.Notes
Testing with your own app
As part of Slack app setup, before running the bot:
.env
file like so:SLACK_VERIFICATION_TOKEN=your_verification_token_value
/skills
https://c863a1e3.ngrok.io/command
(use your ngrok url +/command
)Show your skills.
[command]
If you've already added the app to Slack, you'll have to refresh the ngrok server page with the "Add to Slack" button and re-add it, so the new
commands
scope is added to the integration. This shouldn't require changing or re-importing the database.