Cleanups
[scrappy.git] / modules / core.py
blob7cea09651f5bc679a002811dbf8452e286c0664e
1 #Module for scrappy that implements some core commands, like 'help'
3 import sys
5 def __init__(scrap):
6 #register commands
7 scrap.register_msg_event(help_cmd)
9 def help_cmd(c,list,bot):
10 """help - Lists all available commands and their docstrings"""
11 if list[4] == "help" and list[3]:
12 #put the events into a set so we can compute the union
13 #Or maybe we should use sets for the events from the start?
15 s1 = set()
16 s2 = set()
18 for event in bot.privmsg_events:
19 s1.add(event.__doc__)
20 for event in bot.pubmsg_events:
21 s2.add(event.__doc__)
23 funcnames = s1.union(s2)
25 for name in funcnames:
26 c.privmsg(list[0],name)