TwitchLib / TwitchLib.PubSub

PubSub component of TwitchLib.
38 stars 51 forks source link

ERR_BADAUTH on Bits/Subs #58

Closed JammyGeeza closed 3 years ago

JammyGeeza commented 4 years ago

Hey there,

I created a bot a month or so ago that could deal with !commands for my channel and also be able to locally play some Sound Effects when Channel Points were redeemed. This has all been working fine, but recently I wanted to control some LEDs when Subs/Bits are received.

Here is the small snippet of code for listening to the relevant events:

(1) client.ListenToBitsEvents(“channel_id”);
(2) client.ListenToFollows(“channel_id”);
(3) client.ListenToRedemptions(“channel_id”);

(4) client.SendTopics(“token_here”);

With the above code, I get “ERR_BADAUTH” for all 3 topics in the onListenResponse event. The exact same thing happens if I replace Line 1 with: client.ListenToSubscriptions(“channel_id”); However, if I completely remove Line 1, it works just fine and it successfully connects and listens to Channel Point Redemptions and Follows.

I have tried to find an issue on this, but the only resolution I could find was that the account being listened to was not an affiliate account, so here are some things to note in my case:

I believe I read somewhere that certain topics require another level of authentication, but I am unsure what it is, where to generate it and where to implement it in the PubSub library.

Apologies if this has been answered before, but any help is appreciated!

Kind regards,

Jamie

Mahsaap commented 4 years ago

Subs will require the streamers token to access. So you must use the streamer account to generate that token to access sub events.

JammyGeeza commented 4 years ago

Subs will require the streamers token to access. So you must use the streamer account to generate that token to access sub events.

Hi @Mahsaap

All the tokens I have been generating have been through the Twitch Token Generator site and I have been using the streamer’s account to generate them.

Is there another token that I need to generate outside of the Access Token and ClientID to gain access to Sub/Bit events? If so, how can I generate it and where does it need to be implemented using the PubSub library for it to be authenticated?

lualucky commented 3 years ago

I'm having this same issue. Token has every scope enabled from twitchtokengenerator, and channel id works for other topics, but I get ERR_BADAUTH if I listen to subscriptions and/or bits. I'm using the Unity DLL version 1.0.2

swiftyspiffy commented 3 years ago

I think this is related to the other issue brought up in the Discord server. I'll be looking into this, this weekend.

swiftyspiffy commented 3 years ago

This should be working in the latest Unity build. Sorry about the delay. Will close this. Feel free to reopen if needed.