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

How to use Discord's reconnection mechanism? #1502

Open
linliyuan opened this issue Feb 28, 2024 · 0 comments
Open

How to use Discord's reconnection mechanism? #1502

linliyuan opened this issue Feb 28, 2024 · 0 comments

Comments

@linliyuan
Copy link

I found that there is relevant information in the documentation https://discord.com/developers/docs/topics/gateway#resuming, but there is no corresponding implementation method in the third-party package. Can this recovery mechanism be added? Currently, sessionID, sequence, and gateway are all private, which prevents me from obtaining the last sequence of websocket events. The adjustments needed are quite large. I saw that there were several merge requests related to this, what was the reason for finally closing them?
merge requests:
#1327
#1115

And the following piece of code is quite strange, the reconnection judgment is before ready, which inevitably leads to the sessionID and sequence in the newly created session being 0. Send Op 6 Resume Packet can only possibly be executed in the case of a reconnect.

image

The current background is: the program cannot always run normally. If the service encounters an exception, I hope that the unprocessed data during the restart can be re-obtained through the recovery mechanism.

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

1 participant