Skip to content
This repository has been archived by the owner on Apr 20, 2022. It is now read-only.

Commit

Permalink
Fix Message/User commands are not being executed when their name have…
Browse files Browse the repository at this point in the history
… 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 a9c15ff.

* Revert "add autocomplete respond method to IAutocompleteInteraction"

This reverts commit f2fc50f.

* fix command parsing for names with spaces
  • Loading branch information
Cenngo authored Nov 26, 2021
1 parent 9d9c8ad commit 27c249b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Discord.Net.Interactions/Map/CommandMap.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;

namespace Discord.Interactions
{
Expand Down Expand Up @@ -46,8 +47,13 @@ public void RemoveCommand(T command)
_root.RemoveCommand(key, 0);
}

public SearchResult<T> GetCommand(string input) =>
GetCommand(input.Split(_seperators));
public SearchResult<T> GetCommand(string input)
{
if(_seperators.Any())
return GetCommand(input.Split(_seperators));
else
return GetCommand(new string[] { input });
}

public SearchResult<T> GetCommand(string[] input) =>
_root.GetCommand(input, 0);
Expand Down

0 comments on commit 27c249b

Please sign in to comment.