-
-
Notifications
You must be signed in to change notification settings - Fork 2
An idea for generic "hooks" #32
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
Comments
Would it not be a lot simpler to perhaps just have a custom handler for Option 1: Add a option on clientOptions to have a custom // Register the message event listener
this.on('messageCreate', this.customMessageHandler || this.handleMessage); Option 2: (My preferance) Just remove the I don't think it's worth making Yuuko overcomplicated trying to solve 100 different things. the best part about Yuuko for me is that it is lean and simple like eris. No heavyweight stuff. It is a framework that just helps you get off the ground. If you want special complex stuff you should just have the ability to extend and overwrite it in your own code. |
I'll definitely remove |
I've decided the way I'm gonna handle this for the command handler case is just by using a static method as a "default message handler" and provide a client option to disable registering that handler automatically. That way, we don't have to worry about "hooks" or reworking the existing events system, you can just provide your own I'm in the process of breaking out command handling into its own method so you should be able to use the built-in parsing logic with a single call inside a custom |
Uh oh!
There was an error while loading. Please reload this page.
I have an idea for adding generic "hooks" to the bot that can run code when certain things happen (like events) and influence the execution flow by returning values (not like events). This needs research, but the idea is to have an event-like system that doesn't just emit when things happen, but also has the capability of asking the library consumer for information when it needs it.
Areas where this would be useful:
handleMessage
method (which is currently run from insidemessageCreate
event) that lets you return a specific value if you don't want to execute commands from the created message. Or something like that.Things to think about:
The text was updated successfully, but these errors were encountered: