-
Notifications
You must be signed in to change notification settings - Fork 0
/
Command.cs
35 lines (28 loc) · 928 Bytes
/
Command.cs
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
35
namespace ZenioxBot
{
using NetIrc2;
public class Command
{
public Command(string name, CommandFunction function)
{
this.Name = name;
this.Function = function;
CommandDispatcher.CommandList.Add(this.Name, this);
}
/// <summary>
/// The command function.
/// </summary>
/// <param name="commandParameters">The parameters that describes the command and the command context.</param>
public delegate void CommandFunction(CommandParameters commandParameters);
public string Name { get; private set; }
public CommandFunction Function { get; private set; }
public static string GetReceiver(IrcIdentity sender, Channel channel)
{
if (null != channel)
{
return channel.Name;
}
return sender.Username;
}
}
}