asking range

This commit is contained in:
leca 2024-08-09 02:08:46 +03:00
parent 2b33fec932
commit 7220c6d2c2
4 changed files with 17 additions and 46 deletions

View File

@ -1,40 +0,0 @@
{
"general": {
"welcome": "Hello! I am a bot for new meetings in Matrix!\nTo start, please, type \"!start\"\nI'll ask some questions to fill your profile. You can change that info later, if you will.\nThen, I'll start showing you another people's profiles.\nYou can like other profile, skip or send a message to the person.\nIf you mutually liked each other, you'll be given each other's MXID to start a DM.\nMy source code can be found on gitea: https://git.foxarmy.org/leca/heart2heart.\n\nGood luck!",
"rate": "Decide wether you like (👍️, ❤️ or 1), dislike (👎️, 💔 or 2) or wanna send a messsage (💌 or 3). Write '🏠️' or 4 to quit to menu. Any other response counts as dislike.",
"menu": "Pick an action:\n1) Start watching profiles\n2) Check for mutual likes\n3) Check for messages",
"newlikes": "You have new mutual like(s)! Go into menu (🏠️) to see!",
"showalike": "This person and you mutually liked each other!",
"mxid": "Go drop them a line! Their MXID is: ",
"message": "Write one message to this person or upload one picture/video to send them!",
"newmessage": "You've got new message(s)! Go to a menu (🏠️) to see!",
"showmessage": " sent you this: ",
"nonewmessages": "You have no new messages!",
"messagesent": "You message was sent!"
},
"setup": {
"country": "Write a name of country you are living in. Prefer local language. For example, 'Россия', 'United States' or 'Україна'.",
"city": "Write a name of city you are living in. Prefer local language. For example, 'Москва', 'Washington, D.C.', or 'Київ'.",
"name": "Write a name of your profile. Not longer than 32 symbols",
"description": "Write a description of your profile. Not longer than 512 symbols.",
"age": "Write your age. People yonger than 14 are disallowed to use the service.",
"sex": "Write your sex: Male or female.",
"interest": "Write who you are interested to talk to? Write 'both', 'male', or 'female'.",
"pictures": "Send up to five pictures that will be shown in your profile. Write any text message when you are done.",
"done": "Phew! You are done filling your profile! Now I'll start showing you others profiles!",
"more": "Got that cool picture! You still can upload up to this amount of pictures: ",
"enough": "That's enough of pictures! Let's go further!"
},
"errors": {
"notadm": "This room is not a DM (direct or private messages). You should invite me in a DM! By the way, I support encrypted rooms! Bye and see you in DM!",
"toobig": "Sorry! The length of what you have written here is bigger than I expected! If you beleive that it is an error, please, file an issue on my git: https://git.foxarmy.org/leca/heart2heart. Otherwise, write something a little bit smaller! Thank you!",
"tooyoung": "Sorry! You are too young for this! Please, come back when you'll turn at least 14! Thank you and good bye!",
"toomuch": "You have loaded more that 5 pictures. I'll not upload that. Going to the next step...",
"twosexes": "There are only two sexes! Please, choose your biological one.",
"didntunderstand": "I cannot understand your answer. Please, read my question again and answer!",
"notimplemented": "This feature is not yet implemented! Please, keep track of my updates at https://git.foxarmy.org/leca/heart2heart. Bother your admins to update, if released! ;)",
"noprofiles": "There are no profiles left for you! I'm sorry. Please, come back later!",
"alreadymessaged": "You have already messaged that person. Your message was not sent!"
}
}

View File

@ -81,12 +81,21 @@ client.on("room.message", async (roomId, event) => {
i18n.locale = a[1]
await setUserState(roomId, "country");
await client.sendText(roomId, i18n.t(["setup", "country"]));
break;
case "country":
await processRequest(client, roomId, current_action, answer, 'city');
break;
case "city":
await processRequest(client, roomId, current_action, answer, 'range');
break;
case "range":
answer = parseInt(answer.split(" ")[0]);
console.log(answer)
if (!answer) {
await client.sendText(roomId, i18n.t(["setup", "range"]));
return;
}
await processRequest(client, roomId, current_action, answer, 'name');
break;
case "name":
@ -95,7 +104,7 @@ client.on("room.message", async (roomId, event) => {
case "age":
answer = parseInt(answer)
if (!answer) {
await client.sendText(roomId, i18n.t(["general", "age"]));
await client.sendText(roomId, i18n.t(["setup", "age"]));
return;
}

View File

@ -15,8 +15,9 @@
"setopt": "Got \"%{opt}\""
},
"setup": {
"country": "Write a name of country you are living in. Prefer local language. For example, 'Россия', 'United States' or 'Україна'.",
"city": "Write a name of city you are living in. Prefer local language. For example, 'Москва', 'Washington, D.C.', or 'Київ'.",
"country": "Write a name of country you are living in. Write them in English. For example, 'Russia', 'United States' or 'Ukraine'.",
"city": "Write a name of city you are living in. Write them in English. For example, 'Moscow', 'Washington', or 'Kyiv'.",
"range": "Write a radius (in kilometers) of a circle you'd like to find people in (Write 0 if you don't care or small values to find people in your city only)",
"name": "Write a name of your profile. Not longer than 32 symbols",
"description": "Write a description of your profile. Not longer than 512 symbols.",
"age": "Write your age. People yonger than 14 are disallowed to use the service.",

View File

@ -15,8 +15,9 @@
"setopt": "Записал \"%{opt}\""
},
"setup": {
"country": "Напишите имя страны, в которой вы находитесь. Предпочтительно на местном языке. Например, 'Россия', 'United States' или 'Україна'.",
"city": "Напишите имя города, в котором вы находитесь. Предпочтительно на местном языке. Например, 'Москва', 'Washington, D.C.', или 'Київ'.",
"country": "Напишите имя страны, в которой вы находитесь. Писать на английском языке. Например, 'Russia', 'United States' or 'Ukraine'.",
"city": "Напишите имя города, в котором вы находитесь. Писать на английском языке. Например, 'Moscow', 'Washington', or 'Kyiv'.",
"range": "Напишите радиус (в километрвх), в котором вы хотели бы найти людей (Напишите 0, если вам не важен радиус или маленькие значения, если хотите найти людей только в своём городе)",
"name": "Напишите имя вашего профиля. Не больше 32 символов",
"description": "Напишите описание вашего профиля. Не больше 512 символов.",
"age": "Напишите ваш возраст. Людям, младше 14 не разрешено использовать этот сервис.",