Change !help to not display aliases
Also improve message splitting and remove string concatenation to use faster and more memory-efficient methods
This commit is contained in:
parent
260918555d
commit
5c6a14154e
@ -40,7 +40,7 @@ class cmd:
|
|||||||
|
|
||||||
COMMANDS[name].append(self)
|
COMMANDS[name].append(self)
|
||||||
if alias:
|
if alias:
|
||||||
self.aliases.append(self)
|
self.aliases.append(name)
|
||||||
alias = True
|
alias = True
|
||||||
|
|
||||||
def __call__(self, func):
|
def __call__(self, func):
|
||||||
|
@ -6727,25 +6727,25 @@ def get_help(cli, rnick, chan, rest):
|
|||||||
|
|
||||||
# if command was not found, or if no command was given:
|
# if command was not found, or if no command was given:
|
||||||
for name, fn in COMMANDS.items():
|
for name, fn in COMMANDS.items():
|
||||||
if (name and not fn[0].admin_only and not fn[0].owner_only and name not
|
if (name and not fn[0].admin_only and not fn[0].owner_only and
|
||||||
in fn[0].aliases and fn[0].chan):
|
name not in fn[0].aliases and fn[0].chan):
|
||||||
fns.append("\u0002"+name+"\u0002")
|
fns.append("{0}{1}{0}".format("\u0002", name))
|
||||||
afns = []
|
afns = []
|
||||||
if is_admin(nick, cloak):
|
if is_admin(nick, cloak):
|
||||||
for name, fn in COMMANDS.items():
|
for name, fn in COMMANDS.items():
|
||||||
if fn[0].admin_only and name not in fn[0].aliases:
|
if fn[0].admin_only and name not in fn[0].aliases:
|
||||||
afns.append("\u0002"+name+"\u0002")
|
afns.append("{0}{1}{0}".format("\u0002", name))
|
||||||
fns.sort() # Output commands in alphabetical order
|
fns.sort() # Output commands in alphabetical order
|
||||||
if chan == nick:
|
if chan == nick:
|
||||||
pm(cli, nick, "Commands: "+", ".join(fns))
|
pm(cli, nick, "Commands: {0}".format(var.break_long_message(fns, ", ")))
|
||||||
else:
|
else:
|
||||||
cli.notice(nick, "Commands: "+", ".join(fns))
|
cli.notice(nick, "Commands: {0}".format(var.break_long_message(fns, ", ")))
|
||||||
if afns:
|
if afns:
|
||||||
afns.sort()
|
afns.sort()
|
||||||
if chan == nick:
|
if chan == nick:
|
||||||
pm(cli, nick, "Admin Commands: "+", ".join(afns))
|
pm(cli, nick, "Admin Commands: {0}".format(var.break_long_message(afns, ", ")))
|
||||||
else:
|
else:
|
||||||
cli.notice(nick, "Admin Commands: "+", ".join(afns))
|
cli.notice(nick, "Admin Commands: {0}".format(var.break_long_message(afns, ", ")))
|
||||||
|
|
||||||
@cmd("wiki", pm=True)
|
@cmd("wiki", pm=True)
|
||||||
def wiki(cli, nick, chan, rest):
|
def wiki(cli, nick, chan, rest):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user