Incase group is using old setting for nightmode, so it will unlock all permission

Signed-off-by: Yasir Aris M <git@yasirdev.my.id>
This commit is contained in:
Yasir Aris M 2023-10-17 12:51:47 +07:00
parent 693e1e3fe2
commit 171afc0f4a
2 changed files with 4 additions and 1 deletions

View file

@ -42,7 +42,7 @@ MOD_NOLOAD = ["subscene_dl"]
HELPABLE = {}
cleanmode = {}
botStartTime = time.time()
misskaty_version = "v2.11.3 - Stable"
misskaty_version = "v2.11.4 - Stable"
uvloop.install()
faulthandler_enable()

View file

@ -5,6 +5,7 @@
import platform
import re
from datetime import datetime, timedelta
from attr import Attribute
import pytz
from apscheduler.jobstores.base import ConflictingIdError
@ -105,6 +106,8 @@ async def un_mute_chat(chat_id: int, perm: ChatPermissions):
getlang = getlang or "en-US"
try:
await app.set_chat_permissions(chat_id, perm)
except AttributeError:
await app.set_chat_permissions(chat_id, ChatPermissions(all_perms=True))
except ChatAdminRequired:
await app.send_message(
LOG_CHANNEL,