Added Help Command and allowed empty collection instead of null for aliases in IDbCommand

This commit is contained in:
2025-04-28 12:08:24 +03:00
parent 7106a928d6
commit 16b6e42a97
4 changed files with 84 additions and 5 deletions

View File

@@ -112,7 +112,6 @@ internal class CommandHandler : ICommandHandler
.FirstOrDefault(plug => plug.Command ==
message.Content.Substring(mentionPrefix.Length + 1)
.Split(' ')[0] ||
plug.Aliases is not null &&
plug.Aliases.Contains(message.CleanContent
.Substring(mentionPrefix.Length + 1)
.Split(' ')[0]
@@ -127,7 +126,6 @@ internal class CommandHandler : ICommandHandler
plugin = _pluginLoader.Commands!
.FirstOrDefault(p => p.Command ==
message.Content.Split(' ')[0].Substring(_botPrefix.Length) ||
p.Aliases is not null &&
p.Aliases.Contains(
message.Content.Split(' ')[0]
.Substring(_botPrefix.Length)

View File

@@ -12,6 +12,8 @@ namespace DiscordBotCore.Bot;
public class DiscordBotApplication : IDiscordBotApplication
{
internal static IPluginLoader _InternalPluginLoader;
private static readonly string _DefaultPrefix = ";";
private CommandHandler _CommandServiceHandler;
@@ -27,11 +29,13 @@ public class DiscordBotApplication : IDiscordBotApplication
/// <summary>
/// The main Boot constructor
/// </summary>
public DiscordBotApplication(ILogger logger, IConfiguration configuration, IPluginLoader pluginLoaderOld)
public DiscordBotApplication(ILogger logger, IConfiguration configuration, IPluginLoader pluginLoader)
{
this._Logger = logger;
this._Configuration = configuration;
this._pluginLoader = pluginLoaderOld;
this._pluginLoader = pluginLoader;
_InternalPluginLoader = pluginLoader;
}
public async Task StopAsync()