diff --git a/TwitchLib.Client.Test/TwitchClientEventTests.cs b/TwitchLib.Client.Test/TwitchClientEventTests.cs index 08f7fa3..25714d2 100644 --- a/TwitchLib.Client.Test/TwitchClientEventTests.cs +++ b/TwitchLib.Client.Test/TwitchClientEventTests.cs @@ -141,7 +141,7 @@ public async Task ClientRaisesOnDisconnected() { var client = new TwitchClient(_mockClient); - await MyAssert.RaisesAsync( + await MyAssert.RaisesAsync( h => client.OnDisconnected += h, h => client.OnDisconnected -= h, async () => diff --git a/TwitchLib.Client/Interfaces/ITwitchClient.cs b/TwitchLib.Client/Interfaces/ITwitchClient.cs index d5fefd4..67b049c 100644 --- a/TwitchLib.Client/Interfaces/ITwitchClient.cs +++ b/TwitchLib.Client/Interfaces/ITwitchClient.cs @@ -156,7 +156,7 @@ public interface ITwitchClient /// /// Fires when bot has disconnected. /// - event AsyncEventHandler? OnDisconnected; + event AsyncEventHandler? OnDisconnected; /// /// Forces when bot suffers connection error. diff --git a/TwitchLib.Client/TwitchClient.cs b/TwitchLib.Client/TwitchClient.cs index 88c1c4a..0ed5b6f 100644 --- a/TwitchLib.Client/TwitchClient.cs +++ b/TwitchLib.Client/TwitchClient.cs @@ -196,7 +196,7 @@ public class TwitchClient : ITwitchClient public event AsyncEventHandler? OnUserLeft; /// - public event AsyncEventHandler? OnDisconnected; + public event AsyncEventHandler? OnDisconnected; /// public event AsyncEventHandler? OnConnectionError; @@ -652,7 +652,7 @@ private Task _client_OnFatality(object? sender, OnFatalErrorEventArgs e) /// The instance containing the event data. private Task _client_OnDisconnected(object? sender, OnDisconnectedEventArgs e) { - return OnDisconnected.TryInvoke(sender, e); + return OnDisconnected.TryInvoke(sender, new(TwitchUsername)); } ///