From c56385a18120ad91d434e341ebe8d4818c45f652 Mon Sep 17 00:00:00 2001 From: Profitroll <47523801+profitrollgame@users.noreply.github.com> Date: Mon, 23 Jan 2023 18:25:03 +0100 Subject: [PATCH] Fixed spoiler flow --- modules/commands/spoiler.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/commands/spoiler.py b/modules/commands/spoiler.py index e674aa7..8b0f150 100644 --- a/modules/commands/spoiler.py +++ b/modules/commands/spoiler.py @@ -6,7 +6,7 @@ from classes.errors.holo_user import UserNotFoundError, UserInvalidError from classes.holo_user import HoloUser from modules.logging import logWrite from modules.utils import locale -from modules.database import col_spoilers +from modules.database import col_spoilers, col_applications from modules import custom_filters # Spoiler command ============================================================================================================== @@ -18,18 +18,18 @@ async def cmd_spoiler(app: Client, msg: Message): except (UserInvalidError, UserNotFoundError): return - if holo_user.application_state()[0] != "approved": + if col_applications.find_one( {"user": holo_user.id} ) is None: await msg.reply_text(locale("not_member", "message", locale=msg.from_user)) return if holo_user.application_state()[0] != "fill" and holo_user.sponsorship_state()[0] != "fill": - if col_spoilers.find_one( {"user": msg.from_user.id, "completed": False} ) is None: + if col_spoilers.find_one( {"user": holo_user.id, "completed": False} ) is None: col_spoilers.insert_one( { - "user": msg.from_user.id, + "user": holo_user.id, "completed": False, "category": None, "description": None,