question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ConnectionState (DiscordSocketClient) stuck on Disconnected

See original GitHub issue

With 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:closed
  • Created 7 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
foxbotcommented, Mar 10, 2017

Resolved as of bb78c50b6f6b2b0b56f6f68d4844c8e8ed6b25cf

0reactions
Jofairdencommented, Feb 28, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found