From 873855937fb34fb582efe2f31d0e693ebe7fd862 Mon Sep 17 00:00:00 2001 From: Tudor Andrei Date: Fri, 24 Feb 2023 16:46:59 +0200 Subject: [PATCH] --- .gitignore | 3 ++- DiscordBot/Discord/Core/CommandHandler.cs | 7 +------ PluginManager/Others/CmdArgs.cs | 8 ++++++++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index edb5abd..7cf8b6f 100644 --- a/.gitignore +++ b/.gitignore @@ -371,4 +371,5 @@ FodyWeavers.xsd /DiscordBot.rar /DiscordBot/Data/ /DiscordBot/Updater/ -.vscode/ \ No newline at end of file +.vscode/ +.idea/ \ No newline at end of file diff --git a/DiscordBot/Discord/Core/CommandHandler.cs b/DiscordBot/Discord/Core/CommandHandler.cs index 0bdf254..f030628 100644 --- a/DiscordBot/Discord/Core/CommandHandler.cs +++ b/DiscordBot/Discord/Core/CommandHandler.cs @@ -146,12 +146,7 @@ internal class CommandHandler if(split.Length > 1) argsClean = string.Join(' ', split, 1, split.Length-1).Split(' '); - CmdArgs cmd = new() { - context = context, - cleanContent = cleanMessage, - commandUsed = split[0], - arguments = argsClean - }; + CmdArgs cmd = new(context, cleanMessage, split[0], argsClean); if (context.Channel is SocketDMChannel) plugin.ExecuteDM(cmd); diff --git a/PluginManager/Others/CmdArgs.cs b/PluginManager/Others/CmdArgs.cs index bc3c6fb..14ad428 100644 --- a/PluginManager/Others/CmdArgs.cs +++ b/PluginManager/Others/CmdArgs.cs @@ -15,5 +15,13 @@ namespace PluginManager.Others public string commandUsed { get;init; } public string[] arguments { get;init; } + public CmdArgs(SocketCommandContext context, string cleanContent, string commandUsed, string[] arguments) + { + this.context = context; + this.cleanContent = cleanContent; + this.commandUsed = commandUsed; + this.arguments = arguments; + } + } }