Giter Club home page Giter Club logo

Comments (17)

Syzuna avatar Syzuna commented on June 23, 2024

I setup a test and everything seems to work as expected with the latest dev branch.
Raids worked without killing the client.
Sub Bomb and its indiividual 5 gifted subs events worked without killing the client.

So cant replicate.

from twitchlib.client.

A5ho9999 avatar A5ho9999 commented on June 23, 2024

I'm not sure what has happened, it was working fine before update and removing old packages. I made no actual code changes.

Tested more with a raid and the event isn't even firing. The data is received but the event itself it's trigger, tested with breakpoints to see if it was.

Here is all the information I have

Client Settings

ClientOptions Options = new()
{
    MessagesAllowedInPeriod = 100,
    ThrottlingPeriod = TimeSpan.FromSeconds(60),
};
WebSocketClient WebSocket = new(Options);

Client = new TwitchClient(WebSocket);
Client.OnError += OnError;
Client.OnIncorrectLogin += OnIncorrectLogin;
Client.OnConnectionError += OnConnectionError;
Client.OnNoPermissionError +=OnNoPermissionError;
Client.OnFailureToReceiveJoinConfirmation += OnFailureToReceiveJoinConfirmation;
Client.OnConnected += OnConnected;
Client.OnDisconnected += OnDisconnected;
Client.OnReconnected += OnReconnected;
Client.OnSendReceiveData += OnSendReceiveData;
Client.OnJoinedChannel += OnJoinedChannel;
Client.OnLeftChannel += OnLeftChannel;
Client.OnMessageReceived += OnMessageReceived;
Client.OnMessageSent += OnMessageSent;
Client.OnUserJoined += OnUserJoined;
Client.OnUserLeft += OnUserLeft;

Client.OnRaidNotification += OnRaidNotification;

Raid Method

private void OnRaidNotification(object sender, OnRaidNotificationArgs e)
{
        Console.WriteLine("raid");
}

Console Output

[11/05/2022:11:56:14 AM] | [Twitch] | [Received] :tmi.twitch.tv 001 lordbloobbot :Welcome, GLHF!
[11/05/2022:11:56:14 AM] | [Twitch] | [Received] :tmi.twitch.tv 002 lordbloobbot :Your host is tmi.twitch.tv
[11/05/2022:11:56:14 AM] | [Twitch] | [Received] :tmi.twitch.tv 003 lordbloobbot :This server is rather new
[11/05/2022:11:56:14 AM] | [Twitch] | [Received] :tmi.twitch.tv 004 lordbloobbot :-
[11/05/2022:11:56:14 AM] | [Twitch] | **Twitch Client is connected**.
[11/05/2022:11:56:14 AM] | [Twitch] | [Received] :tmi.twitch.tv 375 lordbloobbot :-
[11/05/2022:11:56:14 AM] | [Twitch] | [Received] :tmi.twitch.tv 372 lordbloobbot :You are in a maze of twisty passages, all alike.
[11/05/2022:11:56:14 AM] | [Twitch] | [Received] :tmi.twitch.tv 376 lordbloobbot :>
[11/05/2022:11:56:14 AM] | [Twitch] | [Received] :tmi.twitch.tv CAP * ACK :twitch.tv/membership
[11/05/2022:11:56:14 AM] | [Twitch] | [Received] :tmi.twitch.tv CAP * ACK :twitch.tv/commands
[11/05/2022:11:56:14 AM] | [Twitch] | [Received] :tmi.twitch.tv CAP * ACK :twitch.tv/tags
[11/05/2022:11:56:14 AM] | [Twitch] | [Received] :[email protected] JOIN #elainettie
[11/05/2022:11:56:14 AM] | [Twitch] | lordbloobbot joined the Stream
[11/05/2022:11:56:16 AM] | [Twitch] | [Received] :lordbloobbot.tmi.twitch.tv 353 lordbloobbot = #elainettie :lordbloobbot
[11/05/2022:11:56:16 AM] | [Twitch] | [Received] :lordbloobbot.tmi.twitch.tv 366 lordbloobbot #elainettie :End of /NAMES list
[11/05/2022:11:56:16 AM] | [Twitch] | [Received] @badge-info=;badges=moderator/1;color=;display-name=lordbloobbot;emote-sets=0,0849a24f-a026-43d3-9edc-0b5406890256;mod=1;subscriber=0;user-type=mod :tmi.twitch.tv USERSTATE #elainettie
[11/05/2022:11:56:16 AM] | [Twitch] | [Received] @emote-only=0;followers-only=-1;r9k=0;rituals=0;room-id=652106707;slow=0;subs-only=0 :tmi.twitch.tv ROOMSTATE #elainettie
[11/05/2022:11:56:16 AM] | [Twitch] | **Connected to `elainettie`**.
[11/05/2022:11:56:16 AM] | [Twitch] | **Connected to PubSub Server**.
[11/05/2022:11:56:16 AM] | [Twitch] | {"type":"RESPONSE","error":"","nonce":"8BcWWFoJ"}

[11/05/2022:11:56:24 AM] | [Twitch] | [Received] :[email protected] JOIN #elainettie
[11/05/2022:11:56:24 AM] | [Twitch] | kattynah joined the Stream
[11/05/2022:11:56:24 AM] | [Twitch] | [Received] :[email protected] JOIN #elainettie
[11/05/2022:11:56:24 AM] | [Twitch] | mooseref joined the Stream
[11/05/2022:11:56:25 AM] | [Twitch] | [Received] :[email protected] JOIN #elainettie
[11/05/2022:11:56:25 AM] | [Twitch] | waptart joined the Stream
[11/05/2022:11:56:25 AM] | [Twitch] | [Received] :[email protected] JOIN #elainettie
[11/05/2022:11:56:25 AM] | [Twitch] | yeezyjesuspeezus joined the Stream
[11/05/2022:11:56:25 AM] | [Twitch] | [Received] :[email protected] JOIN #elainettie
[11/05/2022:11:56:25 AM] | [Twitch] | rogueg1rl joined the Stream
[11/05/2022:11:56:26 AM] | [Twitch] | [Received] :[email protected] JOIN #elainettie
[11/05/2022:11:56:26 AM] | [Twitch] | aboutw joined the Stream
[11/05/2022:11:56:26 AM] | [Twitch] | [Received] :[email protected] JOIN #elainettie
[11/05/2022:11:56:26 AM] | [Twitch] | soupat2 joined the Stream
[11/05/2022:11:56:26 AM] | [Twitch] | [Received] :la_kaylee!la_kaylee@la_kaylee.tmi.twitch.tv JOIN #elainettie
[11/05/2022:11:56:26 AM] | [Twitch] | la_kaylee joined the Stream
[11/05/2022:11:56:26 AM] | [Twitch] | [Received] :[email protected] JOIN #elainettie
[11/05/2022:11:56:26 AM] | [Twitch] | lanarayyyy joined the Stream
[11/05/2022:11:56:27 AM] | [Twitch] | [Received] :[email protected] JOIN #elainettie
[11/05/2022:11:56:27 AM] | [Twitch] | nekochanbot7837 joined the Stream
[11/05/2022:11:56:27 AM] | [Twitch] | [Received] :academyimpossible!academyimpossible@academyimpossible.tmi.twitch.tv JOIN #elainettie
[11/05/2022:11:56:27 AM] | [Twitch] | academyimpossible joined the Stream
[11/05/2022:11:56:27 AM] | [Twitch] | [Received] :[email protected] JOIN #elainettie
[11/05/2022:11:56:27 AM] | [Twitch] | losjaraswines joined the Stream
[11/05/2022:11:56:28 AM] | [Twitch] | [Received] :business_daddy!business_daddy@business_daddy.tmi.twitch.tv JOIN #elainettie
[11/05/2022:11:56:28 AM] | [Twitch] | business_daddy joined the Stream
[11/05/2022:11:56:28 AM] | [Twitch] | [Received] :[email protected] JOIN #elainettie
[11/05/2022:11:56:28 AM] | [Twitch] | damethedime joined the Stream
[11/05/2022:11:56:28 AM] | [Twitch] | [Received] :[email protected] JOIN #elainettie
[11/05/2022:11:56:28 AM] | [Twitch] | streamelements joined the Stream
[11/05/2022:11:56:30 AM] | [Twitch] | [Received] @badge-info=founder/14;badges=moderator/1,founder/0,hype-train/2;client-nonce=3465e19f872d137293892bedb3fb1c0c;color=#8D02B3;display-name=NekoChanBot7837;emotes=;first-msg=0;flags=;id=2b3a0ba6-f519-403b-8ccd-e2afb98d2c1a;mod=1;room-id=652106707;subscriber=1;tmi-sent-ts=1652235989876;turbo=0;user-id=245737288;user-type=mod :[email protected] PRIVMSG #elainettie :message
[11/05/2022:11:56:30 AM] | [Twitch] | Message Received: NekoChanBot7837: message
[11/05/2022:11:56:57 AM] | [Twitch] | [Received] @badge-info=founder/14;badges=moderator/1,founder/0,hype-train/2;color=#8D02B3;display-name=NekoChanBot7837;emotes=;flags=;id=a57eb4f0-fed4-4982-a858-2186f525eec7;login=nekochanbot7837;mod=1;msg-id=raid;msg-param-displayName=NekoChanBot7837;msg-param-login=nekochanbot7837;msg-param-profileImageURL=https://static-cdn.jtvnw.net/jtv_user_pictures/21ed8b47-d00c-451e-968d-5a861e4b7967-profile_image-70x70.png;msg-param-viewerCount=1;room-id=652106707;subscriber=1;system-msg=1\sraiders\sfrom\sNekoChanBot7837\shave\sjoined!;tmi-sent-ts=1652236016915;user-id=245737288;user-type=mod :tmi.twitch.tv USERNOTICE #elainettie
[11/05/2022:11:59:16 AM] | [Twitch] | { "type": "PONG" }


[11/05/2022:12:02:16 PM] | [Twitch] | { "type": "PONG" }


from twitchlib.client.

Mahsaap avatar Mahsaap commented on June 23, 2024

Have you tried the events that are not working on their own? Add onlog event as well to help

from twitchlib.client.

Syzuna avatar Syzuna commented on June 23, 2024

I wish I could help you in any way right now but all my attempts to replicate your issue fail.
I even tested it on the exact same channel as you but it still went through.

info: TwitchLib.Client.TwitchClient[0]
      [TwitchLib, 3.2.6.0] Received: @badge-info=;badges=twitchconEU2019/1;color=#B22222;display-name=Syzuna;emotes=;flags=;id=87b22e55-3c17-4033-81e4-c7ec80fd1b0a;login=syzuna;mod=0;msg-id=raid;msg-param-displayName=Syzuna;msg-param-login=syzuna;msg-param-profileImageURL=https://static-cdn.jtvnw.net/jtv_user_pictures/syzuna-profile_image-ef6a295b96ae24fd-70x70.jpeg;msg-param-viewerCount=1;room-id=652106707;subscriber=0;system-msg=1\sraiders\sfrom\sSyzuna\shave\sjoined!;tmi-sent-ts=1652273189208;user-id=102943601;user-type= :tmi.twitch.tv USERNOTICE #elainettie      
info: ClientTest.Worker[0]
      New Raid from syzuna to elainettie with 1 viewers

from twitchlib.client.

Mahsaap avatar Mahsaap commented on June 23, 2024

Is it possible you can post the whole client settings? I don't see connect in what you showed. I realise this had worked before the update but we have no clue ATM. Also what version did you update from and what framework?

from twitchlib.client.

A5ho9999 avatar A5ho9999 commented on June 23, 2024

I'm not too sure on the last version I was using. I'll try to revert to older ones today to see if it'll still work. I'll provide the current code setup, it's ran along side a Discord Bot so I've edited out most of that as it shouldn't be effecting anything.

Using .NET 6

internal class Program
{
    static async Task Main(string[] args) => await ConnectClient.RunAsync();
}
internal static async Task RunAsync()
{
    using var services = ConfigureServices(config);
    {
         services.GetRequiredService<TwitchHandler>().TwitchConnect();
         await Task.Delay(Timeout.Infinite);
    }
}
private static ServiceProvider ConfigureServices()
{
    return new ServiceCollection()
        .AddSingleton<TwitchHandler>()
        .BuildServiceProvider();
}
public class TwitchHandler
    {
        private static LiveStreamMonitorService Monitor;
        private static TwitchClient Client;
        private static TwitchPubSub PubSub;
        private static ITwitchAPI API;
        private static IServiceProvider Services;

        private static readonly ClientOptions Options;
        private static readonly WebSocketClient WebSocket;

        private static readonly ConnectionCredentials Credentials = new(TwitchConfig.BotName, TwitchConfig.BloobAccess);

        public TwitchHandler(IServiceProvider services)
        {
                Services = services;

                ClientOptions Options = new()
                {
                    MessagesAllowedInPeriod = 100,
                    ThrottlingPeriod = TimeSpan.FromSeconds(60),
                };
                WebSocketClient WebSocket = new(Options);

                API = new TwitchAPI();
                API.Settings.ClientId = TwitchConfig.TwitchClient;
                API.Settings.AccessToken = TwitchConfig.OAuthToken;
                API.Settings.Secret = TwitchConfig.ClientSecret;

                Client = new TwitchClient(WebSocket);
                Client.OnError += OnError;
                Client.OnIncorrectLogin += OnIncorrectLogin;
                Client.OnConnectionError += OnConnectionError;
                Client.OnNoPermissionError += OnNoPermissionError;
                Client.OnFailureToReceiveJoinConfirmation += OnFailureToReceiveJoinConfirmation;
                Client.OnConnected += OnConnected;
                Client.OnDisconnected += OnDisconnected;
                Client.OnReconnected += OnReconnected;
                Client.OnSendReceiveData += OnSendReceiveData;
                Client.OnJoinedChannel += OnJoinedChannel;
                Client.OnLeftChannel += OnLeftChannel;
                Client.OnMessageReceived += OnMessageReceived;
                Client.OnMessageSent += OnMessageSent;
                Client.OnUserJoined += OnUserJoined;
                Client.OnUserLeft += OnUserLeft;
                Client.OnChatCleared += OnChatCleared;
                Client.OnMessageCleared += OnMessageCleared;
                Client.OnUserBanned += OnUserBanned;
                Client.OnUserTimedout += OnUserTimedout;
                Client.OnRaidNotification += OnRaidNotification;

                Monitor = new LiveStreamMonitorService(API, 30);
                Monitor.OnStreamOnline += Monitor_OnStreamOnline;
                Monitor.OnStreamOffline += Monitor_OnStreamOffline;

                PubSub = new TwitchPubSub();
                PubSub.OnListenResponse += OnListenResponse;
                PubSub.OnPubSubServiceConnected += OnPubSubServiceConnected;
                PubSub.OnPubSubServiceClosed += OnPubSubServiceClosed;
                PubSub.OnPubSubServiceError += OnPubSubServiceError;
                PubSub.OnLog += PubSub_OnLog;

                ListenToBits(TwitchConfig.ChannelId);
                ListenToFollows(TwitchConfig.ChannelId);
                ListenToChannelPoints(TwitchConfig.ChannelId);
                ListenToSubs(TwitchConfig.ChannelId);
                ListenToVideoPlayback(TwitchConfig.ChannelId);
        }

        internal void TwitchConnect()
        {
                List<string> MonitorList = new() { TwitchConfig.ChannelName };
                
                Monitor.SetChannelsByName(MonitorList);
                Client.Initialize(Credentials);

                Monitor.Start();
                Client.Connect();
                PubSub.Connect();
        }
}

Edit:
Unable to currently check previous versions due to a loading error with visual studio itself, waiting to hear back from windows support >-<

from twitchlib.client.

A5ho9999 avatar A5ho9999 commented on June 23, 2024

So I was able to successfully detect a raid event after reverting Client, Client Enums and Models back to 3.2.0, without making any code changes.

from twitchlib.client.

Syzuna avatar Syzuna commented on June 23, 2024

Thats really weird...
Like you can see in the logs I posted I am using 3.2.6 from the latest dev branch release and it worked perfectly fine the whole evening for me detecting multiple raids, some sub gifts and so on....
Also using .NET 6 there.
Is there really no error log or any exception log anywhere? without one its like impossible to pin the root cause I'm afraid

from twitchlib.client.

A5ho9999 avatar A5ho9999 commented on June 23, 2024

Nope, just tried all possible sections with catching any exception and OnLog and nothing. Just same the result of the event not firing after receiving the data. Going to slowly check each version to see where it actually stops working.

from twitchlib.client.

A5ho9999 avatar A5ho9999 commented on June 23, 2024

Okay so I tried all the releases up to 3.2.5 and then all the pre-release from there, They all worked fine until the latest 3.2.6-preview-6109ec73405e067631aac6c8c837bc87dec6ad63 for the Client. Enums and Models were fine on the latest release. So I really have no idea what is happening here.

from twitchlib.client.

Syzuna avatar Syzuna commented on June 23, 2024

ok so the latest preview added announcements... they are a USERNOTICE like raids...
were there any announcements before you tested raids?

from twitchlib.client.

Syzuna avatar Syzuna commented on June 23, 2024

ok no... annoucements work as intended so those shouldnt cause internal issues

from twitchlib.client.

A5ho9999 avatar A5ho9999 commented on June 23, 2024

Yeah was just having a quick look over the announcement changes, but wouldn't make much sense if there was an issue but working for you as well. Went to go test the announcements and found "Reference to type 'Announcement' claims it is defined in 'TwitchLib.Client.Models', but it could not be found" when attempting to access the OnAnnouncementArgs? I have the latest Models and Enums being 3.2.5-preview-eb210b24b724f0df6e3ce9566fe25ba3ce6ab13f

from twitchlib.client.

Syzuna avatar Syzuna commented on June 23, 2024

wait why are those still 3.2.5...
I did forget to bump their version didnt I... fml...
but that shouldnt be an issue...
you have the wrong version of them tho the commit sha in the package name should be 6109ec7

or 68b5407 with the new release now

sadly nuget sorts them wrong sometimes...

from twitchlib.client.

A5ho9999 avatar A5ho9999 commented on June 23, 2024

Yup, that would appear to be it, switching to 6109ec7 and the raid event triggers fine. bad nuget

from twitchlib.client.

Syzuna avatar Syzuna commented on June 23, 2024

well also partly my fault bcs I forgot to bump 2 nugets version numbers x.x

from twitchlib.client.

A5ho9999 avatar A5ho9999 commented on June 23, 2024

It happens, Thanks for sticking with me through this pain T-T Updated to the new ones and is still working fine ^ - ^

from twitchlib.client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.