Fix: Don't depend on WebSocket for Interaction service (#2912)
* unfuck interaction service to not depend on WS * Add XML docs * fix summary refs
This commit is contained in:
@@ -15,7 +15,7 @@ namespace Discord.Rest
|
||||
/// <summary>
|
||||
/// Provides a client to send REST-based requests to Discord.
|
||||
/// </summary>
|
||||
public class DiscordRestClient : BaseDiscordClient, IDiscordClient
|
||||
public class DiscordRestClient : BaseDiscordClient, IDiscordClient, IRestClientProvider
|
||||
{
|
||||
#region DiscordRestClient
|
||||
private RestApplication _applicationInfo;
|
||||
@@ -399,5 +399,7 @@ namespace Discord.Rest
|
||||
async Task<IReadOnlyCollection<IApplicationCommand>> IDiscordClient.BulkOverwriteGlobalApplicationCommand(ApplicationCommandProperties[] properties, RequestOptions options)
|
||||
=> await BulkOverwriteGlobalCommands(properties, options).ConfigureAwait(false);
|
||||
#endregion
|
||||
|
||||
DiscordRestClient IRestClientProvider.RestClient => this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,5 +118,9 @@ namespace Discord.Rest
|
||||
//IAutocompleteInteraction
|
||||
/// <inheritdoc/>
|
||||
IAutocompleteInteractionData IAutocompleteInteraction.Data => Data;
|
||||
|
||||
/// <inheritdoc/>
|
||||
Task IAutocompleteInteraction.RespondAsync(IEnumerable<AutocompleteResult> result, RequestOptions options)
|
||||
=>Task.FromResult(Respond(result, options));
|
||||
}
|
||||
}
|
||||
|
||||
14
src/Discord.Net.Rest/IRestClientProvider.cs
Normal file
14
src/Discord.Net.Rest/IRestClientProvider.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Discord.Rest;
|
||||
|
||||
namespace Discord.Rest;
|
||||
|
||||
/// <summary>
|
||||
/// An interface that represents a client provider for Rest-based clients.
|
||||
/// </summary>
|
||||
public interface IRestClientProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the Rest client of this provider.
|
||||
/// </summary>
|
||||
DiscordRestClient RestClient { get; }
|
||||
}
|
||||
Reference in New Issue
Block a user