-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
DiscordGatewayClient.RunAsync() doesn't seem to be properly disconnecting from the gateway when its CancellationToken is cancelled.
According to the official documentation:
When you close the connection to the gateway with close code 1000 or 1001, your session will be invalidated and your bot will appear offline.
If you simply close the TCP connection or use a different close code, the session will remain active and timeout after a few minutes.
The latter seems to be always happening, no matter what.
Steps to Reproduce
Execute DiscordGatewayClient.RunAsync(), then cancel the CancellationToken passed to it.
RunAsync will stop running, but the bot will still show as online on Discord for a couple of minutes.
Expected Behavior
The bot shuts down and shows as offline on Discord.
Current Behavior
The bot shuts down, but still shows as online on Discord for a couple of minutes.
Library / Runtime Information
.NET: 6.0.110
Remora.Discord: 2022.49.0
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working