-
Notifications
You must be signed in to change notification settings - Fork 0
Home
maule edited this page Aug 17, 2026
·
3 revisions
Welcome to the TGbotPHP documentation wiki. This is your comprehensive guide to building Telegram bots with TGbotPHP 2.0.
- Getting Started - Installation and your first bot
- API Reference - Complete 120+ method documentation
- Examples - Code examples and use cases
- Security Guide - Security best practices
- Deployment - Production deployment guide
- Keyboards and Callbacks - Interactive UI elements
- FAQ - Frequently asked questions
- Troubleshooting - Common issues and solutions
TGbotPHP is a professional, production-ready Telegram Bot Framework for PHP 8.2+. It implements the complete Telegram Bot API with modern PHP practices, security-first design, and comprehensive documentation.
- Complete API Coverage - 120+ Telegram Bot API methods fully implemented
- Professional Architecture - PSR-4 autoloading, trait-based composition, middleware pipeline
- Security First - HTTPS enforcement, token validation, rate limiting, session management
- Modern PHP - PHP 8.2-8.4 with strict types and latest language features
- Zero Dependencies - Production code has no external dependencies
- Production Ready - Docker support, CI/CD pipelines, comprehensive testing
- Extensible - Plugin system, middleware hooks, event listeners
- Well Documented - 11 professional guides plus wiki
- Bot - Main orchestrator class
- ApiClient - Composes 120+ API methods through traits
- Router - Command and callback routing
- MiddlewarePipeline - Request processing pipeline
- EventDispatcher - Lifecycle hooks and events
- WebhookValidator - Secure webhook validation
- RateLimiter - Request rate limiting
- SessionManager - User session management
- ArrayCache - In-memory caching with TTL
- PluginManager - Plugin system for extensibility
- BotBuilder - Fluent configuration pattern
- CLI Tool - Webhook and bot management
- Keyboard Helpers - Easy button creation
- MessageParser - Entity extraction and parsing
- Logger - Comprehensive logging system
- Complete rewrite for PHP 8.4+
- 120+ API methods implemented
- Enterprise-grade security
- Production-ready deployment
- Comprehensive documentation
- Documentation - Browse this wiki for detailed guides
- Bug Reports - GitHub Issues
- Questions - Use GitHub Discussions
- Security - See Security Policy
- PHP 8.2 or higher (8.4+ recommended)
- cURL extension enabled
- Network access to Telegram Bot API
- Composer for dependency management
<?php
require_once __DIR__ . '/vendor/autoload.php';
use TGbotPHP\Utilities\BotBuilder;
$bot = (new BotBuilder('YOUR_BOT_TOKEN'))
->addCommand('start', function($bot, $message) {
$bot->sendMessage(
chatId: $message['chat']['id'],
text: 'Welcome to TGbotPHP!'
);
})
->build();
$bot->handle();- Lines of Code: 8,000+
- API Methods: 120+
- Trait Modules: 13
- Test Coverage: Comprehensive
- Documentation: Complete
- PSR Standards: PSR-1, PSR-2, PSR-4, PSR-12
- License: MIT
- Main Repository: GitHub
- Issue Tracker: GitHub Issues
- License: MIT
LightYagami28 (ceo@retechrevive.it)
Ready to get started? Begin with the Getting Started guide or explore specific topics in the menu above.