-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCommandAttribute.cs
More file actions
34 lines (31 loc) · 1.03 KB
/
CommandAttribute.cs
File metadata and controls
34 lines (31 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System;
using Ultz.Extensions.Commands.Built;
namespace Ultz.Extensions.Commands.Attributes.Commands
{
/// <summary>
/// Marks the method as a <see cref="Command" /> with the given aliases.
/// </summary>
[AttributeUsage(AttributeTargets.Method)]
public sealed class CommandAttribute : Attribute
{
/// <summary>
/// Initialises a new <see cref="CommandAttribute" /> with the specified aliases.
/// </summary>
/// <param name="aliases"> The aliases to set. </param>
/// <exception cref="ArgumentNullException">
/// Command aliases must not be null.
/// </exception>
public CommandAttribute(params string[] aliases)
{
if (aliases == null)
{
throw new ArgumentNullException(nameof(aliases), "Command aliases must not be null.");
}
Aliases = aliases;
}
/// <summary>
/// Gets the aliases.
/// </summary>
public string[] Aliases { get; }
}
}