Merge pull request #431 from AntiTcb/issues/427

Issues/427 + AliasAttribute targets classes
This commit is contained in:
Christopher F
2016-12-20 02:09:28 -05:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -3,7 +3,7 @@ using System;
namespace Discord.Commands
{
/// <summary> Provides aliases for a command. </summary>
[AttributeUsage(AttributeTargets.Method)]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
public class AliasAttribute : Attribute
{
/// <summary> The aliases which have been defined for the command. </summary>

View File

@@ -65,8 +65,8 @@ namespace Discord.Commands
result = level.Aliases.Permutate(result, (second, first) => first + " " + second);
}
if (result == null) //there were no aliases; default to an empty list
result = new List<string>();
if (result == null) //there were no aliases; default to an empty string alias
result = new List<string> { "" };
return result;
}