Skip to content
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

Middleware listening on enter aswell #1015

Closed
vongohren opened this issue Jul 31, 2015 · 3 comments
Closed

Middleware listening on enter aswell #1015

vongohren opened this issue Jul 31, 2015 · 3 comments

Comments

@vongohren
Copy link

I would just like to inform @michaelansel that the robot is running the middleware on the enter command aswell.
And in hipchat adapter, it runs the enter command for all users when joining a room.
Dont know if you want it to listen to enter or not?

@michaelansel
Copy link
Collaborator

Yes, that is expected behavior; middleware will execute for every matched Listener (regardless of type). If you want to filter, check to see what type of message is being processed (just like the core does for routing). If this is a common need, I'll see about adding a helper to match the current Listener creation helpers.

(definitely an interesting use case I didn't consider)

@technicalpickles
Copy link
Member

I have run into this too. I think there could be more explicit details on there, and the example documentation should demonstrate that, as that's the kind of listener most people are going to be using.

@stale
Copy link

stale bot commented May 30, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot closed this as completed Jun 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants