mirror of
https://onedev.fprog.nl/DiscordClient
synced 2026-02-27 04:53:42 +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<(
|
public async Task<(
|
||||||
HttpResponseMessage Response,
|
HttpResponseMessage Response,
|
||||||
MessageSearchResponse? JsonData
|
MessageSearchResponse? JsonData
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue