Closed 677283 closed 6 years ago
The PubSub sample code does not work.
I used my twitch ID and my Oauth.
But there is no reaction at all.
I was not a partner streamer, so I tested Ban.
This is the example code.
Am I using it wrong?
using UnityEngine; using TwitchLib.Unity; using System; using TwitchLib.PubSub.Events;
public class TwitchPubSubExample : MonoBehaviour { private PubSub _client;
void Start() { //Set to run in minimized mode Application.runInBackground = true; //Create new instance of PubSub Client _client = new PubSub(); //Subscribe to Events _client.OnBan += BanTest; _client.OnBitsReceived += _client_OnBitsReceived; _client.OnPubSubServiceConnected += _client_OnPubSubServiceConnected; //Connect _client.Connect(); } private void BanTest(object sender, OnBanArgs e) { Debug.Log(e.BannedUserId + ":: BAN"); } private void _client_OnPubSubServiceConnected(object sender, System.EventArgs e) { //On connect listen to Bits event _client.ListenToBitsEvents("ID"); _client.ListenToChatModeratorActions("ID", "ID"); _client.SendTopics("oauth"); } private void _client_OnBitsReceived(object sender, TwitchLib.PubSub.Events.OnBitsReceivedArgs e) { //Do your bits logic here. }
}
@677283 if you don't mind me asking, what was the problem/solution?
@swiftyspiffy Sorry. I've fixed the issue. It was my mistake.
Awesome, cheers!
The PubSub sample code does not work.
I used my twitch ID and my Oauth.
But there is no reaction at all.
I was not a partner streamer, so I tested Ban.
This is the example code.
Am I using it wrong?
using UnityEngine; using TwitchLib.Unity; using System; using TwitchLib.PubSub.Events;
public class TwitchPubSubExample : MonoBehaviour { private PubSub _client;
}