Skip to content

Commit 34d8208

Browse files
committed
fix key holders list
1 parent e236a1f commit 34d8208

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

scripts/keys.coffee

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,22 @@ module.exports = (robot)->
133133
catch e
134134
console.log e
135135

136-
robot.respond /who (has|have) (.+) ('s key|'s keys)/i , (msg)->
136+
robot.respond /who (has|have) (.+'s) (key|keys)/i , (msg)->
137137
ownerName = msg.match[2];
138+
ownerName =ownerName.substr 0,ownerName.length-2
138139
users = robot.brain.usersForFuzzyName ownerName
139140
s = ""
140141
try
141142
kh = key()
142143
if users.length is 1
144+
s=""
143145
for x in kh
144146
if x.owner is users[0].name
145147
s = "#{x.owner} keys are with #{x.holder}"
146-
msg.send s
148+
if s is ""
149+
msg.send "Ah! Nobody informed me about the keys."
150+
else
151+
msg.send s
147152
else if users.length > 1
148153
msg.send getAmbiguousUserText users
149154
else

0 commit comments

Comments
 (0)