Skip to content

Commit

Permalink
fix disconnect event type in TwitchClient
Browse files Browse the repository at this point in the history
  • Loading branch information
AoshiW committed Apr 24, 2024
1 parent de39bd0 commit 2ffc7f7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion TwitchLib.Client.Test/TwitchClientEventTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public async Task ClientRaisesOnDisconnected()
{
var client = new TwitchClient(_mockClient);

await MyAssert.RaisesAsync<OnDisconnectedEventArgs>(
await MyAssert.RaisesAsync<OnDisconnectedArgs>(
h => client.OnDisconnected += h,
h => client.OnDisconnected -= h,
async () =>
Expand Down
2 changes: 1 addition & 1 deletion TwitchLib.Client/Interfaces/ITwitchClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public interface ITwitchClient
/// <summary>
/// Fires when bot has disconnected.
/// </summary>
event AsyncEventHandler<OnDisconnectedEventArgs>? OnDisconnected;
event AsyncEventHandler<OnDisconnectedArgs>? OnDisconnected;

/// <summary>
/// Forces when bot suffers connection error.
Expand Down
4 changes: 2 additions & 2 deletions TwitchLib.Client/TwitchClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public class TwitchClient : ITwitchClient
public event AsyncEventHandler<OnUserLeftArgs>? OnUserLeft;

/// <inheritdoc/>
public event AsyncEventHandler<OnDisconnectedEventArgs>? OnDisconnected;
public event AsyncEventHandler<OnDisconnectedArgs>? OnDisconnected;

/// <inheritdoc/>
public event AsyncEventHandler<OnConnectionErrorArgs>? OnConnectionError;
Expand Down Expand Up @@ -652,7 +652,7 @@ private Task _client_OnFatality(object? sender, OnFatalErrorEventArgs e)
/// <param name="e">The <see cref="OnDisconnectedEventArgs" /> instance containing the event data.</param>
private Task _client_OnDisconnected(object? sender, OnDisconnectedEventArgs e)
{
return OnDisconnected.TryInvoke(sender, e);
return OnDisconnected.TryInvoke(sender, new(TwitchUsername));
}

/// <summary>
Expand Down

0 comments on commit 2ffc7f7

Please sign in to comment.