ConnectionState (DiscordSocketClient) stuck on Disconnected
See original GitHub issueWith the following code, my bot is permanently on DnD mode, even with ping lower than 500. This is hooked up to the client.LatencyUpdated event Build: 1.0.0-rc-00610
private async Task Client_LatencyUpdated(int i, int j)
{
if (client == null) return;
await client.SetStatusAsync(
//maintenanceMode ? UserStatus.DoNotDisturb :
(client.ConnectionState == ConnectionState.Connecting || j > 250) ? UserStatus.Idle
: (client.ConnectionState == ConnectionState.Disconnected || j > 500) ? UserStatus.DoNotDisturb
: UserStatus.Online);
//await client.SetGameAsync(/*maintenanceMode ? "maintenance" : */"Terraria");
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Discord Keeps Disconnecting and Reconnecting? 15 Ways ...
Go through the solutions below to fix Discord disconnects and call drops on PC. Table of Contents. 1. Check the Discord Server Status;...
Read more >Managing Connections | Discord.Net Documentation
All clients provide a Connected and Disconnected event, which is raised respectively when a connection opens or closes.
Read more >Discord.Net
Hey, I just have a question: Is it normal for my bot to keep getting disconnected by the remotehost forcefully closing the connection...
Read more >Discord stuck in a connect-disconnect loop : r/discordapp
We're stuck at "Connecting" in our voice channels. Text channels work fine.
Read more >How To Fix Discord Disconnecting Issue In 2022 | 7 Methods
How to Fix Discord Keeps Disconnecting and Reconnecting. Method 1. Run Discord as an Administrator. Method 2. Change Call Server Region.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Resolved as of bb78c50b6f6b2b0b56f6f68d4844c8e8ed6b25cf
Good thought, can indeed be an issue with SetStatus itself, didn’t think about it… For some more info, this started happening after I updated from build 1.0.0-rc-00606 to build 1.0.0-rc-00610 , so it happened somewhere between those builds.