Skip to content

Commit

Permalink
Expose WebSocketClient.IsConnected to the user (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
occluder authored Jun 24, 2024
1 parent be203db commit 77049fc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions MiniTwitch.Irc/IrcClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ public sealed class IrcClient : IAsyncDisposable
/// <para>Can be toggled with <see cref="DefaultMiniTwitchLogger{T}.Enabled"/></para>
/// </summary>
public DefaultMiniTwitchLogger<IrcChannel> DefaultLogger { get; } = new();
/// <summary>
/// Whether the client is currently connected
/// </summary>
public bool IsConnected => _ws.IsConnected;

internal ClientOptions Options { get; init; }
#endregion
Expand Down
4 changes: 4 additions & 0 deletions MiniTwitch.Irc/IrcMembershipClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ public sealed class IrcMembershipClient : IAsyncDisposable
/// The action to invoke when an exception is caught within an event
/// </summary>
public Action<Exception> ExceptionHandler { get; set; } = default!;
/// <summary>
/// Whether the client is currently connected
/// </summary>
public bool IsConnected => _ws.IsConnected;
#endregion

#region Events
Expand Down
6 changes: 5 additions & 1 deletion MiniTwitch.PubSub/PubSubClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
using MiniTwitch.PubSub.Internal.Enums;
using MiniTwitch.PubSub.Internal.Models;
using MiniTwitch.PubSub.Internal.Parsing;
using MiniTwitch.PubSub.Payloads;
using MiniTwitch.PubSub.Models;
using MiniTwitch.PubSub.Payloads;

namespace MiniTwitch.PubSub;

Expand All @@ -33,6 +33,10 @@ public sealed class PubSubClient : IAsyncDisposable
/// <para>Can be toggled with <see cref="DefaultMiniTwitchLogger{T}.Enabled"/></para>
/// </summary>
public DefaultMiniTwitchLogger<PubSubClient> DefaultLogger { get; } = new();
/// <summary>
/// Whether the client is currently connected
/// </summary>
public bool IsConnected => _ws.IsConnected;
#endregion

#region Events
Expand Down

0 comments on commit 77049fc

Please sign in to comment.