forked from esod/dorman-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweb.js
22 lines (18 loc) · 732 Bytes
/
web.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var ack = require('ac-koa').require('hipchat');
var pkg = require('./package.json');
var app = ack(pkg);
var addon = app.addon()
.hipchat()
.allowRoom(true)
.scopes('send_notification');
addon.webhook('room_message', /@[Dd]orman/, function *() {
var phrases = [
"Poor Prontos, meet me at their steps for a memorial on 7/20/2016 at 5:00 PM Eastern sharp. Then we go to O'Lunneys.",
"I left the company to pursue my dreams. If you need to reach me, I'll be sitting on my couch drinking whiskey and yelling at my TV.",
"Let me google that for you.",
"WordWhat?",
"I love Druuuu-pall!"
];
yield this.roomClient.sendNotification(phrases[Math.floor(Math.random() * phrases.length)]);
});
app.listen();