Implement support for the Verification Sign item

This commit is contained in:
Aidan 2025-05-18 11:12:02 +01:00
parent bf3778c802
commit c0ffa71f39
Signed by: 9382
GPG Key ID: 9BF9CD918201F681
2 changed files with 22 additions and 6 deletions

View File

@ -305,8 +305,14 @@ end
function API:GetVerificationItemID(USER_ID) function API:GetVerificationItemID(USER_ID)
if not USER_ID then return 'empty id' end if not USER_ID then return 'empty id' end
local response,headers = http_request('GET', ROBLOX_INVENTORY_API..'users/'..USER_ID.."/items/Asset/102611803", API_HEADER) local response1,headers1 = http_request('GET', ROBLOX_INVENTORY_API..'users/'..USER_ID.."/items/Asset/102611803", API_HEADER)
return response,headers if response1.errors then return response1,headers1 end
local response2,headers2 = http_request('GET', ROBLOX_INVENTORY_API..'users/'..USER_ID.."/items/Asset/1567446", API_HEADER)
if response2.errors then return response2,headers2 end
local data = {}
data[#data+1] = response2.data[1] -- Do the older item first if present
data[#data+1] = response1.data[1]
return {data=data},headers1
end end
function API:GetUserThumbnail(USER_ID,TYPE,SIZE) -- https://thumbnails.roblox.com/v1/users/avatar?userIds=1455906620&size=180x180&format=Png&isCircular=false function API:GetUserThumbnail(USER_ID,TYPE,SIZE) -- https://thumbnails.roblox.com/v1/users/avatar?userIds=1455906620&size=180x180&format=Png&isCircular=false

View File

@ -62,15 +62,19 @@ local IDToDate = { --Terrible ranges but it's all we have
local function linterp(i1, i2, m) local function linterp(i1, i2, m)
return math.floor(i1 + (i2-i1)*m) return math.floor(i1 + (i2-i1)*m)
end end
local function GuessDateFromAssetID(AssetID) local function GuessDateFromAssetID(InstanceID, AssetID)
local note = ""
if AssetID == 1567446 then
note = " (Verification Sign)"
end
for i = #IDToDate, 1, -1 do --Newest to oldest for i = #IDToDate, 1, -1 do --Newest to oldest
local ID,Time = unpack(IDToDate[i]) local ID,Time = unpack(IDToDate[i])
if ID < AssetID then if ID < InstanceID then
if not IDToDate[i+1] then if not IDToDate[i+1] then
return "After "..ToYMD(Time) return "After "..ToYMD(Time)
end end
local ParentID, ParentTime = unpack(IDToDate[i+1]) local ParentID, ParentTime = unpack(IDToDate[i+1])
return "Around "..ToYMD(linterp(Time, ParentTime, (AssetID-ID)/(ParentID-ID))) return "Around "..ToYMD(linterp(Time, ParentTime, (InstanceID-ID)/(ParentID-ID)))..note
end end
end end
return "Before "..ToYMD(IDToDate[1][2]) return "Before "..ToYMD(IDToDate[1][2])
@ -128,7 +132,13 @@ local function Callback(Interaction, Command, Args)
if verificationAssetId.errors then if verificationAssetId.errors then
verificationDate = "Failed to fetch" verificationDate = "Failed to fetch"
elseif verificationAssetId.data[1] then elseif verificationAssetId.data[1] then
verificationDate = GuessDateFromAssetID(verificationAssetId.data[1].instanceId) verificationDate = ""
for i, data in next, verificationAssetId.data do
verificationDate = verificationDate .. GuessDateFromAssetID(data.instanceId, data.id)
if i ~= #verificationAssetId.data then
verificationDate = verificationDate .. "\n"
end
end
end end
local badgeRequest = API:GetBadgesAwardedDates(id,Badges) local badgeRequest = API:GetBadgesAwardedDates(id,Badges)