-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathOp.cs
48 lines (39 loc) · 1003 Bytes
/
Op.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
48
using System.Linq;
using MikuBot.Commands;
using MikuBot.Modules;
namespace MikuBot.ExtraPlugins
{
public class Op : MsgCommandModuleBase
{
public override int BotCommandParamCount
{
get { return 2; }
}
public override string CommandDescription
{
get { return "Gives ops to one or more users on a channel. The bot needs to be an operator first."; }
}
public override string UsageHelp
{
get { return "op <channel> <user1> [<user2>]..."; }
}
public override void HandleCommand(MsgCommand msg, IBotContext bot)
{
if (!CheckCall(msg, bot))
return;
var cmdParser = new CmdReader(msg.Text);
cmdParser.ReadNext();
var channel = msg.BotCommand.Params[0];
var nicks = string.Join(" ", msg.BotCommand.Params.Skip(1));
bot.Writer.Send(string.Format("mode {0} +o {1}", channel, nicks));
}
public override BotUserLevel MinUserLevel
{
get { return BotUserLevel.Admin; }
}
public override string Name
{
get { return "Op"; }
}
}
}