From 0404330c3a7a4de7a3aba9fc559e77ce8eba58fe Mon Sep 17 00:00:00 2001 From: mrmissx Date: Sun, 14 Apr 2024 18:06:46 +0700 Subject: [PATCH] fix(lockings): lower listener priority --- anjani/plugins/lockings.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/anjani/plugins/lockings.py b/anjani/plugins/lockings.py index e4591ea28..e5a397d85 100644 --- a/anjani/plugins/lockings.py +++ b/anjani/plugins/lockings.py @@ -46,7 +46,7 @@ ) from pyrogram.types import Chat, ChatPermissions, Message -from anjani import command, filters, plugin, util +from anjani import command, filters, listener, plugin, util async def anon(_: Client, message: Message) -> bool: @@ -133,6 +133,7 @@ async def on_plugin_backup(self, chat_id: int) -> MutableMapping[str, Any]: async def on_plugin_restore(self, chat_id: int, data: MutableMapping[str, Any]) -> None: await self.db.update_one({"chat_id": chat_id}, {"$set": data[self.name]}, upsert=True) + @listener.priority(95) async def on_message(self, message: Message) -> None: if message.outgoing: return @@ -163,9 +164,9 @@ async def on_message(self, message: Message) -> None: locked = await self.get_chat_restrictions(chat.id) for lock_type in locked: try: - func: Union[str, Callable[[Client, Message], Coroutine[Any, Any, bool]]] = ( - LOCK_TYPES[lock_type] - ) + func: Union[ + str, Callable[[Client, Message], Coroutine[Any, Any, bool]] + ] = LOCK_TYPES[lock_type] if not callable(func): continue