help works

This commit is contained in:
lickthecheese 2020-02-01 08:16:35 -05:00
parent e560053e8a
commit 628375b520
3 changed files with 6 additions and 3 deletions

2
bot.py
View File

@ -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

View File

@ -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):