A slack slash command bot to save snippets/content quickly from slack.
- Deploy the app to heroku and choose a url of your preference.
- Next go to Configure Instructions page of your slack account and select
Slash Commands
- In the Add new slash command page, choose any command of your choice and click
Add Slash Command Integration
- In the next page, in Integration Settings input the options as below,
URL - The heroku url of your hosted app + `/gateway` eg: 'http://snippet.herokuapp.com/gateway`
METHOD - GET
DESCRIPTIVE LABEL - Enter a descriptive label of your choice for your team mates to recognize the integraion.
- And, That's it. You're all set!
There are 6 commands available in total as of now. Their formats are,
To create a new snippet. The syntax is `-n title -c content`.
eg:
cmd - /snippet -n heroku_pg_newBackup -c heroku pg:backups --capture -a APP_NAME
resp - Snippet saved successfully. You can access it by `/snippet -g heroku_pg_newBackup`.
To get a existing snippet. They syntax is `-g title`.
eg:
cmd - /snippet -g heroku_pg_newBackup
resp - heroku pg:backups --capture -a APP_NAME
To edit a existing snippet. The syntax is `-e title -c newContent`. The title wouldn't be editable for now.
eg:
cmd - /snippet -e heroku_pg_newBackup -c heroku pg:backups --capture
resp - Snippet saved successfully. You can access it by `/snippet -g heroku_pg_newBackup`.
To destroy a existing snippet. The action is irreversible. The syntax is `-d title`.
eg:
cmd - /snippet -d heroku_pg_newBackup
resp - Snippet is successfully destroyed. It is un-recoverable.
To search for your snippets.
syntax :- `-s query`
eg:
cmd - /snippet -s heroku
resp - ```
Your Search results:-
1. heroku_pg_backup
2. heroku db_migrate
```
Will give a short summary of the snippets saved.
syntax :- `-r`
resp - Total Snippets Saved - 6
Last Saved Snippet - stackoverflow_memoryleak - 2015-09-10 21:56
- Clone the repo
git clone https://github.com/avinoth/slack-snippet.git
- cd into slack-snippet.
- run
bundle install
. - run
rake db:create && rake db:migrate
- run the app
ruby ./app.rb