Updated NoTwitch for HTTPResponse Changes

Adds the extra info that comes with HTTPRequest to HTTPResponse.data
This commit is contained in:
Eroax 2024-01-26 03:30:07 -07:00
parent 1bd9c84f1e
commit 616f0646b4

View file

@ -51,7 +51,7 @@ func cache_user_data():
var resp = request_user_info() var resp = request_user_info()
resp.response_received.connect(func(data): resp.response_received.connect(func(data):
user_info = data user_info = data.data
print("User Info Cached") print("User Info Cached")
) )
@ -304,12 +304,16 @@ class HTTPResponse:
var info = JSON.parse_string(body.get_string_from_utf8()) var info = JSON.parse_string(body.get_string_from_utf8())
info["result"] = result
info["code"] = response_code
info["headers"] = headers
if info.has("error"): if info.has("error"):
push_error("NoTwitch Twitch API Error: " + info.error + " " + info.message) push_error("NoTwitch Twitch API Error: " + str(info))
return return
info = info.data[0] info["data"] = info.data[0]
print("Response Received") print("Response Received")
inf_data = info inf_data = info