Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pubsub bad oauth #47

Open
THENooBlet opened this issue Jun 5, 2019 · 2 comments
Open

Pubsub bad oauth #47

THENooBlet opened this issue Jun 5, 2019 · 2 comments

Comments

@THENooBlet
Copy link

im having trouble with my token not working ... giving me bad oauth

heres my code

        pubsub = new TwitchPubSub();
        pubsub.OnPubSubServiceConnected += Pubsub_OnPubSubServiceConnected;
        pubsub.OnBitsReceived += Pubsub_OnBitsReceived;
        pubsub.OnSubscribersOnly += Pubsub_OnSubOnly;
        pubsub.OnSubscribersOnlyOff += Pubsub_onSubonlyoff;
        pubsub.OnWhisper += pubsub_onwisper;
        pubsub.OnListenResponse += Pubsub_OnListenResponse;


        pubsub.Connect();



    }

    private void Pubsub_OnPubSubServiceConnected(object sender, EventArgs e)
    {
        client.SendMessage(Twitch.Default.ChannelName, $"pubsub connected!!!");           
        pubsub.ListenToBitsEvents(Twitch.Default.ChannelID);            
        pubsub.SendTopics(Twitch.Default.BotOauth);            
    }

    private void Pubsub_OnBitsReceived(object sender, OnBitsReceivedArgs e)
    {
        client.SendMessage(Twitch.Default.ChannelName ,$"Just received {e.BitsUsed} bits from {e.Username}. That brings their total to {e.TotalBitsUsed} bits!");
    }

    private void Pubsub_OnListenResponse(object sender, OnListenResponseArgs e)
    {
        if (e.Successful)
            client.SendMessage(Twitch.Default.ChannelName,$"Successfully verified listening to topic: {e.Topic}");
        else
            client.SendMessage(Twitch.Default.ChannelName,$"Failed to listen! Error: {e.Response.Error}");
    }
}

}
:

i left some code out that has to do with client ...(works) but the botoauth being used in send topics is from swiftyspiffy token generator and all scopes are applyed
but i get

newbiestreambot: pubsub connected!!!
newbiestreambot: Failed to listen! Error: ERR_BADAUTH

@THENooBlet
Copy link
Author

if anybody can help me ive been trying for a month now to get bits info but im stuck

@Honokii
Copy link

Honokii commented Oct 17, 2021

Hi! so i was having this same issue for some weeks now. And finally I have made it work!
The problem is that we're using the pubsub wrong.
On the line with 'pubsub.SendTopics() method. We need to put the Oauth token of the streamer and not the bot. So yes, we'll need to have the streamer provide us an authentication token so our app can receive the events.

The example on the documentation seems to be using one account for the bot and the streamer. This have confused me for some time now.

Hope this helps. GL guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants