diff --git a/src/db.js b/src/db.js index ba0180a..a442cf1 100644 --- a/src/db.js +++ b/src/db.js @@ -81,16 +81,6 @@ const selectProfilesForUser = async (roomId) => { ).rows[0]; const { lat, lng } = (await db.query("SELECT lat, lng FROM cities WHERE ID = $1", [mycity])).rows[0]; //Selecting profiles other than user's and fitting their needs - /* - 2 * ASIN(SQRT( - POWER(SIN( (deg2rad(lat - $6::double precision)) / 2 ), 2) - + COS(deg2rad(lat)) - * COS(deg2rad($6::double precision)) - * POWER(SIN(deg2rad(lng - $7::double precision)/2), 2) - )) - * 6371 <= $5::double precision - */ - // let user = (await db.query(`SELECT room_id, name, age, sex, description, location, range FROM users WHERE @@ -199,24 +189,6 @@ const getUserLanguage = async (roomId) => { return (await db.query("SELECT language FROM users WHERE room_id = $1", [roomId])).rows[0].language; } -// const checkCountry = async (name) => { -// let res = (await db.query(`SELECT country AS name, levenshtein(country, $1) AS similarity -// FROM cities -// ORDER BY similarity ASC -// LIMIT 3`, [name]) -// ).rows; - -// if (res[0].similarity == 0) { // 'similarity' is actually inversed. The less 'similarity', the more it similar. 0 means the same -// return { -// exists: true -// }; -// } -// return { -// exists: false, -// variants: res -// }; -// } - const findCity = async (name) => { return (await db.query(`SELECT ID, name, lat, lng, country, levenshtein(name, $1) AS similarity FROM cities diff --git a/src/index.js b/src/index.js index 4cc7d2b..4383efd 100644 --- a/src/index.js +++ b/src/index.js @@ -31,9 +31,7 @@ import { uploadMediaAsMessage, setUserLanguage, getUserLanguage, - findCity, - getCityNameByID, - getCountryNameByID + findCity } from './db.js'; import { processRequest, showRandomProfileToUser, showNewLikes } from "./interactions.js"; @@ -120,26 +118,8 @@ client.on("room.message", async (roomId, event) => { lng5: cities[4].lng, })) } else { - // let cityName = await getCityNameByID(number); - // let countryName = await getCountryNameByID(number); - await processRequest(client, roomId, current_action, number, 'range'); } - // let checkResultCity = await checkCity(answer); - // if (!checkResultCity.exists) { - // await client.sendText(roomId, i18n.t( - // ["errors", "wrongcity"], - // { - // first: checkResultCity.variants[0].name, - // second: checkResultCity.variants[1].name, - // third: checkResultCity.variants[2].name, - // fourth: checkResultCity.variants[3].name, - // fifth: checkResultCity.variants[4].name, - // } - // )); - // return; - // } - // await processRequest(client, roomId, current_action, answer, 'range'); break; case "range": answer = parseInt(answer.split(" ")[0]); diff --git a/translations/ru.json b/translations/ru.json index 540ba1e..b51f441 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -1,7 +1,7 @@ { "general": { "welcome": "Привет! Я бот, который поможет вам найти новые знакомства в Матриксе!\nЧтобы начать, напишите \"!start <язык>\". Вместо <язык> вставьте ru или en.\nЯ спрошу несколько вопросов, чтобы заполнить ваш профиль. Вы сможете изменить информацию позже.\nПосле этого, я начну показывать вам профили других пользователей..\nВы можете лайкать, скипать чужие профили или отправлять им сообщения.\nЕсли вы взаимно лайкнули друг друг, вам будут показаны ваши MXID.\nМой исходный код можно найти на gitea: https://git.foxarmy.org/leca/heart2heart.\n\nУдачи!", - "rate": "Решите, нравится лм (👍️, ❤️ or 1), не нравится (👎️, 💔 or 2) или вы хотите отправить сообщение (💌 or 3). Напишите '🏠️' или 4 чтобы выйти в меню. Любой другой ответ считается как \"не нравится\".", + "rate": "Решите, нравится ли (👍️, ❤️ or 1), не нравится (👎️, 💔 or 2) или вы хотите отправить сообщение (💌 or 3). Напишите '🏠️' или 4 чтобы выйти в меню. Любой другой ответ считается как \"не нравится\".", "menu": "Выберете действие:\n1) Начать просмотр профилей\n2) Проверить взаимные лайки\n3) Проверить сообщения", "newlikes": "У вас новый(-ие) взаимные лайк(и)! Выйдите в меню (🏠️) чтобы посмотреть!", "showalike": "Этот человек и вы друг друга взаимно лайкнули!",