1 | # Description:
|
2 | # Hubot script to display "I have no idea what I'm doing" images
|
3 | #
|
4 | # Dependencies:
|
5 | # None
|
6 | #
|
7 | # Configuration:
|
8 | # None
|
9 | #
|
10 | # Commands:
|
11 | # you have no idea what you're doing
|
12 | #
|
13 | # Notes
|
14 | # None
|
15 | #
|
16 | # Author:
|
17 | # Morgan Wigmanich <okize123@gmail.com> (https://github.com/okize)
|
18 |
|
19 | module.exports = (robot) ->
|
20 | robot.hear regex, (msg) ->
|
21 | msg.send msg.random images
|
22 |
|
23 | images = require './data/images.json'
|
24 |
|
25 | gaffes = [
|
26 | 'i ha(ve|s) no idea',
|
27 | 'i don\'t know',
|
28 | '\\b(wh|)oops(|ie)\\b',
|
29 | 'my (bad|mistake|fault)',
|
30 | 'd(\')oh'
|
31 | ]
|
32 |
|
33 | regex = new RegExp gaffes.join('|'), 'ig'
|