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

Unity stops listening to chat commands

Open thmsndk opened this issue 4 years ago • 6 comments

Unity Version: 2019.2.5f1 Running with release 1.0.0 of twitchlib.unity in the standalone player i'm experiencing issues with the chat commands, the first few seconds after connecting it responds to commands written in chat. e.g. !commands or !help and the likes.

The bot appears to be connected to the chat, and can send messages to it, but it seems like the client.OnChatCommandReceived event is no longer fireing. as if the client loses the subscriptions for the event?

thmsndk avatar Feb 29 '20 00:02 thmsndk

Hi. Sorry about the delay.

You might try setting the client protocol to TCP, this has been used several times to resolve the apparent disconnect after several seconds of being connected correctly:

client = new TwitchClient(protocol: TwitchLib.Client.Enums.ClientProtocol.TCP);

swiftyspiffy avatar Mar 12 '20 09:03 swiftyspiffy

@swiftyspiffy hmm the Client i'm initializing does not take any parameters, and is called Client

e.g.

client = new Client();
client.Initialize(credentials, channel_name);

Am I supposed to download the repository and build the code myself instead of using the latest release? I followed a guide where I downloaded the compiled .dll from the release page and included in unity.

thmsndk avatar Mar 13 '20 15:03 thmsndk

The highest number isn't the most recent version, I don't think (the CI is broken and publishing incorrect versions). It might be worth it to just clone the repo and build the dev branch to get the latest code. I think the above code snippet should fix your problem.

swiftyspiffy avatar Mar 14 '20 21:03 swiftyspiffy

@swiftyspiffy I cloned the master branch and built it, without any code changes, seems to be stable so far. but i'd have to do some more testing.

The Client class from TwitchLib.Unity has no constructor though :) so it is not possible to set thoose parameters as far as I can tell.

thmsndk avatar Mar 18 '20 18:03 thmsndk

Any chance of uploading a .dll file? I am having the same issue right now and I can't get the project to build...

supersessie avatar Jul 25 '20 21:07 supersessie

Recently I've managed to get the built version working by using .NET 4.8+ with the current dlls

Lock-The-Door avatar Jul 26 '20 02:07 Lock-The-Door