mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-29 17:44:50 +00:00
Remove id from DB if chat is peer id invalid
Signed-off-by: yasirarism <github@yasir.eu.org>
This commit is contained in:
parent
c717921e06
commit
4d5ecc7ad4
1 changed files with 3 additions and 2 deletions
|
|
@ -14,6 +14,7 @@ from pyrogram.errors import (
|
|||
ChannelPrivate,
|
||||
ChatAdminRequired,
|
||||
ChatNotModified,
|
||||
PeerIdInvalid,
|
||||
)
|
||||
from pyrogram.types import ChatPermissions, InlineKeyboardButton, InlineKeyboardMarkup
|
||||
|
||||
|
|
@ -109,7 +110,7 @@ async def un_mute_chat(chat_id: int, perm: ChatPermissions):
|
|||
chat_id=chat_id, bname=BOT_NAME
|
||||
),
|
||||
)
|
||||
except (ChannelInvalid, ChannelPrivate):
|
||||
except (ChannelInvalid, ChannelPrivate, PeerIdInvalid):
|
||||
scheduler.remove_job(f"enable_nightmode_{chat_id}")
|
||||
scheduler.remove_job(f"disable_nightmode_{chat_id}")
|
||||
await app.send_message(
|
||||
|
|
@ -151,7 +152,7 @@ async def mute_chat(chat_id: int):
|
|||
chat_id=chat_id, bname=BOT_NAME
|
||||
),
|
||||
)
|
||||
except (ChannelInvalid, ChannelPrivate):
|
||||
except (ChannelInvalid, ChannelPrivate, PeerIdInvalid):
|
||||
scheduler.remove_job(f"enable_nightmode_{chat_id}")
|
||||
scheduler.remove_job(f"disable_nightmode_{chat_id}")
|
||||
await app.send_message(
|
||||
|
|
|
|||
Loading…
Reference in a new issue