-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathNickServ.cs
55 lines (44 loc) · 1.01 KB
/
NickServ.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
49
50
51
52
53
54
55
using MikuBot.Modules;
using MikuBot.Commands;
namespace MikuBot.ExtraPlugins
{
public class NickServ : GenericModuleBase
{
private void Identify(IBotContext bot)
{
var pass = bot.Config.NickServPass;
if (!string.IsNullOrWhiteSpace(pass))
bot.Writer.Msg("NickServ", "IDENTIFY " + pass);
}
public override string HelpText
{
get { return "Identifies the bot with NickServ."; }
}
public override void OnConnected(IBotContext bot)
{
Identify(bot);
}
public override void OnLoaded(IBotContext bot, IModuleFile moduleFile)
{
if (bot.IsConnected)
Identify(bot);
}
public override void HandleCommand(IrcCommand command, IBotContext bot)
{
if (!(command is MsgCommand))
return;
var msg = (MsgCommand)command;
if (!msg.BotCommand.Is(Name) || !CheckAccess(command, bot))
return;
Identify(bot);
}
public override BotUserLevel MinUserLevel
{
get { return BotUserLevel.Manager; }
}
public override string Name
{
get { return "NickServ"; }
}
}
}