refactor help mk2
This commit is contained in:
parent
bf6e5784f2
commit
c09b4c04d3
|
@ -45,14 +45,14 @@ def help(bot, trigger):
|
|||
|
||||
else:
|
||||
if trigger.owner:
|
||||
cmds = [cmd for _, cmd in bot.commands.items()]
|
||||
funcs = [func for cmd, func in bot.commands.items()]
|
||||
elif trigger.admin:
|
||||
cmds = [cmd for _, cmd in bot.commands.items() if cmd.priv <= 5]
|
||||
funcs = [func for cmd, func in bot.commands.items() if cmd.priv <= 5]
|
||||
else:
|
||||
priv = bot.channels[trigger.channel].privileges[trigger.nick]
|
||||
cmds = [cmd for _, cmd in bot.commands.items() if cmd.priv <= priv]
|
||||
funcs = [func for cmd, func in bot.commands.items() if cmd.priv <= priv]
|
||||
|
||||
cmds = [cmd.name for cmd in cmds if cmd.canonical]
|
||||
cmds = sorted(cmds)
|
||||
cmds = {func.commands[0] for func in funcs}
|
||||
cmds = sorted(list(cmds))
|
||||
msg = "Available commands: " + ", ".join(cmds)
|
||||
bot.msg(msg)
|
||||
|
|
Loading…
Reference in New Issue
Block a user