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

Can't make a ChatEventDataProcessor targetting multiple EventTypes #17

Closed
Regenhardt opened this issue Oct 20, 2019 · 3 comments
Closed
Assignees
Labels
enhancement New feature (request)

Comments

@Regenhardt
Copy link
Contributor

So I wanted to create my own processor that reacts to MessagePosted and MessageEdited, so I put this at the top:

public override EventType Event { get; } = EventType.MessagePosted | EventType.MessageEdited;

After like half an hour debugging, I realize those aren't actually flags.

Can we make them flags, so they are combinable? Or is the plan like "add the existing processor classes and subscribe to the events you want to process"?

@Regenhardt
Copy link
Contributor Author

I'd make it flags, make the "AllEvents" int.MaxValue, and then in the router just ask (event_type & Event)

@ArcticEcho ArcticEcho added the enhancement New feature (request) label Oct 20, 2019
@ArcticEcho ArcticEcho self-assigned this Oct 20, 2019
@ArcticEcho
Copy link
Member

ArcticEcho commented Oct 20, 2019

I had originally designed the system to have one processor per event, hence the lack of flags support. However you raise a good point, I think this would be a good addition to the event system. I'll aim to start working on this some time next week, the event system was due an update anyway I guess.

@ArcticEcho
Copy link
Member

I was unable to make the EventType enumeration support flags, so we're just going to have to put up with using an array of EventTypes instead. Besides that minor issue, everything else has been implemented as requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature (request)
Projects
None yet
Development

No branches or pull requests

2 participants