Skip to content

Commit

Permalink
Set default SteamID for PlayerProfile API
Browse files Browse the repository at this point in the history
  • Loading branch information
Citrinate committed Dec 30, 2024
1 parent 9e7b93c commit f5fb765
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CS2Interface/IPC/Api/CS2InterfaceController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ public async Task<ActionResult<GenericResponse>> InspectItem(string botNames, [F
return Ok(new GenericResponse<InspectItem>(true, item));
}

[HttpGet("{botName:required}/PlayerProfile/{steamID:required}")]
[HttpGet("{botName:required}/PlayerProfile/{steamID?}")]
[SwaggerOperation (Summary = "Get a friend's CS2 player profile")]
[ProducesResponseType(typeof(GenericResponse<CMsgGCCStrike15_v2_PlayersProfile>), (int) HttpStatusCode.OK)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.BadRequest)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.GatewayTimeout)]
public async Task<ActionResult<GenericResponse>> PlayerProfile(string botName, ulong steamID) {
public async Task<ActionResult<GenericResponse>> PlayerProfile(string botName, ulong? steamID = null) {
if (string.IsNullOrEmpty(botName)) {
throw new ArgumentNullException(nameof(botName));
}
Expand All @@ -142,7 +142,7 @@ public async Task<ActionResult<GenericResponse>> PlayerProfile(string botName, u

CMsgGCCStrike15_v2_PlayersProfile player;
try {
player = await client.RequestPlayerProfile(steamID).ConfigureAwait(false);
player = await client.RequestPlayerProfile(steamID ?? bot.SteamID).ConfigureAwait(false);
} catch (ClientException e) {
return await HandleClientException(bot, e).ConfigureAwait(false);
}
Expand Down

0 comments on commit f5fb765

Please sign in to comment.