From c787019acbaaec0e961775859d7d8e5313735b95 Mon Sep 17 00:00:00 2001 From: Yasir Aris M Date: Tue, 17 Oct 2023 09:31:13 +0700 Subject: [PATCH] Tes fix no attribute all_perms Signed-off-by: Yasir Aris M --- misskaty/plugins/nightmodev2.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/misskaty/plugins/nightmodev2.py b/misskaty/plugins/nightmodev2.py index a347f00a..504d19a0 100644 --- a/misskaty/plugins/nightmodev2.py +++ b/misskaty/plugins/nightmodev2.py @@ -188,7 +188,7 @@ async def mute_chat(chat_id: int): @app.on_message(filters.command("nightmode", COMMAND_HANDLER) & filters.group) @require_admin(permissions=["can_change_info"]) @use_chat_lang() -async def nightmode_handler(_, msg, strings): +async def nightmode_handler(self, msg, strings): chat_id = msg.chat.id if "-d" in msg.text: @@ -220,8 +220,9 @@ async def nightmode_handler(_, msg, strings): if start_timestamp < now: start_timestamp = start_timestamp + timedelta(days=1) end_time_stamp = start_timestamp + timedelta(seconds=int(lock_dur)) - del msg.chat.permissions.can_send_messages, msg.chat.permissions.can_send_media_messages, msg.chat.permissions.all_perms + del msg.chat.permissions.can_send_messages, msg.chat.permissions.can_send_media_messages perm = msg.chat.permissions + self.log.info(perm) try: # schedule to enable nightmode scheduler.add_job(