-
Notifications
You must be signed in to change notification settings - Fork 6
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
restore some kind of global callback functionality #76
Comments
I've just migrated to this module for the improvements over the original, just realised I am actually missing this feature and have some broken functionality. I'm going to specifically add callbacks for the commands I'm handling but would be good to reintroduce this once I can. |
Thanks for the report, it's great to have feedback from real-world projects using the library :-) I was leaning towards option (2) which wouldn't have directly addressed your use case. It sounds like you were able to fix the issue by enumerating the relevant commands and manually calling |
I'd like to have a callback for unhandled commands/replies that don't have a callback set. This makes it possible to display all IRC commands coming in for a client even if it doesn't necessarily understand them but avoids them being lost in the void. So something like Additionally having a catch-all for all events would help with custom loggers where the downstream developer would want to log all incoming IRC events in a structured manner. I would like to use such as well but it's not a strict requirement because I can set a logger for the connection that will already get the raw lines logged. Having it separately as a |
I started work on this. I'm currently planning to add two new APIs:
|
thoj/ircevent (which we forked from) allowed passing
*
as the command name toAddCallback
, in which case the callback would apply to all events. I removed this when I forked because I didn't see a clear use case at the time.Possibilities:
(*ircmsg.Message).Command
, this DRY's the enumeration of the possible commands betweenAddHandler
and the handler itself.)The text was updated successfully, but these errors were encountered: