From f5fb765358278c3b6c4676b4a2d9f755ffe41804 Mon Sep 17 00:00:00 2001 From: Citrinate Date: Sun, 29 Dec 2024 21:36:52 -0500 Subject: [PATCH] Set default SteamID for PlayerProfile API --- CS2Interface/IPC/Api/CS2InterfaceController.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CS2Interface/IPC/Api/CS2InterfaceController.cs b/CS2Interface/IPC/Api/CS2InterfaceController.cs index 3c869b5..5f32755 100644 --- a/CS2Interface/IPC/Api/CS2InterfaceController.cs +++ b/CS2Interface/IPC/Api/CS2InterfaceController.cs @@ -120,12 +120,12 @@ public async Task> InspectItem(string botNames, [F return Ok(new GenericResponse(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), (int) HttpStatusCode.OK)] [ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.BadRequest)] [ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.GatewayTimeout)] - public async Task> PlayerProfile(string botName, ulong steamID) { + public async Task> PlayerProfile(string botName, ulong? steamID = null) { if (string.IsNullOrEmpty(botName)) { throw new ArgumentNullException(nameof(botName)); } @@ -142,7 +142,7 @@ public async Task> 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); }