mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-17 03:00:13 +00:00
feat: specify custom Discord base URL
for use with twilight_http_proxy or similar
This commit is contained in:
parent
14b0e98791
commit
b430446171
4 changed files with 19 additions and 14 deletions
|
|
@ -13,11 +13,12 @@ namespace Myriad.Rest
|
|||
public class DiscordApiClient
|
||||
{
|
||||
public const string UserAgent = "DiscordBot (https://github.com/xSke/PluralKit/tree/main/Myriad/, v1)";
|
||||
private const string DefaultApiBaseUrl = "https://discord.com/api/v9";
|
||||
private readonly BaseRestClient _client;
|
||||
|
||||
public DiscordApiClient(string token, ILogger logger)
|
||||
public DiscordApiClient(string token, ILogger logger, string? baseUrl = null)
|
||||
{
|
||||
_client = new BaseRestClient(UserAgent, token, logger);
|
||||
_client = new BaseRestClient(UserAgent, token, logger, baseUrl ?? DefaultApiBaseUrl);
|
||||
_client.OnResponseEvent += OnResponseEvent;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue