diff --git a/Examples/AspNetCoreExample/Program.cs b/Examples/AspNetCoreExample/Program.cs index 99cfde3..8c6109f 100644 --- a/Examples/AspNetCoreExample/Program.cs +++ b/Examples/AspNetCoreExample/Program.cs @@ -4,7 +4,7 @@ var builder = WebApplication.CreateBuilder(args); -var slackSettings = builder.Configuration.GetSection("Slack").Get(); +var slackSettings = builder.Configuration.GetSection("Slack").Get()!; builder.Services.AddSlackNet(c => c // Configure the tokens used to authenticate with Slack diff --git a/SlackNet/Default.cs b/SlackNet/Default.cs index 567cc34..a5b0a79 100644 --- a/SlackNet/Default.cs +++ b/SlackNet/Default.cs @@ -49,7 +49,7 @@ private static JsonSerializerSettings SerializerSettings(ISlackTypeResolver slac public static ISlackTypeResolver SlackTypeResolver(params Assembly[] assembliesContainingSlackTypes) => new SlackTypeResolver(assembliesContainingSlackTypes); - public static Assembly[] AssembliesContainingSlackTypes => new[] { typeof(Default).GetTypeInfo().Assembly }; + public static Assembly[] AssembliesContainingSlackTypes => [typeof(Default).GetTypeInfo().Assembly]; public static IWebSocketFactory WebSocketFactory => new WebSocketFactory(); diff --git a/SlackNet/SlackRtmClient.cs b/SlackNet/SlackRtmClient.cs index 31da00a..c91b003 100644 --- a/SlackNet/SlackRtmClient.cs +++ b/SlackNet/SlackRtmClient.cs @@ -144,9 +144,9 @@ await _webSocket.Connect( /// /// Is the client connecting or has it connected. /// - public bool Connected => - _webSocket?.State == WebSocketState.Connecting - || _webSocket?.State == WebSocketState.Open; + public bool Connected => _webSocket?.State + is WebSocketState.Connecting + or WebSocketState.Open; /// /// Send a simple message. For more complicated messages, use instead.