patch on discord bot UI
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user