Questions improved

This commit is contained in:
Profitroll 2022-10-20 15:24:31 +02:00
parent 50b3627237
commit 7d0c05bf40
2 changed files with 19 additions and 3 deletions

View File

@ -46,7 +46,16 @@
] ]
}, },
"force_reply": { "force_reply": {
"question1": "Ім'я або звертання" "question1": "Ім'я або звертання",
"question2": "Твій вік",
"question3": "Місто або область",
"question4": "Орієнтовний час",
"question5": "Риси, особливості",
"question6": "Ім'я дівчини",
"question7": "П'ять японських холодівчат",
"question8": "Так або ні",
"question9": "Ім'я дівчини або дівчин",
"question10": "Трошки про себе"
}, },
"button": { "button": {
"sub_yes": "✅ Прийняти", "sub_yes": "✅ Прийняти",

11
main.py
View File

@ -57,12 +57,19 @@ async def any_stage(app, msg):
user_stage = configGet("stage", file=str(msg.from_user.id)) user_stage = configGet("stage", file=str(msg.from_user.id))
if user_stage == 1: if user_stage == 1:
await msg.reply_text(locale(f"question{user_stage+1}", "message"), reply_markup=ForceReply(placeholder="Enter shit")) await msg.reply_text(locale(f"question{user_stage+1}", "message"), reply_markup=ForceReply(placeholder=locale(f"question{user_stage+1}", "force_reply")))
configSet(str(user_stage), str(msg.text), "application", file=str(msg.from_user.id)) configSet(str(user_stage), str(msg.text), "application", file=str(msg.from_user.id))
configSet("stage", user_stage+1, file=str(msg.from_user.id)) configSet("stage", user_stage+1, file=str(msg.from_user.id))
elif user_stage == 2:
try:
configSet(str(user_stage), int(msg.text), "application", file=str(msg.from_user.id))
await msg.reply_text(locale(f"question{user_stage+1}", "message"), reply_markup=ForceReply(placeholder=locale(f"question{user_stage+1}", "force_reply")))
configSet("stage", user_stage+1, file=str(msg.from_user.id))
except ValueError:
await msg.reply_text(locale(f"question2_invalid", "message"), reply_markup=ForceReply(placeholder=locale(f"question{user_stage}", "force_reply")))
else: else:
if user_stage <= 9: if user_stage <= 9:
await msg.reply_text(locale(f"question{user_stage+1}", "message"), reply_markup=ForceReply(placeholder="Enter shit")) await msg.reply_text(locale(f"question{user_stage+1}", "message"), reply_markup=ForceReply(placeholder=locale(f"question{user_stage+1}", "force_reply")))
configSet(str(user_stage), str(msg.text), "application", file=str(msg.from_user.id)) configSet(str(user_stage), str(msg.text), "application", file=str(msg.from_user.id))
configSet("stage", user_stage+1, file=str(msg.from_user.id)) configSet("stage", user_stage+1, file=str(msg.from_user.id))
else: else: