Start Template ๐ก BETA
The start template is the simplest possible bot - a greeting flow that demonstrates the core interaction pattern of BASIC: greeting users and responding to their input.
Topic: Basic Greeting & Help Flow
This template is perfect for:
- Learning BASIC fundamentals
- Simple FAQ bots
- Quick demos
- Starting point for more complex bots
The Code
REM Basic greeting and help flow
SET user_name = "Guest"
TALK "Hello, " + user_name + "! How can I help you today?"
HEAR user_input
IF user_input = "help" THEN
TALK "Sure, I can assist with account info, orders, or support."
ELSE
TALK "Sorry, I didn't understand. Type 'help' for options."
END IF
Sample Dialogs
These conversations show how the start template works in real-world scenarios.
Dialog 1: User Asks for Help
๐ค
Helper Bot
online
Today
Dialog 2: Unknown Input
๐ค
Helper Bot
online
Dialog 3: Personalized Greeting (Enhanced Version)
When you add user detection, the experience improves:
๐ค
Smart Helper
online
Keywords Used
| Keyword | Purpose |
|---|---|
SET | Assign a value to a variable |
TALK | Send a message to the user |
HEAR | Wait for and capture user input |
IF/ELSE | Conditional branching based on input |
How It Works
- Variable Setup:
SETcreates a variable to hold the userโs name - Greeting:
TALKsends the welcome message - Input Capture:
HEARwaits for user response - Response Logic:
IF/ELSEdetermines what to say back
Enhanced Version
Hereโs the same template enhanced with LLM for natural understanding:
REM Smart greeting flow with LLM
SET user_name = "Guest"
TALK "Hello, " + user_name + "! How can I help you today?"
HEAR user_input
' Let LLM understand intent
intent = LLM "Classify this user message into one category: help, account, orders, support, other. Message: " + user_input
SWITCH intent
CASE "help"
TALK "I can assist with account info, orders, or support."
CASE "account"
TALK "Let me pull up your account information..."
CASE "orders"
TALK "I'll check on your recent orders..."
CASE "support"
TALK "Connecting you with our support team..."
DEFAULT
response = LLM "Respond helpfully to: " + user_input
TALK response
END SWITCH
Customization Ideas
Channel-Aware start.bas (WhatsApp vs Web)
The CHANNEL variable is automatically available in all BASIC scripts. It contains the current conversation channel ("web", "whatsapp", "telegram", "teams", etc.). Use it to adapt your botโs behavior per channel:
' start.bas with channel-aware greeting
USE TOOL "01-batizado"
USE TOOL "02-casamento"
IF CHANNEL = "whatsapp" THEN
' WhatsApp: plain text menu (no buttons)
TALK "Ola! Digite o numero: 1. Batizado, 2. Casamento"
ELSE
' Web/suite: interactive buttons
ADD SUGGESTION "Quero agendar um batizado"
ADD SUGGESTION "Quero agendar um casamento"
TALK "Como posso ajuda-lo?"
END IF
This pattern is useful for:
- WhatsApp: Plain text menus (no button support in 24h session window)
- Telegram/Teams: Platform-specific reply markup
- Web: Rich suggestion buttons, HTMX fragments, full UI
- Voice: Shorter messages, no visual elements
Add User Detection
' Get user info if available
user_name = GET BOT MEMORY "user_" + user_id + "_name"
IF user_name = "" THEN
TALK "Hi there! What's your name?"
HEAR user_name
SET BOT MEMORY "user_" + user_id + "_name", user_name
END IF
TALK "Welcome back, " + user_name + "!"
Add Quick Reply Buttons
ADD SUGGESTION "Account Info"
ADD SUGGESTION "My Orders"
ADD SUGGESTION "Get Support"
TALK "What would you like help with?"
HEAR choice
Add Time-Based Greeting
hour = HOUR(NOW())
IF hour < 12 THEN
greeting = "Good morning"
ELSE IF hour < 18 THEN
greeting = "Good afternoon"
ELSE
greeting = "Good evening"
END IF
TALK greeting + ", " + user_name + "!"
Related Templates
- enrollment.bas - Multi-step data collection
- auth.bas - User authentication patterns