https://github.com/makerbot/slackbot
MakerBot's basic SlackBot
https://github.com/makerbot/slackbot
nodejs npm-package slack slackbot web
Last synced: 5 months ago
JSON representation
MakerBot's basic SlackBot
- Host: GitHub
- URL: https://github.com/makerbot/slackbot
- Owner: makerbot
- License: isc
- Created: 2015-09-02T02:44:17.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2016-01-22T23:05:07.000Z (over 10 years ago)
- Last Synced: 2025-09-01T00:05:54.322Z (10 months ago)
- Topics: nodejs, npm-package, slack, slackbot, web
- Language: JavaScript
- Size: 17.6 KB
- Stars: 0
- Watchers: 5
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[](https://badge.fury.io/js/slackbase)
[](https://travis-ci.org/makerbot/slackbot)
[](https://david-dm.org/makerbot/slackbot)
### Usage by example
```sh
npm install --save slackbase
```
```js
const Bot = require('slackbase')
, bot = new Bot('SLACK-TOKEN-HERE')
;
bot.listen(/good night/).permit(message => {
// only reply if after 17:00 and message is a DM
const now = new Date();
return message.isDM() && now.getHours() >= 17;
}).action(message => {
const user = message.getUser();
const channel = message.getChannel();
channel.send(`sleep tight, ${user.name}`);
});
```
### Running tests
```sh
git clone https://github.com/makerbot/slackbot.git
cd slackbot
npm install
npm test
```
Can also see status on https://travis-ci.org/makerbot/slackbot
### FAQ
*Why is the NPM package titled `slackbase` but the repo `slackbot`?*
Well, every variation of `slackbot` is already claimed on NPM, but `slackbot` makes the most sense for what this project is.