UNPKG

1.78 kBMarkdownView Raw
1# hubot-eavesdrop [![Build Status](https://img.shields.io/travis/catops/hubot-eavesdrop.svg?maxAge=2592000&style=flat-square)](https://travis-ci.org/catops/hubot-eavesdrop.svg?branch=master) [![npm](https://img.shields.io/npm/v/hubot-eavesdrop.svg?maxAge=2592000&style=flat-square)](https://www.npmjs.com/package/hubot-eavesdrop)
2
3A hubot script to have your bot respond to specified keywords.
4
5See [`src/eavesdrop.coffee`](src/eavesdrop.coffee) for full documentation.
6
7![hubot-eavesdrop screenshot](screenshot.png)
8
9## Installation
10
11In hubot project repo, run:
12
13`npm install hubot-eavesdrop --save`
14
15Then add **hubot-eavesdrop** to your `external-scripts.json`:
16
17```json
18["hubot-eavesdrop"]
19```
20
21## Sample Interaction
22
23```
24user1>> hubot when you hear slow clap respond with http://i.imgur.com/0mKXcg1.gif
25user1>> slow clap
26hubot>> http://i.imgur.com/0mKXcg1.gif
27
28user1>> hubot stop listening for slow clap
29hubot>> Okay, I will ignore slow clap.
30```
31
32Also supports regular expressions.
33
34```
35user1>> hubot when you hear slow\s?clap(ping)? respond with http://i.imgur.com/0mKXcg1.gif
36user1>> slow clapping
37hubot>> http://i.imgur.com/0mKXcg1.gif
38user1>> slowclap
39hubot>> http://i.imgur.com/0mKXcg1.gif
40```
41
42Multiple responses can be specified for a single keyword.
43
44```
45user1>> hubot when you hear slow clap respond with 1|congrats!; 2|http://i.imgur.com/0mKXcg1.gif
46user1>> slow clap
47hubot>> congrats!
48hubot>> http://i.imgur.com/0mKXcg1.gif
49```
50
51To reduce channel noise, keywords only trigger events once every thirty seconds.
52The length of this delay can be changed by setting a `HUBOT_EAVESDROP_DELAY` environment variable.
53
54----
55
56## Open source licensing info
571. [TERMS](TERMS.md)
582. [LICENSE](LICENSE)
593. [CFPB Source Code Policy](https://github.com/cfpb/source-code-policy/)