You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Selfbot.NET/Discord.NET/Discord.Net.Rest/Net/DefaultRestClientProvider.cs

26 lines
812 B

using System;
namespace Discord.Net.Rest
{
public static class DefaultRestClientProvider
{
public static readonly RestClientProvider Instance = Create();
/// <exception cref="PlatformNotSupportedException">The default RestClientProvider is not supported on this platform.</exception>
public static RestClientProvider Create(bool useProxy = false)
{
return url =>
{
try
{
return new DefaultRestClient(url, useProxy);
}
catch (PlatformNotSupportedException ex)
{
throw new PlatformNotSupportedException("The default RestClientProvider is not supported on this platform.", ex);
}
};
}
}
}