Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johnhof/skynet
A framework for slack bots
https://github.com/johnhof/skynet
Last synced: 20 days ago
JSON representation
A framework for slack bots
- Host: GitHub
- URL: https://github.com/johnhof/skynet
- Owner: johnhof
- Created: 2015-07-10T01:46:00.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-07-10T08:20:39.000Z (over 9 years ago)
- Last Synced: 2024-10-05T01:41:14.378Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 133 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Skynet
A framework for slack bots
# Getting started
- Install the latest node (`--harmony` is required)
- Fork skynet
- Clone Fork
- `npm Install`
- `npm start`# Adding a New Bot
- Add a new [outgoing web hook](https://api.slack.com/outgoing-webhooks) configured to your liking
- Create a file/bot handler in the bot directory (we'll assume its _foo.js_)
- Add the bot config to your json files (make sure the name match's the name of your file)```
{
"bots" : [{
"name" : "foo",
"tokens" : {
"incoming" : "[TOKEN_FROM_HOOK]"
}
}]
}```
- deploy
- enjoyKeep in mind that bots are routed by the POST'ed token
# Utilities
A few utilities have been added for convenience
```javascript
module.exports = function *() {
if (this.request.body.text ==='hello bot') {
this.respond('hello human'); // sends the text as { text: text } (required for slack parsing)
} else {
this.error(400, 'OH NO!') // sends the error as { error: text } (ignored by slack, for testing only)
}
}
```# Author
- John Hofrichter
# Liscense
**[MIT](/LISCENSE)**