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

Is there a way to have 2 message listeners #79

Closed
Kongolan opened this issue Mar 20, 2019 · 2 comments
Closed

Is there a way to have 2 message listeners #79

Kongolan opened this issue Mar 20, 2019 · 2 comments

Comments

@Kongolan
Copy link

I'm running a webhook and bot merged together, so only passing commands with prefix through the message listener is not the best option for. Editing the message.js is not the best way to achieve those different type of listeners, so the optimal way would be to have 2 message.js, one for the webhook and one for the commands with prefix.

Is there any way to do this, with the module setup?

@eslachance
Copy link
Contributor

I don't know why you'd think using message.js would be the wrong way to do it - that's precisely what message.js is meant to be used for - receiving all the messages. Guidebot doesn't have the capacity to load 2 different message events, but you could just add your own client.on("messages" in the main file if that's what you want.

@Kongolan
Copy link
Author

Yes, i figured that too. Just old conventions for me to have very different checks and functionality not in the same file with ifs. But yes i figured I could just call client.on once again, dirty way still, but what else should i do. Thanks for the reply. Can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants