Skip to main content

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_countvar.x
var.subscription_tiervar.sub
var.last_login_datevar.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_numbercheck
calculate_order_totalprocess
format_currencyhelper

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 selections
  • order_* → Handle order actions
  • quiz_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
/order        — New order
/order_status — Check order status
/order_history — Past orders

Quick Reference

ItemFormatExample
Variablessnake_casevar.user_email
Node namesTitle Case"Check If Admin"
Subflowssnake_casevalidate_email
Callbacksaction_subjectmenu_settings
Commandslowercase/settings

Next Steps