Can't parse JSON (Error only in game, but works in studio)

I am trying to check if player is Nitro Booster of discord server.
It throws error “Can’t parse JSON” when in game, but in studio it works well.

function CheckNitroBooster(Player)
	local http = game:GetService("HttpService")
	local api = "https://discord.com/api/guilds/{valid guild id}/members/search?query="
	local data = http:RequestAsync({Url = api..tostring(Player.Name), Headers = {["Authorization"] = "Bot {valid token}"}})
	local boostSince = http:JSONDecode(data.Body)[1]["premium_since"]
	return boostSince
end

Okay so first of off, you can’t use discord normally, as they blocked it. Try fixing that with a proxy and see if that works.

1 Like

use hooks.hyra.io instead of discord.com, since discord blocked roblox webhooks.

2 Likes

image
Now I get this error in studio and in game.

oh, reading the topic again, the proxy i sent you is only for webhooks, so im not sure if there’s a discord proxy for what you want.