From 6aa8128fc6dbd5edea4284c2a99f921edc9c03b4 Mon Sep 17 00:00:00 2001 From: profitroll Date: Tue, 3 Jan 2023 13:04:38 +0100 Subject: [PATCH] Using application_restart() now --- modules/handlers/welcome.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/handlers/welcome.py b/modules/handlers/welcome.py index bcd516a..e902617 100644 --- a/modules/handlers/welcome.py +++ b/modules/handlers/welcome.py @@ -2,6 +2,7 @@ from app import app from pyrogram import filters from pyrogram.types import ForceReply, ReplyKeyboardMarkup, Message from pyrogram.client import Client +from classes.holo_user import HoloUser from modules.utils import all_locales, locale, logWrite # Welcome check ================================================================================================================ @@ -11,7 +12,7 @@ for pattern in all_locales("welcome", "keyboard"): for pattern in all_locales("return", "keyboard"): welcome_1.append(pattern[0][0]) @app.on_message(~ filters.scheduled & filters.private & filters.command(welcome_1, prefixes=[""])) -async def welcome_pass(app, msg, once_again: bool = True) -> None: +async def welcome_pass(app: Client, msg: Message, once_again: bool = True) -> None: """Set user's stage to 1 and start a fresh application ### Args: @@ -22,6 +23,10 @@ async def welcome_pass(app, msg, once_again: bool = True) -> None: if not once_again: await msg.reply_text(locale("privacy_notice", "message")) + + holo_user = HoloUser(msg.from_user) + + holo_user.application_restart() logWrite(f"User {msg.from_user.id} confirmed starting the application") await msg.reply_text(locale("question1", "message", locale=msg.from_user), reply_markup=ForceReply(placeholder=locale("question1", "force_reply", locale=msg.from_user)))