patch on discord bot UI

This commit is contained in:
2023-04-08 15:54:39 +03:00
parent 54a68d635d
commit 244209093e
12 changed files with 249 additions and 19 deletions

View File

@@ -66,7 +66,16 @@ public class PluginLoader
/// </summary>
public static List<DBSlashCommand>? SlashCommands { get; set; }
public static int PluginsLoaded { get => Commands!.Count + Events!.Count + SlashCommands!.Count;}
public static int PluginsLoaded { get {
var count = 0;
if (Commands is not null)
count += Commands.Count;
if (Events is not null)
count += Events.Count;
if (SlashCommands is not null)
count += SlashCommands.Count;
return count;
}}
/// <summary>
/// The main mathod that is called to load all events

View File

@@ -29,7 +29,7 @@ public class PluginsManager
/// The method to load all plugins
/// </summary>
/// <returns></returns>
public async Task ListAvailablePlugins()
public async Task<List<string[]>> ListAvailablePlugins()
{
try
{
@@ -81,12 +81,16 @@ public class PluginsManager
data.Add(new[] { "-", "-", "-", "-" });
Utilities.FormatAndAlignTable(data, TableFormat.CENTER_EACH_COLUMN_BASED);
return data;
}
catch (Exception exception)
{
Logger.WriteLine("Failed to execute command: listplugs\nReason: " + exception.Message);
Logger.WriteErrFile(exception.ToString());
}
return null;
}
/// <summary>