Added renaming users and main gw2 accounts

This commit is contained in:
Sarah Faey 2022-11-21 18:27:26 +01:00
parent aad07809d2
commit c4ecb512d7
13 changed files with 172 additions and 22 deletions

View file

@ -156,5 +156,20 @@ namespace DiscordBot.Services
return new ApiRaid();
}
public async Task<List<ulong>> GetUserRenameServers()
{
var httpClient = _httpClientFactory.CreateClient(Constants.HTTP_CLIENT_NAME);
var httpResponseMessage = await httpClient.GetAsync($"DiscordBot/GetUserRenameServers");
if (httpResponseMessage.IsSuccessStatusCode)
{
using var contentStream =
await httpResponseMessage.Content.ReadAsStreamAsync();
return await JsonSerializer.DeserializeAsync<List<ulong>>(contentStream, _serializerOptions);
}
return new List<ulong>();
}
}
}