TeleBotHost
TeleBotHost Guide System Guide

Build, deploy & manage your Telegram PHP Bot.

Everything you need to create a Telegram bot with BotFather, upload your PHP code, and launch it on TeleBotHost. Webhook configuration is automatic when you deploy a bot from the dashboard.

One-click deployToken verification and webhook setup happen automatically.
Secure webhookTeleBotHost uses Telegram's secret webhook header.
Mobile readyManage files, bot actions and documentation from your phone.

Getting Started

Follow these steps for your first deployment.

01

Create your Telegram bot

Open @BotFather, run /newbot, choose a name and username, then copy the HTTP API token.

02

Open TeleBotHost

Sign in to your TeleBotHost account and open New Bot from the dashboard.

03

Enter the token

Enter the BotFather token. Username can be left blank because TeleBotHost verifies it automatically with Telegram.

04

Deploy

Press Deploy with One Click. TeleBotHost creates the bot folder, writes the starter PHP code and connects the webhook.

Create a Telegram Bot

Your BotFather token is the only required Telegram credential.

  1. Open Telegram and search for @BotFather.
  2. Send /newbot.
  3. Choose your bot display name.
  4. Choose a unique username ending with bot.
  5. Copy the API token.
  6. Never share the token publicly.
Security: A BotFather token provides control over your bot. If it is exposed, revoke or regenerate it through BotFather and update the token in TeleBotHost.

PHP Bot Code

Here is a simple webhook-based PHP 8+ example. TeleBotHost's generated starter bot follows the same API approach.

index.php
<?php
declare(strict_types=1);

$BOT_TOKEN = 'YOUR_BOT_TOKEN';
$API = "https://api.telegram.org/bot{$BOT_TOKEN}/";

function telegram(string $method, array $data = []): array {
    global $API;
    $ch = curl_init($API . $method);
    curl_setopt_array($ch, [
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_POST => true,
        CURLOPT_POSTFIELDS => $data,
        CURLOPT_TIMEOUT => 15,
    ]);
    $raw = curl_exec($ch);
    curl_close($ch);
    return json_decode($raw ?: '{}', true) ?: [];
}

$update = json_decode(file_get_contents('php://input'), true);
if (!is_array($update)) { http_response_code(200); exit; }

$message = $update['message'] ?? null;
if (!$message) { http_response_code(200); exit; }

$chatId = $message['chat']['id'];
$text = trim((string)($message['text'] ?? ''));

if ($text === '/start') {
    telegram('sendMessage', [
        'chat_id' => $chatId,
        'text' => "๐Ÿ‘‹ Welcome! Your PHP Telegram Bot is online."
    ]);
} elseif ($text === '/help') {
    telegram('sendMessage', [
        'chat_id' => $chatId,
        'text' => "/start - Start bot\n/help - Show help"
    ]);
} else {
    telegram('sendMessage', [
        'chat_id' => $chatId,
        'text' => "You said: {$text}"
    ]);
}

http_response_code(200);
TeleBotHost tip: Do not manually call setWebhook for a bot created from the dashboard. TeleBotHost does it automatically.

AI Bot Prompt Builder

Describe the bot you want, then generate a ready-to-use prompt for an AI coding assistant.

The generated prompt is designed for PHP 8+, Telegram Bot API, webhook-based bots and TeleBotHost deployment. It does not ask for unnecessary external services.
Generated AI Prompt

Automatic Webhook

When you deploy a bot, TeleBotHost performs the webhook setup for you.

StageWhat happens
1. VerifyTeleBotHost calls Telegram getMe to validate the token and detect the real username.
2. PrepareA private bot folder and starter index.php are created.
3. SecureA unique webhook secret is generated for the bot.
4. ConnectTelegram setWebhook is called with the bot URL and secret token.
5. OnlineThe dashboard marks the bot Running when Telegram confirms the webhook.
On Stop, the webhook is removed. On Start/Deploy, it is automatically registered again.

Manage Your Bot

Open My Bots to manage your deployed bot.

Start / Deploy

Reconnect the webhook and bring the bot online.

Stop

Remove the Telegram webhook and stop incoming updates.

Health

Check Telegram bot identity and API response.

Webhook

Inspect Telegram webhook URL, errors and pending updates.

Security Best Practices

  • Never publish your BotFather token.
  • Use HTTPS for webhook endpoints.
  • Keep PHP and server software updated.
  • Do not put private API keys in frontend JavaScript.
  • Use the generated webhook secret and do not remove its validation from production bots.
  • Review bot logs when debugging unexpected behavior.

Troubleshooting

Open My Bots โ†’ Webhook and check the webhook status. Confirm the bot is Running, the token is valid, and the website is accessible over HTTPS.
Check Telegram's webhook error message and pending update count. Fix the PHP/server error, then press Deploy to register the webhook again.
Check the server PHP error log. Common causes include syntax errors, missing PHP extensions, permission problems, or incompatible PHP versions.

Frequently Asked Questions

No. For bots created through TeleBotHost, the platform automatically sets the webhook during deployment and re-connects it when you Start/Deploy.
Yes. Upload your PHP files through the bot File Manager and make sure your main webhook entry file correctly processes Telegram updates.
Use the PHP version supported by your TeleBotHost server and your bot dependencies. PHP 8+ is recommended for modern bot projects.