-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathAct.cs
47 lines (38 loc) · 876 Bytes
/
Act.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
36
37
38
39
40
41
42
43
44
45
46
47
using MikuBot.Commands;
using MikuBot.Modules;
namespace MikuBot.ExtraPlugins
{
public class Act : MsgCommandModuleBase
{
public override int BotCommandParamCount
{
get { return 2; }
}
public override string CommandDescription
{
get { return "Sends an action to a specific receiver."; }
}
public override string UsageHelp
{
get { return "act <receiver> <message text>"; }
}
public override void HandleCommand(MsgCommand msg, IBotContext bot)
{
if (!CheckCall(msg, bot))
return;
var cmdParser = new CmdReader(msg.Text);
cmdParser.ReadNext();
var channel = cmdParser.ReadNext();
var text = cmdParser.ReadToEnd();
bot.Writer.Action(channel, text);
}
public override BotUserLevel MinUserLevel
{
get { return BotUserLevel.Manager; }
}
public override string Name
{
get { return "Act"; }
}
}
}