mirror of
https://onedev.fprog.nl/DiscordClient
synced 2025-12-29 10:18:36 +01:00
Added methods for obtaining profile information.
This commit is contained in:
parent
a2cb0f1e3f
commit
55a94e7cb3
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue