From 923d3109bae355fbb6c25fb3982759128a36a84b Mon Sep 17 00:00:00 2001 From: Wizzy69 Date: Thu, 21 Apr 2022 21:20:26 +0300 Subject: [PATCH] Fixed some warnings --- DiscordBot/Discord/Core/Boot.cs | 6 +++--- DiscordBot/Discord/Core/CommandHandler.cs | 6 ++++-- PluginManager/Online/ServerCom.cs | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/DiscordBot/Discord/Core/Boot.cs b/DiscordBot/Discord/Core/Boot.cs index 08128d3..043e930 100644 --- a/DiscordBot/Discord/Core/Boot.cs +++ b/DiscordBot/Discord/Core/Boot.cs @@ -16,9 +16,9 @@ namespace PluginManager.Core private bool isReady = false; - public DiscordSocketClient? client; - private CommandHandler? commandServiceHandler; - private CommandService? service; + public DiscordSocketClient client; + private CommandHandler commandServiceHandler; + private CommandService service; public Boot(string botToken, string botPrefix) { diff --git a/DiscordBot/Discord/Core/CommandHandler.cs b/DiscordBot/Discord/Core/CommandHandler.cs index d2621fc..c0524f9 100644 --- a/DiscordBot/Discord/Core/CommandHandler.cs +++ b/DiscordBot/Discord/Core/CommandHandler.cs @@ -11,6 +11,7 @@ using PluginManager.Loaders; using System.Threading.Tasks; using System.Linq; using Discord; +using System; namespace PluginManager.Core { @@ -21,7 +22,7 @@ namespace PluginManager.Core private readonly string botPrefix; internal static bool awaitRestartOnSetCommand = false; - internal static SocketUser? RestartOnSetCommandCaster = null; + internal static SocketUser RestartOnSetCommandCaster = null; public CommandHandler(DiscordSocketClient client, CommandService commandService, string botPrefix) { @@ -72,6 +73,7 @@ namespace PluginManager.Core } var fileName = Assembly.GetExecutingAssembly().Location; System.Diagnostics.Process.Start(fileName); + Environment.Exit(0); } } return; @@ -85,7 +87,7 @@ namespace PluginManager.Core services: null ); - DBCommand? plugin = PluginLoader.Plugins!.Where(p => p.Command == (message.Content.Split(' ')[0]).Substring(botPrefix.Length)).FirstOrDefault(); + DBCommand plugin = PluginLoader.Plugins!.Where(p => p.Command == (message.Content.Split(' ')[0]).Substring(botPrefix.Length)).FirstOrDefault(); if (plugin != null) diff --git a/PluginManager/Online/ServerCom.cs b/PluginManager/Online/ServerCom.cs index c5df790..7ec9209 100644 --- a/PluginManager/Online/ServerCom.cs +++ b/PluginManager/Online/ServerCom.cs @@ -24,6 +24,7 @@ namespace PluginManager.Online return s; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "")] public static async Task DownloadFileAsync(string url, string location, int downloadNumber, int totalToDownload) { WebClient client = new WebClient();