-
Notifications
You must be signed in to change notification settings - Fork 0
/
cybernetic.coffee
31 lines (26 loc) · 911 Bytes
/
cybernetic.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Description
# Allows hubot to identify itself to users when asked who or what it is.
#
# Configuration:
# None
#
# Commands:
# hubot who are you? - hubot identifies itself
# hubot what are you? - hubot identifies itself
# who is hubot? - hubot idenfities itself
# what is hubot? - hubot identifies itself
# what's a hubot? - hubot identifies itself
#
# Notes:
# Just a fun little script to get me started with Hubot scripts.
#
# Author:
# Chris Coveney <[email protected]>
module.exports = (robot) ->
responseString = "I am #{robot.name}. I'm a cybernetic organism. Living tissue
over a metal endoskeleton. My mission is to protect you."
robot.respond /(who|what) are you/i, (res) ->
res.send responseString
hearRegExp = new RegExp "(who|what|what's) (is|a) #{robot.name}", "i"
robot.hear hearRegExp, (res) ->
res.send responseString