Skip to content

Commit 0db19ac

Browse files
committed
Fixed format to match TwitchLib formatting
1 parent 344be58 commit 0db19ac

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

TwitchLib.EventSub.Websockets/EventSubWebsocketClient.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ public class EventSubWebsocketClient
343343
/// <param name="serviceProvider">DI Container to resolve other dependencies dynamically</param>
344344
/// <param name="websocketClient">Underlying Websocket client to connect to connect to EventSub Websocket service</param>
345345
/// <exception cref="ArgumentNullException">Throws ArgumentNullException if a dependency is null</exception>
346-
public EventSubWebsocketClient ( ILogger<EventSubWebsocketClient> logger, IEnumerable<INotificationHandler> handlers, IServiceProvider serviceProvider, WebsocketClient websocketClient )
346+
public EventSubWebsocketClient(ILogger<EventSubWebsocketClient> logger, IEnumerable<INotificationHandler> handlers, IServiceProvider serviceProvider, WebsocketClient websocketClient)
347347
{
348348
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
349349
_serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
@@ -362,7 +362,7 @@ public EventSubWebsocketClient ( ILogger<EventSubWebsocketClient> logger, IEnume
362362
/// Instantiates an EventSubWebsocketClient used to subscribe to EventSub notifications via Websockets.
363363
/// </summary>
364364
/// <param name="loggerFactory">LoggerFactory used to construct Loggers for the EventSubWebsocketClient and underlying classes</param>
365-
public EventSubWebsocketClient ( ILoggerFactory loggerFactory = null )
365+
public EventSubWebsocketClient(ILoggerFactory loggerFactory = null)
366366
{
367367
_loggerFactory = loggerFactory;
368368

@@ -394,7 +394,7 @@ public EventSubWebsocketClient ( ILoggerFactory loggerFactory = null )
394394
/// </summary>
395395
/// <param name="url">Optional url param to be able to connect to reconnect urls provided by Twitch or test servers</param>
396396
/// <returns>true: Connection successful false: Connection failed</returns>
397-
public async Task<bool> ConnectAsync ( Uri url = null )
397+
public async Task<bool> ConnectAsync(Uri url = null)
398398
{
399399
url = url ?? new Uri(WEBSOCKET_URL);
400400
_lastReceived = DateTimeOffset.MinValue;
@@ -417,7 +417,7 @@ public async Task<bool> ConnectAsync ( Uri url = null )
417417
/// Disconnect from Twitch EventSub Websockets
418418
/// </summary>
419419
/// <returns>true: Disconnect successful false: Disconnect failed</returns>
420-
public async Task<bool> DisconnectAsync ()
420+
public async Task<bool> DisconnectAsync()
421421
{
422422
_cts?.Cancel();
423423
return await _websocketClient.DisconnectAsync();
@@ -427,7 +427,7 @@ public async Task<bool> DisconnectAsync ()
427427
/// Reconnect to Twitch EventSub Websockets with a Twitch given Url
428428
/// </summary>
429429
/// <returns>true: Reconnect successful false: Reconnect failed</returns>
430-
public Task<bool> ReconnectAsync ()
430+
public Task<bool> ReconnectAsync()
431431
{
432432
return ReconnectAsync(new Uri(WEBSOCKET_URL));
433433
}
@@ -437,7 +437,7 @@ public Task<bool> ReconnectAsync ()
437437
/// </summary>
438438
/// <param name="url">New Websocket Url to connect to, to preserve current session and topics</param>
439439
/// <returns>true: Reconnect successful false: Reconnect failed</returns>
440-
private async Task<bool> ReconnectAsync ( Uri url )
440+
private async Task<bool> ReconnectAsync(Uri url)
441441
{
442442
url = url ?? new Uri(WEBSOCKET_URL);
443443

@@ -509,7 +509,7 @@ private async Task<bool> ReconnectAsync ( Uri url )
509509
/// Setup handlers for all supported subscription types
510510
/// </summary>
511511
/// <param name="handlers">Enumerable of handlers that are responsible for acting on a specified subscription type</param>
512-
private void PrepareHandlers ( IEnumerable<INotificationHandler> handlers )
512+
private void PrepareHandlers(IEnumerable<INotificationHandler> handlers)
513513
{
514514
_handlers = _handlers ?? new Dictionary<string, Action<EventSubWebsocketClient, string, JsonSerializerOptions>>();
515515

@@ -529,7 +529,7 @@ private void PrepareHandlers ( IEnumerable<INotificationHandler> handlers )
529529
/// <para>E.g. a Twitch specified 10 seconds minimum frequency would result in 12 seconds used by the client to honor network latencies and so on.</para>
530530
/// </summary>
531531
/// <returns>a Task that represents the background operation</returns>
532-
private async Task ConnectionCheckAsync ()
532+
private async Task ConnectionCheckAsync()
533533
{
534534
while (_cts != null && _websocketClient.IsConnected && !_cts.IsCancellationRequested)
535535
{
@@ -551,7 +551,7 @@ private async Task ConnectionCheckAsync ()
551551
/// </summary>
552552
/// <param name="sender">Sender of the event. In this case <see cref="WebsocketClient"/></param>
553553
/// <param name="e">EventArgs send with the event. <see cref="DataReceivedArgs"/></param>
554-
private async Task OnDataReceived ( object sender, DataReceivedArgs e )
554+
private async Task OnDataReceived(object sender, DataReceivedArgs e)
555555
{
556556
_lastReceived = DateTimeOffset.Now;
557557

@@ -596,7 +596,7 @@ private async Task OnDataReceived ( object sender, DataReceivedArgs e )
596596
/// </summary>
597597
/// <param name="sender">Sender of the event. In this case <see cref="WebsocketClient"/></param>
598598
/// <param name="e">EventArgs send with the event. <see cref="ErrorOccuredArgs"/></param>
599-
private async Task OnErrorOccurred ( object sender, ErrorOccuredArgs e )
599+
private async Task OnErrorOccurred(object sender, ErrorOccuredArgs e)
600600
{
601601
await ErrorOccurred.InvokeAsync(this, e);
602602
}
@@ -605,7 +605,7 @@ private async Task OnErrorOccurred ( object sender, ErrorOccuredArgs e )
605605
/// Handles 'session_reconnect' notifications
606606
/// </summary>
607607
/// <param name="message">notification message received from Twitch EventSub</param>
608-
private void HandleReconnect ( string message )
608+
private void HandleReconnect(string message)
609609
{
610610
_logger?.LogReconnectRequested(SessionId);
611611
var data = JsonSerializer.Deserialize<EventSubWebsocketSessionInfoMessage>(message, _jsonSerializerOptions);
@@ -620,7 +620,7 @@ private void HandleReconnect ( string message )
620620
/// Handles 'session_welcome' notifications
621621
/// </summary>
622622
/// <param name="message">notification message received from Twitch EventSub</param>
623-
private async ValueTask HandleWelcome ( string message )
623+
private async ValueTask HandleWelcome(string message)
624624
{
625625
var data = JsonSerializer.Deserialize<EventSubWebsocketSessionInfoMessage>(message, _jsonSerializerOptions);
626626

@@ -644,7 +644,7 @@ private async ValueTask HandleWelcome ( string message )
644644
/// Handles 'session_disconnect' notifications
645645
/// </summary>
646646
/// <param name="message">notification message received from Twitch EventSub</param>
647-
private async Task HandleDisconnect ( string message )
647+
private async Task HandleDisconnect(string message)
648648
{
649649
var data = JsonSerializer.Deserialize<EventSubWebsocketSessionInfoMessage>(message);
650650

@@ -658,7 +658,7 @@ private async Task HandleDisconnect ( string message )
658658
/// Handles 'session_keepalive' notifications
659659
/// </summary>
660660
/// <param name="message">notification message received from Twitch EventSub</param>
661-
private void HandleKeepAlive ( string message )
661+
private void HandleKeepAlive(string message)
662662
{
663663
_logger?.LogMessage(message);
664664
}
@@ -668,7 +668,7 @@ private void HandleKeepAlive ( string message )
668668
/// </summary>
669669
/// <param name="message">notification message received from Twitch EventSub</param>
670670
/// <param name="subscriptionType">subscription type received from Twitch EventSub</param>
671-
private void HandleNotification ( string message, string subscriptionType )
671+
private void HandleNotification(string message, string subscriptionType)
672672
{
673673
if (_handlers != null && _handlers.TryGetValue(subscriptionType, out var handler))
674674
handler(this, message, _jsonSerializerOptions);
@@ -680,7 +680,7 @@ private void HandleNotification ( string message, string subscriptionType )
680680
/// Handles 'revocation' notifications
681681
/// </summary>
682682
/// <param name="message">notification message received from Twitch EventSub</param>
683-
private void HandleRevocation ( string message )
683+
private void HandleRevocation(string message)
684684
{
685685
if (_handlers != null && _handlers.TryGetValue("revocation", out var handler))
686686
handler(this, message, _jsonSerializerOptions);
@@ -693,7 +693,7 @@ private void HandleRevocation ( string message )
693693
/// </summary>
694694
/// <param name="eventName">name of the event to raise</param>
695695
/// <param name="args">args to pass with the event</param>
696-
internal async void RaiseEvent ( string eventName, object args = null )
696+
internal async void RaiseEvent(string eventName, object args = null)
697697
{
698698
var fInfo = GetType().GetField(eventName, BindingFlags.Instance | BindingFlags.NonPublic);
699699

TwitchLib.EventSub.Websockets/Handler/Channel/Chat/ChatMessageDeleteHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class ChatMessageDeleteHandler : INotificationHandler
1212
{
1313
public string SubscriptionType => "channel.chat.message_delete";
1414

15-
public void Handle ( EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions )
15+
public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions)
1616
{
1717
try
1818
{

TwitchLib.EventSub.Websockets/Handler/Channel/Chat/ChatNotificationHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class ChatNotificationHandler : INotificationHandler
1212
{
1313
public string SubscriptionType => "channel.chat.notification";
1414

15-
public void Handle ( EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions )
15+
public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions)
1616
{
1717
try
1818
{

0 commit comments

Comments
 (0)