asking range

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

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;
}