Added Help Command and allowed empty collection instead of null for aliases in IDbCommand
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user