Show a list of modules in help

This commit is contained in:
moneromooo 2015-01-11 09:47:24 +00:00
parent 5a6c3bd379
commit 6823e0f926
2 changed files with 17 additions and 0 deletions

View File

@ -163,6 +163,7 @@ def Help(nick,chan,cmd):
return
SendTo(nick, "See available commands with !commands or !commands <modulename>")
SendTo(nick, "Available modules: %s" % ", ".join(GetModuleNameList(IsAdmin(nick))))
SendTo(nick, "Get help on a particular module with !help <modulename>")
if coinspecs.web_wallet_url:
SendTo(nick, "No %s address ? You can use %s" % (coinspecs.name, coinspecs.web_wallet_url))

View File

@ -102,6 +102,22 @@ def RegisterModule(module):
return
modules[module['name']] = module
def GetModuleNameList(admin):
if admin:
all = True
else:
all = False
module_names = []
for command_name in commands:
for c in commands[command_name]:
if 'admin' in c and c['admin'] and not all:
continue
module = c['module']
if not module in module_names:
module_names.append(module)
return module_names
def RegisterCommand(command):
if command['name'] in commands:
log_warn('module %s redefined function %s from module %s' % (command['module'],command['name'],commands[command['name']][0]['module']))