Browse Source

Moved the rest client onto the BaseSocketClient

pull/1326/head
Casino Boyale 6 years ago
parent
commit
20c8dd8988
3 changed files with 10 additions and 3 deletions
  1. +5
    -0
      src/Discord.Net.WebSocket/BaseSocketClient.cs
  2. +1
    -1
      src/Discord.Net.WebSocket/DiscordShardedClient.cs
  3. +4
    -2
      src/Discord.Net.WebSocket/DiscordSocketClient.cs

+ 5
- 0
src/Discord.Net.WebSocket/BaseSocketClient.cs View File

@@ -36,6 +36,11 @@ namespace Discord.WebSocket
/// </returns>
public abstract IActivity Activity { get; protected set; }

/// <summary>
/// Provides access to a REST-only client with a shared state from this client.
/// </summary>
public abstract DiscordSocketRestClient Rest { get; }

internal new DiscordSocketApiClient ApiClient => base.ApiClient as DiscordSocketApiClient;

/// <summary>


+ 1
- 1
src/Discord.Net.WebSocket/DiscordShardedClient.cs View File

@@ -40,7 +40,7 @@ namespace Discord.WebSocket
/// <summary>
/// Provides access to a REST-only client with a shared state from this client.
/// </summary>
public DiscordSocketRestClient Rest => _shards[0].Rest;
public override DiscordSocketRestClient Rest => _shards[0].Rest;

/// <summary> Creates a new REST/WebSocket Discord client. </summary>
public DiscordShardedClient() : this(null, new DiscordSocketConfig()) { }


+ 4
- 2
src/Discord.Net.WebSocket/DiscordSocketClient.cs View File

@@ -44,8 +44,10 @@ namespace Discord.WebSocket
private RestApplication _applicationInfo;
private bool _isDisposed;

/// <summary> Provides access to a REST-only client with a shared state from this client. </summary>
public DiscordSocketRestClient Rest { get; }
/// <summary>
/// Provides access to a REST-only client with a shared state from this client.
/// </summary>
public override DiscordSocketRestClient Rest { get; }
/// <summary> Gets the shard of of this client. </summary>
public int ShardId { get; }
/// <summary> Gets the current connection state of this client. </summary>


Loading…
Cancel
Save