TwitchLib.Api icon indicating copy to clipboard operation
TwitchLib.Api copied to clipboard

TwitchAPI.Helix.Channels.GetChannelFollowersAsync() returns empty list, but a valid "total" value

Open CyberMermaidKometteVT opened this issue 1 year ago • 7 comments

image When I call GetChannelFollowersAsync(), using the right broadcaster ID with a token with the correct auths, I get an empty list for Data, an empty string under Pagination, but the correct number of total followers in Total. I'm guessing there's a mapping issue? But looking at your codebase that looks solid too?

CyberMermaidKometteVT avatar Dec 18 '23 04:12 CyberMermaidKometteVT

Make sure your token is a user access token for the broadcaster (or a moderator of channel) with the moderator:read:followers scope

You can check your token scopes via:

curl -X GET "https://id.twitch.tv/oauth2/validate" -H "Authorization: OAuth <your-access-token>"

iProdigy avatar Dec 18 '23 05:12 iProdigy

It is - in fact I made the same call with cURL, copy-pasting my authentication information from my running instance, and I got the expected behavior.

CyberMermaidKometteVT avatar Dec 18 '23 06:12 CyberMermaidKometteVT

What version are you using? Just tested with the latest 3.10 prerelease and 3.9.0 but I can't reproduce the issue. I get back the follower list for the channel just fine.

Syzuna avatar Dec 18 '23 06:12 Syzuna

Hmm, I'm currently running 3.9.0. I'll poke with it further I guess?

Would we expect from a failure state to be getting the Total field filled in correctly as pictured, and no exception?

CyberMermaidKometteVT avatar Dec 18 '23 06:12 CyberMermaidKometteVT

According to Twitch this should only happen if the user access token is missing the moderator:read:followers scope, or the user isn’t the broadcaster or moderator for the channel. You always get the total but not the actual list if you fail authorization. Sadly you don't really get an indicator for that

Syzuna avatar Dec 18 '23 06:12 Syzuna

Have you tried explicitly passing the accessToken parameter for that method? (perhaps you have multiple tokens, and have specified the wrong one)

iProdigy avatar Dec 18 '23 07:12 iProdigy

I only have a single token for the application.

That being said, I've tried explicitly checking both of those things. I've tried manually setting the accessToken, and I've run a cURL command copy-pasting the values from my debugger into the cURL command, including that accessToken, and it works just fine.

Any further thoughts? I'm happy to believe that I'm messing up somehow, somewhere :)

Thanks for y'all's help!

CyberMermaidKometteVT avatar Dec 22 '23 03:12 CyberMermaidKometteVT