It seems that giving Finch access to my VPN server at nullptr.one to allow him to host his own public server wasn't so good idea...
❤️ 0
function Validate(id, proof)
id = tostring(id)
proof = tostring(proof)
if id:match("^[0-9]+$") and proof:match("^[0-9a-f]+$") then
local tmp = "Tmp"..tostring(math.random()).."_"..tostring(os.time())
os.execute("curl --silent \"https://crymp.net/api/validate?a="..id.."&b="..proof.."&check=1&fetch&_\" > "..tmp)
local handle = io.open(tmp, "r")
local result = handle:read("*all")
handle:close()
os.remove(tmp)
if result:find([[{"msg":"ok"}]]) then
return true
else return false end
else
return false
end
end
And now you can do local isOk = Validate(static_id, static_proof), but this might cause small lag, because it's using cURL.
Btw you can use this even if you wanted to properly implement !validate ID Proof Name, by simply passing ID and Proof as parameters.