asking range
This commit is contained in:
		
							
								
								
									
										13
									
								
								src/index.js
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								src/index.js
									
									
									
									
									
								
							@@ -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;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user