mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 06:00:46 +00:00
Add !level command (#946)
* add !level command * Added blank lines * Fix https://github.com/JustArchiNET/ArchiSteamFarm/pull/946 * Fix №2 https://github.com/JustArchiNET/ArchiSteamFarm/pull/946
This commit is contained in:
committed by
Łukasz Domeradzki
parent
c6ad260e81
commit
ab6ce7c7e5
@@ -213,6 +213,34 @@ namespace ArchiSteamFarm {
|
||||
return body.chat_group_summary.chat_group_id;
|
||||
}
|
||||
|
||||
internal async Task<uint?> GetLevel() {
|
||||
if (!Client.IsConnected) {
|
||||
return null;
|
||||
}
|
||||
|
||||
CPlayer_GetGameBadgeLevels_Request request = new CPlayer_GetGameBadgeLevels_Request { };
|
||||
SteamUnifiedMessages.ServiceMethodResponse response;
|
||||
|
||||
try {
|
||||
response = await UnifiedPlayerService.SendMessage(x => x.GetGameBadgeLevels(request));
|
||||
} catch (Exception e) {
|
||||
ArchiLogger.LogGenericWarningException(e);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (response == null) {
|
||||
ArchiLogger.LogNullError(nameof(response));
|
||||
return null;
|
||||
}
|
||||
|
||||
if (response.Result != EResult.OK) {
|
||||
return null;
|
||||
}
|
||||
|
||||
CPlayer_GetGameBadgeLevels_Response body = response.GetDeserializedResponse<CPlayer_GetGameBadgeLevels_Response>();
|
||||
return body.player_level;
|
||||
}
|
||||
|
||||
internal async Task<HashSet<ulong>> GetMyChatGroupIDs() {
|
||||
if (!Client.IsConnected) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user