mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Renamed TwitchWs to Twitch as I intend to add a non-WS related helper function for checking if a stream is live using Graph QL
This commit is contained in:
@@ -25,7 +25,7 @@ public class KickBot
|
|||||||
// Suppresses the command handler on initial start, so it doesn't pick up things already handled on restart
|
// Suppresses the command handler on initial start, so it doesn't pick up things already handled on restart
|
||||||
private bool _initialStartCooldown = true;
|
private bool _initialStartCooldown = true;
|
||||||
private readonly CancellationToken _cancellationToken = new();
|
private readonly CancellationToken _cancellationToken = new();
|
||||||
private readonly TwitchWs _twitchWs;
|
private readonly Twitch _twitch;
|
||||||
|
|
||||||
public KickBot()
|
public KickBot()
|
||||||
{
|
{
|
||||||
@@ -81,9 +81,9 @@ public class KickBot
|
|||||||
if (_config.BossmanJackTwitchId != null)
|
if (_config.BossmanJackTwitchId != null)
|
||||||
{
|
{
|
||||||
_logger.Debug("Creating Twitch live stream notification client");
|
_logger.Debug("Creating Twitch live stream notification client");
|
||||||
_twitchWs = new TwitchWs([_config.BossmanJackTwitchId.Value], _config.Proxy, _cancellationToken);
|
_twitch = new Twitch([_config.BossmanJackTwitchId.Value], _config.Proxy, _cancellationToken);
|
||||||
_twitchWs.OnStreamStateUpdated += OnTwitchStreamStateUpdated;
|
_twitch.OnStreamStateUpdated += OnTwitchStreamStateUpdated;
|
||||||
_twitchWs.StartWsClient().Wait(_cancellationToken);
|
_twitch.StartWsClient().Wait(_cancellationToken);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using Websocket.Client;
|
|||||||
|
|
||||||
namespace KfChatDotNetKickBot.Services;
|
namespace KfChatDotNetKickBot.Services;
|
||||||
|
|
||||||
public class TwitchWs
|
public class Twitch
|
||||||
{
|
{
|
||||||
private Logger _logger = LogManager.GetCurrentClassLogger();
|
private Logger _logger = LogManager.GetCurrentClassLogger();
|
||||||
private WebsocketClient _wsClient;
|
private WebsocketClient _wsClient;
|
||||||
@@ -18,7 +18,7 @@ public class TwitchWs
|
|||||||
public event OnStreamStateUpdateEventHandler OnStreamStateUpdated;
|
public event OnStreamStateUpdateEventHandler OnStreamStateUpdated;
|
||||||
private CancellationToken _cancellationToken = CancellationToken.None;
|
private CancellationToken _cancellationToken = CancellationToken.None;
|
||||||
|
|
||||||
public TwitchWs(List<int> channels, string? proxy = null, CancellationToken? cancellationToken = null)
|
public Twitch(List<int> channels, string? proxy = null, CancellationToken? cancellationToken = null)
|
||||||
{
|
{
|
||||||
_proxy = proxy;
|
_proxy = proxy;
|
||||||
_channels = channels;
|
_channels = channels;
|
||||||
Reference in New Issue
Block a user