Conversations. switching between questions. & input validation
Hi. I have a quite popular task for which I haven't found any examples.
1. You need to switch between questions.
System:
question 1: How much?
user: 100
question 2: ure good?
user: Yes.
question 3: Want some apples?
user: back
question 2: ure good?
user: back
question 1: How much?
as you can see - the user switched back 2 questions and the bot asked them again. Of course, after the user answers, the bot will move on in the script and the user can also go back.
2. Input validation.
Criterion for user's answer to question 1: parseInt(ctx.message.text). System:
question 1: How much?
user: asdjajsdja
question 1: How much?
user: asaasd
question 1: How much?
user: 100
question 2: ure good?
the bot did not accept the answer until it met the criterion. Of course, this should work in conjunction with point 1 (switching between questions).
Hello! As I wrote to you in chat, you should get a basic understanding of writing code, we told you all morning yesterday how to do everything, but instead you spent the whole day trying to make a loop. What you described above is already in @grammyjs/conversations, like I told you above - learn basic programming and then come back to us =)
Ref: https://grammy.dev/plugins/conversations.html#functions-and-recursion
Hello! As I wrote to you in chat, you should get a basic understanding of writing code, we told you all morning yesterday how to do everything, but instead you spent the whole day trying to make a loop. What you described above is already in @grammyjs/conversations, like I told you above - learn basic programming and then come back to us =)
Ref: https://grammy.dev/plugins/conversations.html#functions-and-recursion
All I've heard from you is use loops. As vague as possible
@KnorpelSenf, can we close this issue?
No. We definitely need more examples with conversations. One of them should cover this issue. We can close it when we add the examples.
I am currently working on the second major version of the conversations plugin. We should wait with this issue until it is released.