Reorganized commands structure

This commit is contained in:
RogueException
2016-06-21 05:32:49 -03:00
parent 2e8f67e8a4
commit 32ab967f4a
7 changed files with 165 additions and 128 deletions

View File

@@ -0,0 +1,35 @@
using System;
using System.Reflection;
namespace Discord.Commands
{
public class Command
{
private Action<IMessage> _action;
public string Name { get; }
public string Description { get; }
public string Text { get; }
internal Command(CommandAttribute attribute, MethodInfo methodInfo)
{
var description = methodInfo.GetCustomAttribute<DescriptionAttribute>();
if (description != null)
Description = description.Text;
Name = attribute.Name;
Text = attribute.Text;
}
public void Invoke(IMessage msg)
{
_action.Invoke(msg);
}
private void BuildAction()
{
_action = null;
//TODO: Implement
}
}
}