Implement Command Aliases
This implementation could probably be more efficient, but I opted for clarity and simplicity where possible.
This commit is contained in:
18
src/Discord.Net.Commands/Attributes/AliasAttribute.cs
Normal file
18
src/Discord.Net.Commands/Attributes/AliasAttribute.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
|
||||
namespace Discord.Commands
|
||||
{
|
||||
/// <summary> Provides aliases for a command. </summary>
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class AliasAttribute : Attribute
|
||||
{
|
||||
/// <summary> The aliases which have been defined for the command. </summary>
|
||||
public string[] Aliases { get; }
|
||||
|
||||
/// <summary> Creates a new <see cref="AliasAttribute"/> with the given aliases. </summary>
|
||||
public AliasAttribute(params string[] aliases)
|
||||
{
|
||||
Aliases = aliases;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user