help works
This commit is contained in:
parent
e560053e8a
commit
628375b520
2
bot.py
2
bot.py
|
@ -6,6 +6,7 @@ class Circles(teambot.Handler):
|
|||
self._bot = bot
|
||||
print('initilized')
|
||||
self.modules = []
|
||||
self.lm = []
|
||||
self.cmd = {}
|
||||
self.raw = {}
|
||||
self.help = {}
|
||||
|
@ -20,6 +21,7 @@ class Circles(teambot.Handler):
|
|||
m = __import__("modules."+i)
|
||||
m = eval('m.'+i)
|
||||
m.init(self)
|
||||
self.lm.append(i)
|
||||
self.modules.append(m)
|
||||
def registerCommand(self, txt, func):
|
||||
self.cmd[txt] = func
|
||||
|
|
Binary file not shown.
|
@ -1,13 +1,14 @@
|
|||
# base commands like help
|
||||
|
||||
def helpList(c):
|
||||
pass
|
||||
def helpList(self,c):
|
||||
self.say(c,'available commands: '+' '.join(list(self.help.keys())))
|
||||
|
||||
def help(self, c,n,m):
|
||||
m = m.split()[1]
|
||||
if m in list(self.help.keys()):
|
||||
self.say(c,self.help[m])
|
||||
else:
|
||||
helpList(c)
|
||||
helpList(self,c)
|
||||
|
||||
|
||||
def init(self):
|
||||
|
|
Loading…
Reference in New Issue