Added methods for obtaining profile information.

This commit is contained in:
Filip Strajnar 2024-06-16 19:15:08 +02:00
parent a2cb0f1e3f
commit 55a94e7cb3

View file

@ -19,6 +19,18 @@ public class DiscordUserClient
);
}
public async Task<ShortProfile?> GetShortProfile(string userId)
{
string url = $"https://discord.com/api/v9/users/{userId}";
HttpResponseMessage response = await _httpClient.GetAsync(url);
return await response.Content.ReadFromJsonAsync<ShortProfile>();
}
public async Task<ShortProfile?> MyShortProfile()
{
return await GetShortProfile("@me");
}
public async Task<(
HttpResponseMessage Response,
MessageSearchResponse? JsonData