-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathUnauthenticate.cs
45 lines (38 loc) · 1 KB
/
Unauthenticate.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
using MikuBot.Commands;
using MikuBot.Modules;
namespace MikuBot.ExtraPlugins
{
public class Unauthenticate : MsgCommandModuleBase
{
public override void HandleCommand(MsgCommand cmd, IBotContext bot)
{
if (!CheckCall(cmd, bot))
return;
var user = cmd.BotCommand.Params.HasParam(0) ? new Hostmask(cmd.BotCommand.Params[0]) : cmd.SenderHost;
if (bot.Authenticator.Unauthenticate(user))
{
bot.Writer.Notice(cmd.Sender.Nick, "User has been unauthenticated.");
}
else
{
bot.Writer.Notice(cmd.Sender.Nick, "User is not authenticated.");
}
}
public override string CommandDescription
{
get { return "Unauthenticates (logs off) a user. If no hostmask is specified, the current user is unauthenticated."; }
}
public override string UsageHelp
{
get { return "Unauthenticate [<hostmask>]"; }
}
public override BotUserLevel MinUserLevel
{
get { return BotUserLevel.Manager; }
}
public override string Name
{
get { return "Unauthenticate"; }
}
}
}