https://github.com/buildit/twig-slack-bot
https://github.com/buildit/twig-slack-bot
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/buildit/twig-slack-bot
- Owner: buildit
- Created: 2017-05-09T18:35:46.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-13T21:40:49.000Z (almost 8 years ago)
- Last Synced: 2025-02-04T23:31:06.839Z (3 months ago)
- Language: JavaScript
- Size: 20.5 KB
- Stars: 0
- Watchers: 17
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# twig-slack-bot
This is an example of how [Twig](https://github.com/buildit/twig) can be used to display various Buildit slack channels over the course of a set interval. In this example, that interval is set to 24 hours.
To run locally, clone the repo. Set a Slack API token as a TOKEN variable in .env.
On Twig, create a twiglet with an appropriate model (there is a slack model that exists on [staging](http://staging.twig2.riglet/model/slack)). You can edit the config.js file to change the slack channels, the array range that adjusts the node colors, twiglet name, time interval, slack token, api url, etc. Make sure the twiglet name matches the correct twiglet you want to send events to.
Then run in the terminal:
```Shell
TOKEN=SLACK_TOKEN TWIG_SLACK_API=API_URL node index.js
```
where SLACK_TOKEN is the Slack token and API_URL is either the local or staging Twig API url.An example of a twiglet generated by a slack bot (deployed in the Buildit Riglet): [https://staging-twig.buildit.tools/twiglet/slack-demo](https://staging-twig.buildit.tools/twiglet/slack-demo)
To see another example of creating events via API (not using the Slack api) check out [https://github.com/buildit/twig/wiki/Creating-events-via-API-(nodeJS-using-request-promise-native)](https://github.com/buildit/twig/wiki/Creating-events-via-API-(nodeJS-using-request-promise-native))