Closed cycomachead closed 8 years ago
You probably use alias for your hubot and it is short-name for Alonzo?
There is a bug in Hubot which causes the same issues for me. See https://github.com/github/hubot/pull/927
I think this is because there are two regex which match the above message.
The first reply is caused by /@?(.+) ha(s|ve) (["'\w: -_]+) role/i
and
the second reply is caused by /who has (["'\w: -_]+) role\?*$/i
.
I didn't know regex matches more than once...
Ran into this again... Considering attempting a fix.
I'm assuming the more specific regex should always be matched. (In the example provided the intention was the second command to be run.)
In this example:
Michael: I don't have deploy role
Alonzo Church: @Michael OK, Michael Ball doesn't have the 'deploy' role.
@Michael I don't does not exist
The first one should be the only regex matched, right?
I know with Middleware there is a way to prevent multiple middlewae functions from executing, but I can't tell what happens for listener regex's.
See this shell output, the first message is unnecessary: