Comments (9)
Isn't that expected? It can't resolve because there's no internet connection?
from discord4j.
@theIglooo shouldn't it keep trying to reconnect instead of throwing exception, just for such case? At least isn't that what withReconnects() method for, preventing any manual reconnecting situation such as losing connection for a sec?
from discord4j.
There is no way the bot can even attempt to connect to discord if it can't lookup the IP address to connect to. Simple as that.
If it was going to keep on reconnecting (assuming the IP address is cached), you will eventually get a Connection refused
or Connection timed out
IOException.
from discord4j.
@LolDatSec at least it should run the same code chunk to prevent such case, instead of terminating the process.
EDIT: Also I can't handle that exception which gives me no other option than manually reconnecting. The reason I can't handle it because it is threw in the lib codes.
from discord4j.
@iGoodie That's not why you can't handle it, it's an unchecked exception. If that was case then you wouldn't be catching MissingPermissionsExceptions or any of those. I don't know what you want it to do, even if it hopelessly tries to reconnect it'll stop after the 3rd(?).
from discord4j.
When the lib encounters an error with the websocket, it is unrecoverable. You can try to login again later but a websocket error like this means that there is no use in trying to reconnect because the websocket wouldn't work correctly. And this is not something I can fix as all that code is internally Jetty Websocket's. And as previously mentioned, you have no internet connection so there's no use in reconnecting.
from discord4j.
Additionally, reconnects are mostly meant to reconnect to Discord after getting disconnected for some reason by Discord as Discord's cloudflare likes to randomly disconnect clients.
from discord4j.
Ummm but imagine that I lost my connection just for a second, then there is an use in trying to reconnect. Just like any application (like Discord) reconnects after you got your connection back.
from discord4j.
Yes, but it did try to reconnect. Additionally, you can still handle this yourself if the auto reconnect feature failed by listening for the DiscordDisconnectedEvent.
from discord4j.
Related Issues (20)
- Support for SKU/Entitlements (Premium Apps) HOT 1
- Jackson Error when entering DM channel option in slash command HOT 2
- Long response to buttons HOT 2
- getParent in a ThreadChannel return a cast error HOT 5
- Add support for `thread_id` and `thread_name` in webhook execution
- Bot freezes after about 100 button presses and many button presses are missed HOT 8
- Issue with Receiving Messages in Threads
- Add support for the `enforce_nonce` parameter on message creation HOT 1
- Add support for the `applied_tags` parameter on webhooks
- Use `emoji_id`, `emoji_name` and `emoji_animated` fields instead of `emoji` in onboarding prompt creation or update
- Add support for the Get and Edit Current Application endpoints
- Add missing fields in the `ApplicationInfo` object HOT 1
- Fix the `PositionModifyRequest` object and the "Modify Guild Channel Positions" request
- Rename the sticker pack route as it is no longer required to have a nitro subscription
- Add support for the `GUILD_MEDIA` channel type
- Add some utilities to mention the guild navigation channels HOT 3
- Add missing audit log events HOT 1
- Replace the `Guild#getFeatures` return value to a `FeatureSet` instead of a `Set<String>` HOT 2
- Dependency com.discord4j:stores-api in /common module seems to be in the wrong scope.
- Support Java 21 in CI
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from discord4j.