diff --git a/ubot/command.py b/ubot/command.py index 08379df..a18a99b 100644 --- a/ubot/command.py +++ b/ubot/command.py @@ -31,6 +31,7 @@ class Command: self.chance = args.get("chance", None) self.fun = args.get("fun", False) self.not_disableable = args.get("no_disable", False) or self.owner or self.sudo or self.admin + self.force_hard_prefix = args.get("force_hard_prefix", False) self.no_private = args.get("no_private", False) self.private_only = args.get("private_only", False) self.silent_bail = args.get("silent_bail", False) diff --git a/ubot/command_handler.py b/ubot/command_handler.py index 8f349e5..e675529 100644 --- a/ubot/command_handler.py +++ b/ubot/command_handler.py @@ -55,7 +55,7 @@ class CommandHandler(): elif command.raw_pattern: pattern_match = search(RAW_PATTERN_TEMPLATE.format(command.pattern + command.pattern_extra), event.raw_text, IGNORECASE|DOTALL) else: - if command.not_disableable: + if command.not_disableable or command.force_hard_prefix: prefix_list = self.hard_prefix + [chat_prefix] + ["/"] else: prefix_list = self.hard_prefix + [chat_prefix] diff --git a/ubot/modules/system.py b/ubot/modules/system.py index b55fb12..de6eba4 100644 --- a/ubot/modules/system.py +++ b/ubot/modules/system.py @@ -54,7 +54,7 @@ async def help_cmd(event): await event.reply(f"{prefix_help}Available commands:\n\n{help_string}", parse_mode="html") -@ldr.add("privacy") +@ldr.add("privacy", force_hard_prefix=True) async def privacy_policy(event): await event.reply( f"This bot (\"**{bot_name}**\") stores the IDs of chats in which it receives messages as well as configurations associated with those chats such as command prefixes and disabled commands. "