-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Commands "falling through" to other modules / multiple matches on command? #231
Comments
Feature, it has been there for a few of the alpha versions due to an earlier feature request. Logging may now be easier using middleware FYI (it was one of the reasons I added it, cause I wanted a less hacky solution). There is the ability to hook into both |
Is there documentation on middleware?
Okay, I'll give that a try. |
WIP, I would have more if I had more time, it follows a similar format to most other node applications though. Rough example (may have to check the arguments passed to the callback func for exact details): // subscribe
exports.platform.use('<hook>', callbackFunc);
// unsubscribe
exports.platform.unuse('<hook>', callbackFunc);
const callbackFunc = (next, args...) => {
// do stuff, arguments automatically passed unmodified to next middleware
next();
}; can modify arguments: const callbackFunc = (next, arg1,arg2) => {
arg1 = 'foo';
const newArg = 'baz';
next(arg1, arg2, baz);
}; |
Helpful. Is there any middleware that's been developed yet to use as a reference? |
Considering that it has only just been made, no. This is related to #227. Disable and admin may be ported to it if time permits, and maybe a compatibility layer will be added for hubot middleware. |
I was troubleshooting an issue with the "logging module" approach that was discussed in issue #188 that appeared when I switched to 4.0.0-beta.1
The issue appears to be that commands now "fall through" to other modules, or -- put another way -- it's possible to have multiple matches on the same command.
This seems like a major departure from how things work before, which I believe was that once a command matched that no further processing by other modules would happen?
Forgot to add the question: Is this a feature, or a bug?
The text was updated successfully, but these errors were encountered: