Skip to content

Commit

Permalink
[Fix] Incorrect ConnectionState of a DiscordSocketClient casted to ID…
Browse files Browse the repository at this point in the history
…iscordClient/BaseSocketClient
  • Loading branch information
Misha-133 committed Feb 26, 2024
1 parent e61d44e commit 955fae0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/Discord.Net.Rest/BaseDiscordClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,13 @@ public Task<int> GetRecommendedShardCountAsync(RequestOptions options = null)
/// <inheritdoc />
public Task<BotGateway> GetBotGatewayAsync(RequestOptions options = null)
=> ClientHelper.GetBotGatewayAsync(this, options);

/// <inheritdoc />
public virtual ConnectionState ConnectionState => ConnectionState.Disconnected;
#endregion

#region IDiscordClient
/// <inheritdoc />
ConnectionState IDiscordClient.ConnectionState => ConnectionState.Disconnected;
/// <inheritdoc />
ISelfUser IDiscordClient.CurrentUser => CurrentUser;

/// <inheritdoc />
Expand Down
4 changes: 2 additions & 2 deletions src/Discord.Net.WebSocket/DiscordSocketClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public partial class DiscordSocketClient : BaseSocketClient, IDiscordClient
public override DiscordSocketRestClient Rest { get; }
/// <summary> Gets the shard of this client. </summary>
public int ShardId { get; }
/// <summary> Gets the current connection state of this client. </summary>
public ConnectionState ConnectionState => _connection.State;
/// <inheritdoc />
public override ConnectionState ConnectionState => _connection.State;
/// <inheritdoc />
public override int Latency { get; protected set; }
/// <inheritdoc />
Expand Down

0 comments on commit 955fae0

Please sign in to comment.