Removed legacy
This commit is contained in:
@@ -93,9 +93,6 @@ async def confirm_yes(app: Client, msg: Message, kind: Literal["application", "s
|
||||
|
||||
return
|
||||
|
||||
# configSet(["sent"], True, file=str(holo_user.id))
|
||||
# configSet(["confirmed"], True, file=str(holo_user.id))
|
||||
|
||||
if configGet("enabled", "features", "sponsorships") is True:
|
||||
|
||||
if (kind == "sponsorship") or ((holo_user.sponsorship_state()[0] == "fill") and (holo_user.sponsorship_state()[1] is True)):
|
||||
|
@@ -6,7 +6,6 @@ from pyrogram.client import Client
|
||||
from classes.holo_user import HoloUser
|
||||
from modules.utils import configGet, logWrite, locale, all_locales
|
||||
from modules.database import col_messages, col_spoilers
|
||||
from bson import ObjectId
|
||||
|
||||
async def message_involved(msg: Message) -> bool:
|
||||
message = col_messages.find_one({"destination.id": msg.reply_to_message.id, "destination.chat": msg.reply_to_message.chat.id})
|
||||
@@ -47,9 +46,6 @@ async def any_stage(app: Client, msg: Message):
|
||||
adm_context=await isAnAdmin(msg.from_user.id)
|
||||
)
|
||||
|
||||
# await msg.reply_text(locale("message_sent", "message"), quote=should_quote(msg))
|
||||
# col_messages.insert_one({"origin": {"chat": msg.chat.id, "id": msg.id}, "destination": {"chat": new_message.chat.id, "id": new_message.id}})
|
||||
|
||||
return
|
||||
|
||||
if msg.text is not None:
|
||||
@@ -102,63 +98,6 @@ async def any_stage(app: Client, msg: Message):
|
||||
await msg.reply_text(locale("spoiler_using_description", "message", locale=msg.from_user).format(msg.text), reply_markup=ReplyKeyboardRemove())
|
||||
await msg.reply_text(locale("spoiler_ready", "message", locale=msg.from_user), quote=False, reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton(locale("spoiler_send", "button", locale=msg.from_user), switch_inline_query=f"spoiler:{spoiler['_id'].__str__()}")]]))
|
||||
|
||||
# user_stage = configGet("stage", file=str(msg.from_user.id))
|
||||
|
||||
# if user_stage == 1:
|
||||
# await msg.reply_text(locale(f"question{user_stage+1}", "message"), reply_markup=ForceReply(placeholder=str(locale(f"question{user_stage+1}", "force_reply"))))
|
||||
# logWrite(f"User {msg.from_user.id} completed stage {user_stage} of application")
|
||||
# configSet(["application", str(user_stage)], str(msg.text), file=str(msg.from_user.id))
|
||||
# configSet(["stage"], user_stage+1, file=str(msg.from_user.id))
|
||||
|
||||
# elif user_stage == 2:
|
||||
|
||||
# try:
|
||||
|
||||
# configSet(["application", str(user_stage)], str(msg.text), file=str(msg.from_user.id))
|
||||
|
||||
# input_dt = datetime.strptime(msg.text, "%d.%m.%Y")
|
||||
|
||||
# if datetime.now() <= input_dt:
|
||||
# logWrite(f"User {msg.from_user.id} failed stage {user_stage} due to joking")
|
||||
# await msg.reply_text(locale("question2_joke", "message"), reply_markup=ForceReply(placeholder=str(locale("question2", "force_reply"))))
|
||||
|
||||
# elif ((datetime.now() - input_dt).days) < ((datetime.now() - datetime.now().replace(year=datetime.now().year - configGet("age_allowed"))).days):
|
||||
# logWrite(f"User {msg.from_user.id} failed stage {user_stage} due to being underage")
|
||||
# await msg.reply_text(locale("question2_underage", "message").format(str(configGet("age_allowed"))), reply_markup=ForceReply(placeholder=str(locale("question2", "force_reply"))))
|
||||
|
||||
# else:
|
||||
# logWrite(f"User {msg.from_user.id} completed stage {user_stage} of application")
|
||||
# await msg.reply_text(locale(f"question{user_stage+1}", "message"), reply_markup=ForceReply(placeholder=str(locale(f"question{user_stage+1}", "force_reply"))))
|
||||
# configSet(["stage"], user_stage+1, file=str(msg.from_user.id))
|
||||
|
||||
# except ValueError:
|
||||
# logWrite(f"User {msg.from_user.id} failed stage {user_stage} due to sending invalid date format")
|
||||
# await msg.reply_text(locale(f"question2_invalid", "message"), reply_markup=ForceReply(placeholder=str(locale(f"question{user_stage}", "force_reply"))))
|
||||
|
||||
# else:
|
||||
# if user_stage <= 9:
|
||||
# logWrite(f"User {msg.from_user.id} completed stage {user_stage} of application")
|
||||
# await msg.reply_text(locale(f"question{user_stage+1}", "message"), reply_markup=ForceReply(placeholder=str(locale(f"question{user_stage+1}", "force_reply"))))
|
||||
# configSet(["application", str(user_stage)], str(msg.text), file=str(msg.from_user.id))
|
||||
# configSet(["stage"], user_stage+1, file=str(msg.from_user.id))
|
||||
# else:
|
||||
# if not configGet("sent", file=str(msg.from_user.id)):
|
||||
# if not configGet("confirmed", file=str(msg.from_user.id)):
|
||||
# configSet(["application", str(user_stage)], str(msg.text), file=str(msg.from_user.id))
|
||||
# application_content = []
|
||||
# i = 1
|
||||
# for question in configGet("application", file=str(msg.from_user.id)):
|
||||
# application_content.append(f"{locale('question'+str(i), 'message', 'question_titles')} {configGet('application', file=str(msg.from_user.id))[question]}")
|
||||
# i += 1
|
||||
# await msg.reply_text(locale("confirm", "message").format("\n".join(application_content)), reply_markup=ReplyKeyboardMarkup(locale("confirm", "keyboard"), resize_keyboard=True))
|
||||
# #configSet("sent", True, file=str(msg.from_user.id))
|
||||
# #configSet("application_date", int(time()), file=str(msg.from_user.id))
|
||||
# else:
|
||||
# if not configGet("approved", file=str(msg.from_user.id)) and not configGet("rejected", file=str(msg.from_user.id)):
|
||||
# await msg.reply_text(locale("already_sent", "message"))
|
||||
# else:
|
||||
# if not configGet("approved", file=str(msg.from_user.id)) and not configGet("rejected", file=str(msg.from_user.id)):
|
||||
# await msg.reply_text(locale("already_sent", "message"))
|
||||
|
||||
@app.on_message(~ filters.scheduled & filters.group)
|
||||
async def message_in_group(app: Client, msg: Message):
|
||||
|
@@ -31,8 +31,6 @@ async def welcome_pass(app: Client, msg: Message, once_again: bool = True) -> No
|
||||
|
||||
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)))
|
||||
# configSet(["stage"], 1, file=str(msg.from_user.id))
|
||||
# configSet(["sent"], False, file=str(msg.from_user.id))
|
||||
|
||||
welcome_2 = []
|
||||
for pattern in all_locales("welcome", "keyboard"):
|
||||
|
Reference in New Issue
Block a user