What have I been doing all night\?\!
[scrappy.git] / modules / modmanage / modmanage.py
blobea3ad51a19965eae50b4fb752f9edf3818561356
1 #stuff for loading/unloading/managing/getting stats about modules
3 def init(scrap):
4 scrap.register_event("msg", modload_cmd)
5 scrap.register_event("msg", modunload_cmd)
6 scrap.register_event("msg", modlist_cmd)
7 scrap.register_event("msg", getevents_cmd)
9 def modload_cmd(c,list,bot):
10 """modload - Loads a module"""
11 cmd = list[4].split(" ")[0]
13 if (cmd == "modload") or (cmd =="load") or (cmd =="loadmod") and list[3]:
14 param = list[4].split(" ")[1]
15 c.privmsg(list[5], bot.load_module(param))
17 def modunload_cmd(c, list, bot):
18 """modunload - Unloads a module"""
19 cmd = list[4].split(" ")[0]
20 if (cmd == "modunload") or (cmd == "unload") or (cmd == "unloadmod") and list[3]:
21 param = list[4].split(" ")[1]
22 c.privmsg(list[5], bot.unload_module(param))
23 #exec(list[4].split(" ")[1])
25 def modlist_cmd(c,list,bot):
26 """modlist - Lists loaded modules"""
27 if list[4] == "modlist" and list[3]:
28 c.privmsg(list[5],bot.modulelist)
30 def getevents_cmd(c, list, bot):
31 cmd = list[4].split(" ")[0]
32 if cmd == "getevents" and list[3]:
33 param = list[4].split(" ")[1]
34 param = "bot."+param+"_events"
35 c.privmsg(list[5], eval(param))