feature: Added a Rest property to DiscordShardedClient (#1326)
* Added a Rest property to DiscordShardedClient * Moved the rest client onto the BaseSocketClient
This commit is contained in:
committed by
Christopher F
parent
c864f48c3b
commit
9fede346d3
@@ -36,6 +36,11 @@ namespace Discord.WebSocket
|
|||||||
/// </returns>
|
/// </returns>
|
||||||
public abstract IActivity Activity { get; protected set; }
|
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;
|
internal new DiscordSocketApiClient ApiClient => base.ApiClient as DiscordSocketApiClient;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -37,6 +37,11 @@ namespace Discord.WebSocket
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override IReadOnlyCollection<RestVoiceRegion> VoiceRegions => _shards[0].VoiceRegions;
|
public override IReadOnlyCollection<RestVoiceRegion> VoiceRegions => _shards[0].VoiceRegions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Provides access to a REST-only client with a shared state from this client.
|
||||||
|
/// </summary>
|
||||||
|
public override DiscordSocketRestClient Rest => _shards[0].Rest;
|
||||||
|
|
||||||
/// <summary> Creates a new REST/WebSocket Discord client. </summary>
|
/// <summary> Creates a new REST/WebSocket Discord client. </summary>
|
||||||
public DiscordShardedClient() : this(null, new DiscordSocketConfig()) { }
|
public DiscordShardedClient() : this(null, new DiscordSocketConfig()) { }
|
||||||
/// <summary> Creates a new REST/WebSocket Discord client. </summary>
|
/// <summary> Creates a new REST/WebSocket Discord client. </summary>
|
||||||
|
|||||||
@@ -44,8 +44,10 @@ namespace Discord.WebSocket
|
|||||||
private RestApplication _applicationInfo;
|
private RestApplication _applicationInfo;
|
||||||
private bool _isDisposed;
|
private bool _isDisposed;
|
||||||
|
|
||||||
/// <summary> Provides access to a REST-only client with a shared state from this client. </summary>
|
/// <summary>
|
||||||
public DiscordSocketRestClient Rest { get; }
|
/// 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>
|
/// <summary> Gets the shard of of this client. </summary>
|
||||||
public int ShardId { get; }
|
public int ShardId { get; }
|
||||||
/// <summary> Gets the current connection state of this client. </summary>
|
/// <summary> Gets the current connection state of this client. </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user