From bb49f42549125aedad3ee6b9aa5efaf3274c3452 Mon Sep 17 00:00:00 2001 From: Madpeter <57852827+Madpeterz@users.noreply.github.com> Date: Wed, 29 Jan 2025 12:52:10 +0000 Subject: [PATCH] fix triggering custom commands --- SecondBotEvents/Services/CommandsService.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/SecondBotEvents/Services/CommandsService.cs b/SecondBotEvents/Services/CommandsService.cs index b2c1798..65ca489 100644 --- a/SecondBotEvents/Services/CommandsService.cs +++ b/SecondBotEvents/Services/CommandsService.cs @@ -344,13 +344,13 @@ namespace SecondBotEvents.Services } try { + string lowerName = C.command.ToLower(); - if(commandnameLowerToReal.ContainsKey(lowerName) == false) + if(commandnameLowerToReal.ContainsKey(lowerName) == true) { - return new KeyValuePair(false, "Unknown command"); + C.command = commandnameLowerToReal[lowerName]; } - C.command = commandnameLowerToReal[lowerName]; - if(master.CustomCommandsService.HasCommand(C.command) == true) + else if(master.CustomCommandsService.HasCommand(C.command) == true) { if(inCustomCommand == true) { @@ -358,6 +358,11 @@ namespace SecondBotEvents.Services } return master.CustomCommandsService.RunCommand(C, source); } + else + { + return new KeyValuePair(false, "Unknown command"); + } + KeyValuePair reply = RunBaseCommand(C, source); if (C.replyTarget != null) {