UNPKG

1.54 kBMarkdownView Raw
1# hubot-eavesdrop
2
3A hubot script to perform actions when user-specified keywords are mentioned. Based on [eardropping.coffee](https://github.com/github/hubot-scripts/blob/master/src/scripts/eardropping.coffee).
4
5See [`src/eavesdrop.coffee`](src/eavesdrop.coffee) for full documentation.
6
7## Installation
8
9In hubot project repo, run:
10
11`npm install hubot-eavesdrop --save`
12
13Then add **hubot-eavesdrop** to your `external-scripts.json`:
14
15```json
16["hubot-eavesdrop"]
17```
18
19## Sample Interaction
20
21```
22user1>> hubot when you hear slow clap do echo http://i.imgur.com/0mKXcg1.gif
23user1>> slow clap
24hubot>> http://i.imgur.com/0mKXcg1.gif
25
26user1>> hubot stop listening for slow clap
27hubot>> Okay, I will ignore slow clap.
28```
29
30Also supports regular expressions.
31
32```
33user1>> hubot when you hear slow\s?clap(ping)? do echo http://i.imgur.com/0mKXcg1.gif
34user1>> slow clapping
35hubot>> http://i.imgur.com/0mKXcg1.gif
36user1>> slowclap
37hubot>> http://i.imgur.com/0mKXcg1.gif
38```
39
40Multiple actions can be specified for a single keyword.
41
42```
43user1>> hubot when you hear slow clap do 1|echo congrats!; 2|echo http://i.imgur.com/0mKXcg1.gif
44user1>> slow clap
45hubot>> congrats!
46hubot>> http://i.imgur.com/0mKXcg1.gif
47```
48
49To reduce channel noise, keywords only trigger events once every thirty seconds.
50The length of this delay can be changed by setting a `HUBOT_EAVESDROP_DELAY` environment variable.
51
52----
53
54## Open source licensing info
551. [TERMS](TERMS.md)
562. [LICENSE](LICENSE)
573. [CFPB Source Code Policy](https://github.com/cfpb/source-code-policy/)