-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathClearCooldown.cs
50 lines (41 loc) · 1014 Bytes
/
ClearCooldown.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
using MikuBot.Commands;
using MikuBot.Modules;
namespace MikuBot.ExtraPlugins
{
public class ClearCooldown : MsgCommandModuleBase
{
public override int BotCommandParamCount
{
get { return 1; }
}
public override string CommandDescription
{
get { return "Clears cooldowns for a specific command for the calling user."; }
}
public override BotUserLevel MinUserLevel
{
get { return BotUserLevel.Manager; }
}
public override string Name
{
get { return "ClearCooldown"; }
}
public override string UsageHelp
{
get { return "ClearCooldown <command name>"; }
}
public override void HandleCommand(MsgCommand cmd, IBotContext bot)
{
if (!CheckCall(cmd, bot))
return;
var commandName = cmd.BotCommand.Params.ParamOrEmpty(0);
var command = bot.ModuleManager.FindModule(commandName) as MsgCommandModuleBase;
if (command == null)
{
bot.Writer.Msg(cmd.Sender.Nick, "Command not found");
return;
}
command.ClearCooldown(cmd);
}
}
}