From fd0763f149dbe042603668c9b18cfb04e1a42a30 Mon Sep 17 00:00:00 2001 From: Nick80835 Date: Tue, 23 Mar 2021 20:07:59 -0400 Subject: [PATCH] add event.prefix --- ubot/command_handler.py | 1 + ubot/modules/system.py | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ubot/command_handler.py b/ubot/command_handler.py index 51cf36e..eecc536 100644 --- a/ubot/command_handler.py +++ b/ubot/command_handler.py @@ -76,6 +76,7 @@ class CommandHandler(): event.other_args = pattern_match.groups()[1:-1] else: event.other_args = pattern_match.groups()[2:-1] + event.prefix = pattern_match.groups()[0] event.pattern_match = pattern_match event.extra = command.extra diff --git a/ubot/modules/system.py b/ubot/modules/system.py index 04d2d0a..71cbf1f 100644 --- a/ubot/modules/system.py +++ b/ubot/modules/system.py @@ -34,15 +34,14 @@ async def help_cmd(event): await event.reply(f"**{command.pattern}** doesn't have a help string.") return - prefix = ldr.prefix() help_dict = {} for command in ldr.command_handler.incoming_commands: if not command.hide_help: if command.module in help_dict: - help_dict[command.module].append(prefix + command.pattern) + help_dict[command.module].append(event.prefix + command.pattern) else: - help_dict[command.module] = [prefix + command.pattern] + help_dict[command.module] = [event.prefix + command.pattern] help_string = "\n".join([f"**{module}**: {', '.join(pattern_list)}" for module, pattern_list in help_dict.items()])