zachbr / Dis4IRC

A modern Discord <-> IRC bridge
MIT License
49 stars 16 forks source link

Multiple Discord API connections opened when using multiple IRC connections with same bot #49

Open Phoenix616 opened 3 years ago

Phoenix616 commented 3 years ago

When having the bridge connect with multiple different IRC connections that use the same Discord bot endpoint it still tries to create a connection to the Discord API for both bridges instead of just once resulting in it being ratelimited on first connect:

[17:34:07] [phoenix616] [INFO] - Connecting to Discord API...
[17:34:08] [net.dv8tion.jda.api.JDA] [INFO] - Login Successful!
[17:34:08] [net.dv8tion.jda.internal.requests.WebSocketClient] [INFO] - Connected to WebSocket
[17:34:12] [net.dv8tion.jda.internal.requests.WebSocketClient] [ERROR] - Encountered IDENTIFY Rate Limit!
[17:34:12] [net.dv8tion.jda.internal.requests.WebSocketClient] [WARN] - Got disconnected from WebSocket (Code 1000). Appending to reconnect queue
[17:34:19] [net.dv8tion.jda.internal.requests.WebSocketClient] [INFO] - Connected to WebSocket
[17:34:19] [net.dv8tion.jda.api.JDA] [INFO] - Finished Loading!
zachbr commented 3 years ago

This is kind of a bug and a kind of a feature request. The bridge was never designed to support this. It was very intentional that everything is separate and resources like this not be shared.

It has caused issues with some use cases but never enough to warrant changing properly. This is likely a version 2.0 type request but I am willing to consider it as it has come up in the past.