diff --git a/ubot/command.py b/ubot/command.py index bb7c970..45c2051 100644 --- a/ubot/command.py +++ b/ubot/command.py @@ -28,6 +28,7 @@ class Command: self.fun = args.get("fun", False) self.not_disableable = args.get("no_disable", False) or self.owner or self.sudo or self.admin self.no_private = args.get("no_private", False) + self.silent_bail = args.get("silent_bail", False) class InlinePhotoCommand: diff --git a/ubot/command_handler.py b/ubot/command_handler.py index e893da6..93a03fa 100644 --- a/ubot/command_handler.py +++ b/ubot/command_handler.py @@ -250,10 +250,11 @@ class CommandHandler(): if event.sender_id in command.locked_users: command.locked_users.remove(event.sender_id) - try: - await event.reply(f"An error occurred in **{command.function.__name__}**: `{exception}`") - except: - pass + if not command.silent_bail: + try: + await event.reply(f"An error occurred in **{command.function.__name__}**: `{exception}`") + except: + pass print_exc()