mirror of
https://github.com/Nick80835/microbot
synced 2025-08-31 22:46:01 +00:00
add silent_bail
This commit is contained in:
@@ -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:
|
||||
|
@@ -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()
|
||||
|
||||
|
Reference in New Issue
Block a user