Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversations. switching between questions. & input validation #28

Open
mrnuser opened this issue Jul 24, 2023 · 5 comments
Open

Conversations. switching between questions. & input validation #28

mrnuser opened this issue Jul 24, 2023 · 5 comments

Comments

@mrnuser
Copy link

mrnuser commented Jul 24, 2023

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).

@LWJerri
Copy link

LWJerri commented Jul 25, 2023

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

@mrnuser
Copy link
Author

mrnuser commented Jul 25, 2023

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

@LWJerri
Copy link

LWJerri commented Sep 25, 2023

@KnorpelSenf, can we close this issue?

@KnorpelSenf
Copy link
Member

No. We definitely need more examples with conversations. One of them should cover this issue. We can close it when we add the examples.

@KnorpelSenf
Copy link
Member

I am currently working on the second major version of the conversations plugin. We should wait with this issue until it is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants