diff --git a/DiscordBot/Discord/Actions/ListPlugins.cs b/DiscordBot/Discord/Actions/ListPlugins.cs deleted file mode 100644 index 86c8484..0000000 --- a/DiscordBot/Discord/Actions/ListPlugins.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -using PluginManager.Interfaces; -using PluginManager.Others; - -namespace DiscordBot.Discord.Actions -{ - public class ListPlugins : ICommandAction - { - public string ActionName => "listplugs"; - - public string Description => "Lists all plugins"; - - public string Usage => "listplugs"; - - public InternalActionRunType RunType => InternalActionRunType.ON_CALL; - - public async Task Execute(string[] args) - { - - var manager = new PluginManager.Online.PluginsManager(Program.URLs["PluginList"], Program.URLs["PluginVersions"]); - if (manager == null) - { - Console.WriteLine("Plugin manager is null"); - return; - } - - - var data = await manager.GetAvailablePlugins(); - var items = new List - { - new[] { "-", "-", "-", "-" }, - new[] { "Name", "Type", "Description", "Required" }, - new[] { "-", "-", "-", "-" } - }; - - foreach (var plugin in data) - { - items.Add(new[] { plugin[0], plugin[1], plugin[2], plugin[3] }); - } - - items.Add(new[] { "-", "-", "-", "-" }); - - DiscordBot.Utilities.Utilities.FormatAndAlignTable(items, Utilities.TableFormat.DEFAULT); - } - } -} \ No newline at end of file diff --git a/DiscordBot/Discord/Actions/LoadPlugins.cs b/DiscordBot/Discord/Actions/LoadPlugins.cs deleted file mode 100644 index f91aefe..0000000 --- a/DiscordBot/Discord/Actions/LoadPlugins.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System.Runtime.CompilerServices; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using PluginManager.Interfaces; -using PluginManager.Loaders; -using PluginManager.Others; - -namespace DiscordBot.Discord.Actions -{ - public class LoadPlugins : ICommandAction - { - public string ActionName => "loadplugs"; - - public string Description => "Loads all plugins"; - - public string Usage => "loadplugs"; - - private bool pluginsLoaded = false; - - public InternalActionRunType RunType => InternalActionRunType.ON_STARTUP; - - public async Task Execute(string[] args) - { - if (pluginsLoaded) - return; - var loader = new PluginLoader(PluginManager.Config.DiscordBot.client); - var cc = Console.ForegroundColor; - loader.onCMDLoad += (name, typeName, success, exception) => - { - if (name == null || name.Length < 2) - name = typeName; - if (success) - { - Console.ForegroundColor = ConsoleColor.Green; - Console.WriteLine("[CMD] Successfully loaded command : " + name); - } - - else - { - Console.ForegroundColor = ConsoleColor.Red; - if (exception is null) - Console.WriteLine("An error occured while loading: " + name); - else - Console.WriteLine("[CMD] Failed to load command : " + name + " because " + exception!.Message); - } - - Console.ForegroundColor = cc; - }; - loader.onEVELoad += (name, typeName, success, exception) => - { - if (name == null || name.Length < 2) - name = typeName; - - if (success) - { - Console.ForegroundColor = ConsoleColor.Green; - Console.WriteLine("[EVENT] Successfully loaded event : " + name); - } - else - { - Console.ForegroundColor = ConsoleColor.Red; - Console.WriteLine("[EVENT] Failed to load event : " + name + " because " + exception!.Message); - } - - Console.ForegroundColor = cc; - }; - - loader.onSLSHLoad += (name, typeName, success, exception) => - { - if (name == null || name.Length < 2) - name = typeName; - - if (success) - { - Console.ForegroundColor = ConsoleColor.Green; - Console.WriteLine("[SLASH] Successfully loaded command : " + name); - } - else - { - Console.ForegroundColor = ConsoleColor.Red; - Console.WriteLine("[SLASH] Failed to load command : " + name + " because " + exception!.Message); - } - - Console.ForegroundColor = cc; - }; - - loader.LoadPlugins(); - Console.ForegroundColor = cc; - pluginsLoaded = true; - } - } -} \ No newline at end of file diff --git a/DiscordBot/Discord/Actions/Plugin.cs b/DiscordBot/Discord/Actions/Plugin.cs index 72b3b47..57a2c02 100644 --- a/DiscordBot/Discord/Actions/Plugin.cs +++ b/DiscordBot/Discord/Actions/Plugin.cs @@ -51,7 +51,7 @@ public class Plugin : ICommandAction items.Add(new[] { "-", "-", "-", "-" }); - DiscordBot.Utilities.Utilities.FormatAndAlignTable(items, Utilities.TableFormat.DEFAULT); + Utilities.Utilities.FormatAndAlignTable(items, Utilities.TableFormat.DEFAULT); break; diff --git a/DiscordBot/Utilities/Enums.cs b/DiscordBot/Utilities/Enums.cs index 7a42cc4..2b0808d 100644 --- a/DiscordBot/Utilities/Enums.cs +++ b/DiscordBot/Utilities/Enums.cs @@ -12,10 +12,4 @@ namespace DiscordBot.Utilities CENTER_OVERALL_LENGTH, DEFAULT } - - public enum ProgressBarType - { - NORMAL, - NO_END - } }