VpSharp/VpSharp.Commands/Command.cs

37 lines
878 B
C#
Raw Normal View History

2022-12-05 01:02:05 +00:00
using System.Reflection;
2022-11-27 20:43:21 +00:00
namespace VpSharp.Commands;
/// <summary>
/// Represents a registered command.
/// </summary>
public sealed class Command
{
internal Command(string name, IReadOnlyList<string> aliases, MethodInfo method, CommandModule module)
2022-11-27 20:43:21 +00:00
{
Name = name;
Aliases = aliases;
2022-11-27 20:43:21 +00:00
Method = method;
Module = module;
Parameters = method.GetParameters()[1..];
}
/// <summary>
/// Gets the aliases for this command.
/// </summary>
/// <value>The aliases.</value>
public IReadOnlyList<string> Aliases { get; }
2022-11-27 20:43:21 +00:00
/// <summary>
/// Gets the name of this command.
/// </summary>
/// <value>The name.</value>
public string Name { get; }
internal MethodInfo Method { get; }
internal CommandModule Module { get; }
internal ParameterInfo[] Parameters { get; }
}