Add PriorityAttribute and sortby priority in Search

This commit is contained in:
FiniteReality
2016-09-15 18:43:06 +01:00
parent 015e38cc63
commit accb3e27b8
3 changed files with 23 additions and 1 deletions

View File

@@ -180,7 +180,7 @@ namespace Discord.Commands
public SearchResult Search(IUserMessage message, string input)
{
string lowerInput = input.ToLowerInvariant();
var matches = _map.GetCommands(input).ToImmutableArray();
var matches = _map.GetCommands(input).OrderByDescending(x => x.Priority).ToImmutableArray();
if (matches.Length > 0)
return SearchResult.FromSuccess(input, matches);