This commit closes #30

This commit is contained in:
Profitroll 2023-02-20 15:04:24 +01:00
parent 64b7a6a4ba
commit 5b8951fe07

View File

@ -116,13 +116,16 @@ async def callback_query_reapply_new(app: Client, clb: CallbackQuery):
fullclb = clb.data.split("_")
if HoloUser(clb.from_user).sponsorship_state()[0] == "fill":
holo_user = HoloUser(clb.from_user)
if holo_user.sponsorship_state()[0] == "fill":
await clb.message.reply_text(locale("finish_sponsorship", "message"), quote=False)
return
await clb.answer(locale("reapply_stopped", "callback", locale=clb.from_user))
message = await app.get_messages(clb.from_user.id, int(fullclb[2]))
col_tmp.update_one({"user": clb.from_user.id}, {"$set": {"state": "fill", "completed": False, "stage": 1}})
col_tmp.update_one({"user": clb.from_user.id, "type": "application"}, {"$set": {"state": "fill", "completed": False, "stage": 1}})
holo_user.application_restart(reapply=True)
await welcome_pass(app, message, once_again=True)
logWrite(f"User {clb.from_user.id} restarted the application after leaving the chat earlier")
await clb.message.edit(clb.message.text, reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton(locale("done", "button", locale=clb.from_user), "nothing")]]))