Debugging Guide
Start with the platform action result, then Terminal Logs, then Telegram webhook state. Avoid random code changes before identifying which layer failed.
01
Fast diagnosis table
Common symptoms and the first useful fix.
| Problem | Likely cause | First fix |
|---|---|---|
| Start shows token error | Invalid or revoked BotFather token | Regenerate token and update the bot record |
Start says bot.php missing | Wrong filename or file not saved | Create exactly bot.php in the bot workspace |
| Webhook failed | HTTPS/DNS/network problem or Telegram API rate limit | Check action error text, SSL and retry timing |
| Bot starts but no reply | PHP logic/runtime error | Open Terminal Logs and test a minimal /start handler |
| Old code still runs | Runtime not refreshed | Save the file and press Restart |
| Bot is banned | Admin runtime lock | Only admin can Unban; user controls remain blocked |
| Python/Laravel does not start | Unsupported built-in runtime | Deploy to compatible external hosting and set webhook there |
02
Minimal isolation test
Replace complex code temporarily with the smallest PHP webhook handler.
bot.php diagnostic
<?php
$update = json_decode(file_get_contents('php://input') ?: '[]', true);
file_put_contents(__DIR__.'/debug.log', date('c').' '.json_encode($update).PHP_EOL, FILE_APPEND);
http_response_code(200);
echo 'OK';
Remove temporary debug files
Do not keep verbose update logs in production. They may contain usernames, chat IDs and message content.