mirror of
https://git.wownero.com/wownero/tippero.git
synced 2024-08-15 00:33:14 +00:00
Show a list of modules in help
This commit is contained in:
parent
5a6c3bd379
commit
6823e0f926
2 changed files with 17 additions and 0 deletions
|
@ -163,6 +163,7 @@ def Help(nick,chan,cmd):
|
||||||
return
|
return
|
||||||
|
|
||||||
SendTo(nick, "See available commands with !commands or !commands <modulename>")
|
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>")
|
SendTo(nick, "Get help on a particular module with !help <modulename>")
|
||||||
if coinspecs.web_wallet_url:
|
if coinspecs.web_wallet_url:
|
||||||
SendTo(nick, "No %s address ? You can use %s" % (coinspecs.name, coinspecs.web_wallet_url))
|
SendTo(nick, "No %s address ? You can use %s" % (coinspecs.name, coinspecs.web_wallet_url))
|
||||||
|
|
|
@ -102,6 +102,22 @@ def RegisterModule(module):
|
||||||
return
|
return
|
||||||
modules[module['name']] = module
|
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):
|
def RegisterCommand(command):
|
||||||
if command['name'] in commands:
|
if command['name'] in commands:
|
||||||
log_warn('module %s redefined function %s from module %s' % (command['module'],command['name'],commands[command['name']][0]['module']))
|
log_warn('module %s redefined function %s from module %s' % (command['module'],command['name'],commands[command['name']][0]['module']))
|
||||||
|
|
Loading…
Reference in a new issue