From 6fc491a0d661c706144c7400c0acd742f595aa92 Mon Sep 17 00:00:00 2001 From: Wizzy69 Date: Fri, 7 Oct 2022 13:36:15 +0300 Subject: [PATCH] --- .gitignore | 2 ++ DiscordBot/Program.cs | 1 + PluginManager/Interfaces/AppExtension.cs | 17 +++++++++++++++++ PluginManager/Others/Functions.cs | 22 +++++++++++++--------- 4 files changed, 33 insertions(+), 9 deletions(-) create mode 100644 PluginManager/Interfaces/AppExtension.cs diff --git a/.gitignore b/.gitignore index 90acf30..d76e8eb 100644 --- a/.gitignore +++ b/.gitignore @@ -368,3 +368,5 @@ FodyWeavers.xsd #folders /Plugins/ /DiscordBot.rar +/DiscordBot/Data/ +/DiscordBot/Updater/ \ No newline at end of file diff --git a/DiscordBot/Program.cs b/DiscordBot/Program.cs index 4dfbfb2..6e40c0d 100644 --- a/DiscordBot/Program.cs +++ b/DiscordBot/Program.cs @@ -37,6 +37,7 @@ public class Program PreLoadComponents().Wait(); + if (!Config.ContainsKey("ServerID") || (!Config.ContainsKey("token") || Config.GetValue("token") == null || (Config.GetValue("token")?.Length != 70 && Config.GetValue("token")?.Length != 59)) || (!Config.ContainsKey("prefix") || Config.GetValue("prefix") == null || Config.GetValue("prefix")?.Length != 1) || (args.Length > 0 && args[0] == "/newconfig")) { Application.Init(); diff --git a/PluginManager/Interfaces/AppExtension.cs b/PluginManager/Interfaces/AppExtension.cs new file mode 100644 index 0000000..0fc62f3 --- /dev/null +++ b/PluginManager/Interfaces/AppExtension.cs @@ -0,0 +1,17 @@ +using PluginManager.Online.Helpers; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PluginManager.Interfaces +{ + public interface AppExtension + { + public string Name { get; } + public VersionString Version { get; } + + } +} \ No newline at end of file diff --git a/PluginManager/Others/Functions.cs b/PluginManager/Others/Functions.cs index f512f1e..fa9bc40 100644 --- a/PluginManager/Others/Functions.cs +++ b/PluginManager/Others/Functions.cs @@ -121,17 +121,21 @@ namespace PluginManager.Others /// A string built based on the array public static string MergeStrings(this string[] s, int indexToStart) { - string r = ""; - int len = s.Length; - if (len <= indexToStart) return ""; - for (int i = indexToStart; i < len - 1; ++i) - { - r += s[i] + " "; - } + return string.Join(' ', s, indexToStart, s.Length - 1); - r += s[len - 1]; + /* string r = ""; - return r; + int len = s.Length; + if (len <= indexToStart) return ""; + for (int i = indexToStart; i < len - 1; ++i) + { + r += s[i] + " "; + } + + r += s[len - 1]; + + return r; + */ } ///