Application and sponsorship crosscheck
This commit is contained in:
@@ -2,7 +2,7 @@ from app import app
|
||||
from pyrogram import filters
|
||||
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
|
||||
from classes.holo_user import HoloUser
|
||||
from modules.utils import configGet, locale
|
||||
from modules.utils import configGet, locale, should_quote
|
||||
from modules.handlers.welcome import welcome_pass
|
||||
from modules.database import col_tmp
|
||||
|
||||
@@ -19,6 +19,9 @@ async def cmd_reapply(app, msg):
|
||||
if member.user.id == msg.from_user.id:
|
||||
left_chat = False
|
||||
if not left_chat:
|
||||
if holo_user.sponsorship_state()[0] == "fill":
|
||||
await msg.reply_text(locale("finish_sponsorship", "message"), quote=should_quote(msg))
|
||||
return
|
||||
holo_user.application_restart(reapply=True)
|
||||
await welcome_pass(app, msg, once_again=True)
|
||||
else:
|
||||
|
@@ -1,6 +1,7 @@
|
||||
from app import app, isAnAdmin
|
||||
from pyrogram import filters
|
||||
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
|
||||
from classes.holo_user import HoloUser
|
||||
from modules.utils import locale, should_quote
|
||||
from modules.database import col_applications
|
||||
|
||||
@@ -8,6 +9,9 @@ from modules.database import col_applications
|
||||
@app.on_message(~ filters.scheduled & filters.command(["sponsorship"], prefixes=["/"]))
|
||||
async def cmd_sponsorship(app, msg):
|
||||
if (await isAnAdmin(msg) is True) or (col_applications.find_one({"user": msg.from_user.id}) is not None):
|
||||
if HoloUser(msg.from_user).application_state()[0] == "fill":
|
||||
await msg.reply_text(locale("finish_application", "message"), quote=should_quote(msg))
|
||||
return
|
||||
await msg.reply_text(locale("sponsorship_apply", "message"), reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton(text=str(locale("sponsor_apply", "button")), callback_data=f"sponsor_apply_{msg.from_user.id}")]]), quote=should_quote(msg))
|
||||
else:
|
||||
await msg.reply_text(locale("sponsorship_application_empty", "message"))
|
||||
|
Reference in New Issue
Block a user