# About Viber Start Message

Viber has a feature in working with the first message from the bot: after the first message, the system waits for user response before sending the next message. This affects scenario structure for Viber and requires a special approach to the first block.

---

## Context and Problem

In many scenarios, you need to send multiple messages in a row or show information without waiting for user response. However, in Viber after the first message, the system automatically waits for user response, which can break scenario logic.

**Problem:**
- If the first block is "Message to User", the next message will not be sent until the user responds
- This can break scenario logic where you need to show multiple messages in a row

---

## Key Concepts

### Response Wait Mechanism

Viber automatically sets response wait mode after the first message from the bot. This means:
- System waits for user input
- Next messages are not sent until response is received
- Response wait timeout depends on bot settings

### Correct Structure for Viber

To ensure correct scenario operation in Viber, the first block should be interactive:
- **"Wait for User Response"** — bot waits for text input
- **"Message with Keyboard"** — bot shows buttons for selection

This ensures user interaction with the bot from the start and allows the system to continue scenario execution.

---

## Approach Options

### Interactive First Block vs Passive Message

**Interactive first block (recommended):**
- ✅ Pros: Ensures correct scenario operation, allows user to immediately interact with bot
- ❌ Cons: Need to add interactive element (keyboard or input wait)

**Passive message:**
- ✅ Pros: Simple structure
- ❌ Cons: Can break scenario logic, next messages are not sent

**Why we use interactive first block:**
This ensures correct scenario operation and allows user to immediately interact with the bot, which improves user experience.

### Alternative Solutions

If you need to send multiple messages in a row without waiting for response:
1. Use action blocks to send messages
2. Combine multiple messages into one
3. Use welcome message (if supported)

---

## Adopted Solutions

### Required Interactivity of First Block

For Viber, the first scenario block must be interactive (keyboard or input wait). This ensures correct system operation and allows user to immediately interact with the bot.

### Response Wait Timeout

Response wait timeout depends on bot settings. If the user does not respond within timeout, the system may proceed to the next step or complete the dialog.

---

## Implications for Users and Implementation

### For Integrators

When creating scenarios for Viber, it's important to:

1. **Check first block** — it must be interactive
2. **Add keyboard or input wait** — to ensure correct operation
3. **Combine messages** — if you need to show multiple messages in a row
4. **Use action blocks** — to send messages without waiting for response

### Common Errors

**Error:** Next messages are not sent after the first  
**Problem:** First block is a passive message without interactivity  
**Solution:** Add keyboard or input wait to the first block

**Error:** Scenario "hangs" after first message  
**Problem:** System waits for response, but user does not know what to do  
**Solution:** Add instructions or buttons for navigation

### Limitations

- Viber requires user interaction after the first message
- Response wait timeout depends on bot settings
- Some message types may not be supported

---

## Related Documents

- **Reference:** [Viber Bot API Documentation](https://developers.viber.com/docs/api/rest-bot-api/) — official Viber documentation
- **Explanation:** [Viber Keyboard Styling](/en/scenariodialog/explanation/viber-keyboard-styling.md) — keyboard configuration for Viber

