File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -133,17 +133,22 @@ module.exports = (robot)->
133
133
catch e
134
134
console .log e
135
135
136
- robot .respond / who (has| have) (. + ) ('s key| 's keys)/ i , (msg )->
136
+ robot .respond / who (has| have) (. + 's) ( key| keys)/ i , (msg )->
137
137
ownerName = msg .match [2 ];
138
+ ownerName = ownerName .substr 0 ,ownerName .length - 2
138
139
users = robot .brain .usersForFuzzyName ownerName
139
140
s = " "
140
141
try
141
142
kh = key ()
142
143
if users .length is 1
144
+ s = " "
143
145
for x in kh
144
146
if x .owner is users[0 ].name
145
147
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
147
152
else if users .length > 1
148
153
msg .send getAmbiguousUserText users
149
154
else
You can’t perform that action at this time.
0 commit comments