-
Notifications
You must be signed in to change notification settings - Fork 63
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
Client events not firing? #190
Comments
I setup a test and everything seems to work as expected with the latest dev branch. So cant replicate. |
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
|
Have you tried the events that are not working on their own? Add onlog event as well to help |
I wish I could help you in any way right now but all my attempts to replicate your issue fail.
|
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? |
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: |
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. |
Thats really weird... |
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. |
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. |
ok so the latest preview added announcements... they are a USERNOTICE like raids... |
ok no... annoucements work as intended so those shouldnt cause internal issues |
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 |
Yup, that would appear to be it, switching to 6109ec7 and the raid event triggers fine. bad nuget |
well also partly my fault bcs I forgot to bump 2 nugets version numbers x.x |
It happens, Thanks for sticking with me through this pain T-T Updated to the new ones and is still working fine ^ - ^ |
After updating to April 28th prerelease and removing the deprecated packages some Client events seem to be broken in some way. I don't get any errors from it but when these events should fire Client events just stop working. The events I know that seem to have an issue are the events related to Re/new subscriptions and Gifting as well as Raids. Other events like the message received work find until one of those events are triggered then the Client no longer responds to further events but is still connected. Sorry for the lack of information in this one but it's all I have.
Edit:
Also forgot to add, even when removing listening to the events it still seems to happen when the action is done in the channel.
The text was updated successfully, but these errors were encountered: