issork / gift

Godot IRC For Twitch addon
MIT License
150 stars 23 forks source link

User lookup by ID fails #39

Closed digital-mint-creature closed 4 months ago

digital-mint-creature commented 5 months ago

Issue Summary

When attempting to call get_users_by_id(), the call fails with a 400 error. This is due to a bug in the underlying get_users() function, which attempts to get the first ID value from the names array rather than ids, resulting in a request that looks like this:

GET /helix/users/?id=<null>&id=000000000

(where the second id= is the first element in the ids array)

Steps to Reproduce

Create a TwitchAPIConnection and call get_users_by_id() with an array containing at least one valid id.

Expected Behavior

The call should succeed and return information on the user.

Actual Behavior

The call returns an empty response due to a 400 error.

The fix is pretty simple - just change line 92 of api_connection.gd to call ids.pop_back() rather than names.pop_back().