Check stream live is online or not

For my thing, I dont believe a webhook is necessary. Although I will post the finished code for anyone who would like it. (Lua)

local CheckIfOnline = function()
local Data = {
Url = “https://api.twitch.tv/helix/streams?user_login=12gaugenick”,
Method = “GET”,
Headers = {
[“Client-ID”] = “p68bczp3bnsopaf6378auzjk4nu8wl&quot”
},
}
local Request = Http:RequestAsync(Data)
if Request.StatusCode == 200 then
local TwitchData = Http:JSONDecode(Request.Body).data[1]
if TwitchData.type == “live” then
return {
Viewers = TwitchData.viewer_count,
Title = TwitchData.title,
IsLive = TwitchData.type
}
else
return false
end
else
warn(“API Error”)
end
return false
end