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.

DefaultRestClientProvider.cs 674 B

123456789101112131415161718192021222324
  1. using System;
  2. namespace Discord.Net.Rest
  3. {
  4. public static class DefaultRestClientProvider
  5. {
  6. public static readonly RestClientProvider Instance = Create();
  7. public static RestClientProvider Create(bool useProxy = false)
  8. {
  9. return url =>
  10. {
  11. try
  12. {
  13. return new DefaultRestClient(url, useProxy);
  14. }
  15. catch (PlatformNotSupportedException ex)
  16. {
  17. throw new PlatformNotSupportedException("The default RestClientProvider is not supported on this platform.", ex);
  18. }
  19. };
  20. }
  21. }
  22. }