From 27c249b77f605df04246beb17062813372ba160e Mon Sep 17 00:00:00 2001 From: Cenk Ergen <57065323+Cenngo@users.noreply.github.com> Date: Fri, 26 Nov 2021 23:44:41 +0300 Subject: [PATCH] Fix Message/User commands are not being executed when their name have spaces on it (#310) * added interaction specific interfaces * fix build error * implement change requests * add autocomplete respond method to IAutocompleteInteraction * fix sharded client current user * fix generic typeconverter picking priority * Revert "fix sharded client current user" This reverts commit a9c15ffd6ab02651e83e72c275889502b60cfddc. * Revert "add autocomplete respond method to IAutocompleteInteraction" This reverts commit f2fc50f1f19a0b41144b6dc93080d2f3a01282fc. * fix command parsing for names with spaces --- src/Discord.Net.Interactions/Map/CommandMap.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Discord.Net.Interactions/Map/CommandMap.cs b/src/Discord.Net.Interactions/Map/CommandMap.cs index 6fd79ea81..aa5c7fcfc 100644 --- a/src/Discord.Net.Interactions/Map/CommandMap.cs +++ b/src/Discord.Net.Interactions/Map/CommandMap.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Discord.Interactions { @@ -46,8 +47,13 @@ namespace Discord.Interactions _root.RemoveCommand(key, 0); } - public SearchResult GetCommand(string input) => - GetCommand(input.Split(_seperators)); + public SearchResult GetCommand(string input) + { + if(_seperators.Any()) + return GetCommand(input.Split(_seperators)); + else + return GetCommand(new string[] { input }); + } public SearchResult GetCommand(string[] input) => _root.GetCommand(input, 0);