You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

HttpClientFactoryClientProvider.cs 701 B

123456789101112131415161718192021222324252627
  1. using Discord.Net.Rest;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Net.Http;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace Discord.Rest.Net
  9. {
  10. public class HttpClientFactoryRestClientProvider
  11. {
  12. public readonly RestClientProvider Instance;
  13. private readonly IHttpClientFactory _httpClientFactory;
  14. public HttpClientFactoryRestClientProvider(IHttpClientFactory httpClientFactory)
  15. {
  16. _httpClientFactory = httpClientFactory;
  17. Instance = url => new HttpClientFactoryRestClient(url, _httpClientFactory.CreateClient("HttpClientFactoryRestClientProvider"), useProxy: false);
  18. }
  19. }
  20. }