Browse Source

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 a9c15ffd6a.

* Revert "add autocomplete respond method to IAutocompleteInteraction"

This reverts commit f2fc50f1f1.

* fix command parsing for names with spaces
pull/1958/head
Cenk Ergen GitHub 3 years ago
parent
commit
27c249b77f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      src/Discord.Net.Interactions/Map/CommandMap.cs

+ 8
- 2
src/Discord.Net.Interactions/Map/CommandMap.cs View File

@@ -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<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);


Loading…
Cancel
Save