Forma to'ldirish bot

Daraja: 🟡 O'rta Vaqt: 25 daqiqa

Natija

Foydalanuvchidan ketma-ket ma'lumot yig'uvchi bot (ro'yxatdan o'tish).

2 usul

1-usul: Form node

Tayyor Form node ishlatish — tez va oson.

2-usul: State + Trigger

Qo'lda qurish — moslashuvchan.


1-usul: Form node

Qadam 1: /register

Command Trigger:

  • Command: register

  • Global: ✅

Qadam 2: Form node

Form node'ini ulang:

Maydonlar:

  1. name

    • Label: "Ismingizni kiriting:"

    • Type: text

    • Required: ✅

  2. phone

    • Label: "Telefon raqamingiz:"

    • Type: phone

    • Required: ✅

  3. email

    • Label: "Email (ixtiyoriy):"

    • Type: email

    • Required: ❌

Qadam 3: Natija xabari

Form'dan keyin Text Message:


2-usul: State + Trigger

Qadam 1: /register

Command TriggerText Message:

State: waiting_name

Qadam 2: Ism olish

Message Trigger:

  • Type: text

  • Filter: any

  • Global: ❌ (faqat waiting_name state'da)

Variable: name = {{message.text}}

Text Message:

State: waiting_phone

Qadam 3: Telefon olish

Message Trigger:

  • Type: text

  • Filter: regex

  • Regex: ^\+?[0-9]{10,15}$

Variable: phone = {{message.text}}

Text Message:

State: waiting_email

Qadam 4: Noto'g'ri telefon

Message Trigger (Else handle):

Text Message:

(State o'zgarmaydi — qayta so'raladi)

Qadam 5: Email olish

Message Trigger:

  • Type: text

  • Filter: regex

  • Regex: ^[\w.-]+@[\w.-]+\.\w+$

Variable: email = {{message.text}}

→ Natija xabari (6-qadam)

Qadam 6: /skip

Command Trigger:

  • Command: skip

  • Global: ❌ (faqat waiting_email)

Variable: email = ""

→ Natija xabari

Qadam 7: Natija

Text Message:

State: main


Oqim sxemasi (2-usul)

Ma'lumotni saqlash

Kolleksiyaga

Adminga yuborish

Keyingi

Kanal obuna tekshirishchevron-right

Last updated

Was this helpful?