From 616f0646b4de5f0d28b325f581425f1a70f9d244 Mon Sep 17 00:00:00 2001 From: Eroax Date: Fri, 26 Jan 2024 03:30:07 -0700 Subject: [PATCH] Updated NoTwitch for HTTPResponse Changes Adds the extra info that comes with HTTPRequest to HTTPResponse.data --- addons/no_twitch/twitch_connection.gd | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/addons/no_twitch/twitch_connection.gd b/addons/no_twitch/twitch_connection.gd index ae8c297..a5beafd 100644 --- a/addons/no_twitch/twitch_connection.gd +++ b/addons/no_twitch/twitch_connection.gd @@ -51,7 +51,7 @@ func cache_user_data(): var resp = request_user_info() resp.response_received.connect(func(data): - user_info = data + user_info = data.data print("User Info Cached") ) @@ -304,12 +304,16 @@ class HTTPResponse: var info = JSON.parse_string(body.get_string_from_utf8()) + info["result"] = result + info["code"] = response_code + info["headers"] = headers + if info.has("error"): - push_error("NoTwitch Twitch API Error: " + info.error + " " + info.message) + push_error("NoTwitch Twitch API Error: " + str(info)) return - info = info.data[0] + info["data"] = info.data[0] print("Response Received") inf_data = info