2
0
mirror of https://github.com/Nick80835/microbot synced 2025-08-31 22:46:01 +00:00

add silent_bail

This commit is contained in:
Nick80835
2021-06-22 08:49:37 -04:00
parent ed76dfa50a
commit b5a21c03ef
2 changed files with 6 additions and 4 deletions

View File

@@ -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:

View File

@@ -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()