From 67051b99dae0cf03befd5e6fc1b017a86964a139 Mon Sep 17 00:00:00 2001 From: 9382 Date: Mon, 13 Mar 2023 16:05:53 +0000 Subject: [PATCH] Improve username-based roblox user grabbing --- src/modules/strafes_net.lua | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/modules/strafes_net.lua b/src/modules/strafes_net.lua index 35bd595..775c86e 100644 --- a/src/modules/strafes_net.lua +++ b/src/modules/strafes_net.lua @@ -260,13 +260,10 @@ function API:GetRobloxInfoFromUserId(USER_ID) end function API:GetRobloxInfoFromUsername(USERNAME) - if not USERNAME then return 'empty id' end - local err, res = parseToURLArgs({username=USERNAME}) - if err then return err end - local response,headers = http_request('GET', ROBLOX_API_URL2..'users/get-by-username'..res, API_HEADER) - if not response.Id then return 'no user found' end - local response2 = http_request('GET', ROBLOX_API_URL..'users/'..response.Id, API_HEADER) - return response2 + if not USERNAME then return 'empty username' end + local response,headers = http_request('POST', ROBLOX_API_URL..'usernames/users', API_HEADER, {usernames={USERNAME}}) + if not response.data[1] then return 'invalid username' end + return self:GetRobloxInfoFromUserId(response.data[1].id) end function API:GetRobloxInfoFromDiscordId(DISCORD_ID)