user3449979
user3449979

Reputation: 509

How create forms in Telegram bots

For example authorization form has login and password, I want create equivalent form in Telegram.

Q: /signin

A: Enter your login

Q: Somelogin

A: Enter you password

Q: Somepassword

A: Authorization success!

But how I can save incoming data from user? Is any API for it or maybe I must save input data in temporarily database field? (as chat_id, command, session_expire, command_state, command_tmp_data)

Upvotes: 3

Views: 10244

Answers (2)

Rogério Munhoz
Rogério Munhoz

Reputation: 68

Answering your question: You have to save the session (conversation) state like you proposed; the API doesn't provide you with means to "ask" a user a question.

BUT user3449979 is right, and you shouldn't ask for user auth data using plain text; you should use deep linkin together with OAuth or another server-side based authentication method

Upvotes: 0

anatol
anatol

Reputation: 1762

You should use OAuth or redirect users to auth form on your website (and redirect them back after authorization). Send user's auth data in text messages and ask them for it is big evil.

Upvotes: 2

Related Questions