PREPARE FOR CHAOS. Also, twitter added to markov
[scrappy.git] / modules / modmanage / modmanage.py
blob1fec06892ac84143f7025ef7a0e4e1cd30dfcc2a
1 #stuff for loading/unloading/managing/getting stats about modules
3 def init(scrap):
4 scrap.register_event("modmanage", "msg", modload_cmd)
5 scrap.register_event("modmanage", "msg", modunload_cmd)
6 scrap.register_event("modmanage", "msg", modlist_cmd)
7 scrap.register_event("modmanage", "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 if not param == "modmanage":
23 c.privmsg(list[5], bot.unload_module(param))
24 else:
25 c.privmsg(list[5], "Cannot unload modmanage.")
27 def modlist_cmd(c,list,bot):
28 """modlist - Lists loaded modules"""
29 if list[4] == "modlist" and list[3]:
30 c.privmsg(list[5],bot.modulelist)
32 def getevents_cmd(c, list, bot):
33 cmd = list[4].split(" ")[0]
34 if cmd == "getevents" and list[3]:
35 param = list[4].split(" ")[1]
36 param = "bot."+param+"_events"
37 c.privmsg(list[5], eval(param))