|
|
@@ -2,7 +2,7 @@ import sys
|
|
|
import traceback
|
|
|
from functools import wraps
|
|
|
from wbb import app, LOG_GROUP_ID
|
|
|
-
|
|
|
+from pyrogram.errors.exceptions.forbidden_403 import ChatWriteForbidden
|
|
|
|
|
|
def split_limits(text):
|
|
|
if len(text) < 2048:
|
|
|
@@ -28,6 +28,9 @@ def capture_err(func):
|
|
|
async def capture(client, message, *args, **kwargs):
|
|
|
try:
|
|
|
return await func(client, message, *args, **kwargs)
|
|
|
+ except ChatWriteForbidden:
|
|
|
+ await app.leave_chat(message.chat.id)
|
|
|
+ return
|
|
|
except Exception as err:
|
|
|
exc_type, exc_obj, exc_tb = sys.exc_info()
|
|
|
errors = traceback.format_exception(
|