-
Notifications
You must be signed in to change notification settings - Fork 421
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
How to multiple server connections at the same time #434
Comments
The current implementation handles 1 server per client created. If you create another client in your code, then you'll have two bots connected to two servers. |
@del6597 yeah that did I see but how can I make that both clients can use the same function? Is this in any way possible? |
@MTRNord You could just make your own Something like this maybe: var client1 = Client(...);
var client2 = Client(...);
var clients = [client1, client2];
function addListener(event, callback) {
clients.forEach(function(client) {
client.addListener(event, callback);
});
} |
@jirwin i will try that :) thanks for the idea |
@jirwin seems to work but hackint.org is sadly kicking the bot sometimes with "quit: Excess Flood" :/ |
@MTRNord try enabling the floodControl option in the config. |
@jirwin that seems to help :) hopefully i can speed up the forEach. it slows the bot extremly down |
@MTRNord do you have a code snippet you can share? I wouldn't expect things to slow dow much(other than flood control doing its thing) |
@jirwin https://github.com/MTRNord/nordlab-hackerspace-door/blob/v0.0.2/handlers/irc.js |
Closing this. |
Hi I want to have the client connected to multiple servers without writing the hole handling stuff all over again. Are there any ways to do so?
The text was updated successfully, but these errors were encountered: