# Complete Bot Examples: Helpers and Plain PHP

> Two equivalent text-and-button bots with explicit runtime requirements.

**Category:** Bot Development  
**URL:** https://docs.botlify.cloud/bot-starter-examples  
**Platform:** Botlify Cloud (https://botlify.cloud)  

---

## Before copying

Use one example as the test bot’s index.php, not both in the same file. Configure the bot token and administrator through the platform. The examples respond to /start, /help, ordinary text and callback buttons. They deliberately use plain message text for user input. They are starting points, not a complete production queue, deduplication or payment system.

## Example A: Botlify helpers

Requires the deployed opt-in Botlify runtime. The exact loader spelling is `tg_all_fun();`, with both underscores. It comes after strict_types and before helper calls.

```php

```

## Example B: plain PHP/cURL

This example never calls tg_all_fun or a tg_* helper. In Botlify, the environment supplies BOT_TOKEN. Outside Botlify, supply it yourself and configure the webhook. PHP cURL and a working CA trust store are needed for the verified HTTPS connection.

```php

```

## How to verify both

Test one version at a time. Send /start, /help, ordinary text containing < and >, and press the button. Confirm one reply per text message and a callback acknowledgement. An API success response verifies acceptance; inspect the client to check actual button/message rendering. Switch examples only after backing up your code.

## Move toward production

Keep replies within Telegram text limits; split long content deliberately. Add per-user state, permissions for administrative actions, operation-level deduplication, bounded retries and structured diagnostics. Do not register a webhook on every update or keep a long polling loop inside the hosted webhook. Use [persistent state](/bot-state-and-storage) and [testing guidance](/bot-testing-and-performance).
