1 #Module for scrappy that implements some core commands, like 'help'
7 scrap
.register_event("core", "msg", help_cmd
)
8 scrap
.register_event("core", "msg", join_cmd
)
10 def help_cmd(c
,list,bot
):
11 """help - Lists all available commands and their docstrings"""
12 if list[4] == "help" and list[3]:
13 #put the events into a set so we can compute the union
14 #Or maybe we should use sets for the events from the start?
19 for event
in bot
.privmsg_events
:
21 for event
in bot
.pubmsg_events
:
24 funcnames
= s1
.union(s2
)
26 for name
in funcnames
:
27 c
.privmsg(list[0],name
)
29 def join_cmd(c
,list,bot
):
31 cmd
= list[4].split(" ")[0]
33 #replace tcoppi with the name of the bot owner(config option)
34 if cmd
== "join" and list[0] == "tcoppi":
35 chan
= list[4].split(" ")[1]