Naming Conventions
Consistent naming makes your bot easier to understand and maintain.
Variable Names
Format
Use snake_case (lowercase with underscores):
✅ var.user_email
✅ var.is_registered
✅ var.total_purchases
❌ var.UserEmail
❌ var.isRegistered
❌ var.totalpurchases
Be Descriptive
Names should explain what the variable holds:
| ✅ Good | ❌ Bad |
|---|---|
var.referral_count | var.x |
var.subscription_tier | var.sub |
var.last_login_date | var.date |
Boolean Naming
For true/false values, use is_, has_, or can_:
var.is_verified
var.has_premium
var.can_access_admin
Node Names
Format
Use Title Case for node names:
✅ "Ask For Email"
✅ "Check User Status"
✅ "Send Welcome Message"
❌ "ask for email"
❌ "CHECK_USER_STATUS"
Include the Action
Start with a verb describing what happens:
- Ask For Name
- Check If Admin
- Send Confirmation
- Save User Data
- Calculate Total
Subflow Names
Format
Use snake_case for subflow IDs:
validate_email
calculate_discount
send_notification
Be Specific
Name should describe the one thing it does:
| ✅ Good | ❌ Bad |
|---|---|
validate_phone_number | check |
calculate_order_total | process |
format_currency | helper |
Flow Names
Group related flows with prefixes:
auth_login
auth_register
auth_forgot_password
settings_profile
settings_notifications
settings_privacy
support_faq
support_contact
support_ticket
Callback Data
For inline button callbacks, use structured naming:
Format
action_subject_detail
Examples
menu_main
menu_settings
menu_help
order_view_123
order_cancel_123
order_confirm_123
quiz_answer_q1_correct
quiz_answer_q1_wrong
This makes routing easier:
menu_*→ Handle menu selectionsorder_*→ Handle order actionsquiz_answer_*→ Handle quiz answers
Commands
Keep Them Short
/start
/help
/menu
/settings
Use Descriptive Names
/profile — View your profile
/balance — Check your balance
/referral — Get your invite link
Group Related Commands
/order — New order
/order_status — Check order status
/order_history — Past orders
Quick Reference
| Item | Format | Example |
|---|---|---|
| Variables | snake_case | var.user_email |
| Node names | Title Case | "Check If Admin" |
| Subflows | snake_case | validate_email |
| Callbacks | action_subject | menu_settings |
| Commands | lowercase | /settings |
Next Steps
- Common Patterns → — Reusable solutions
- FAQ → — Common questions