PHPackages                             eseytgbot/telegram-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. eseytgbot/telegram-api

ActiveProject[Framework](/categories/framework)

eseytgbot/telegram-api
======================

A lightweight and flexible framework for building Telegram bots in PHP.

v1.0.1(1y ago)03MITPHPPHP ^8.0

Since Apr 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/hshmatullahnoor/Telegram-Bot-PHP)[ Packagist](https://packagist.org/packages/eseytgbot/telegram-api)[ RSS](/packages/eseytgbot-telegram-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (2)Used By (0)

\# Bot Structure Project \[فارسی\](README.fa.md) | \[English\](README.md) A PHP-based Telegram bot framework with a modular command structure. ## Project Structure ``` BotStractuer/ ├── App/ │ └── Commands/ │ ├── BotCommands/ # Bot command App │ └── Kernal.php # Core initialization ├── bot.php # Main bot file ├── autoload.php # Class autoloader ├── config.php # Configuration file └── error.log # Error logging ``` ## Setup 1. Make sure you have PHP 8 or higher installed 2. Configure your Telegram bot token 3. Set up your webhook to point to `bot.php` ## Configuration Structure The `config.php` file contains all the configuration settings: ```php # Database Configuration const DB\_HOST = 'localhost'; const DB\_NAME = 'bot'; const DB\_USER = 'root'; const DB\_PASS = ''; # Telegram Configuration const TELEGRAM\_TOKEN = 'YOUR\_BOT\_TOKEN'; const TELEGRAM\_API\_URL = ''; const TELEGRAM\_WEBHOOK\_URL = ''; ``` ## Adding Commands Place your command App in the `App/Commands/BotCommands/` directory. Each command should be in its own PHP file with the same name as the class. ## Helper Utility The helper utility provides several commands to manage your bot: | Command | Description | |---------|-------------| | `helper table:up` | Create all database tables | | `helper table:fresh` | Drop and recreate all tables | | `helper make:command {name}` | Create a new bot command class | | `helper delete:command {name}` | Delete a bot command class | | `helper make:table {name}` | Create a new database table class | | `helper delete:table {name}` | Delete a database table class | | `helper webhook:set` | Set the webhook URL for the bot | | `helper webhook:delete` | Delete the webhook URL for the bot | ### Examples: ```bash # Create a new command helper make:command StartCommand # Create a new table helper make:table Users # Set up the webhook helper webhook:set ``` ## Database Management ### Schema Usage The Schema class provides fluent methods for database operations: ```php use App\\Database\\Schema; // Select data Schema::table('users') -&gt;select(\['id', 'username'\]) -&gt;where('active', '=', 1) -&gt;get(); // Insert data Schema::table('users')-&gt;insert(\[ 'username' =&gt; 'john', 'email' =&gt; 'john@example.com' \]); // Update data Schema::table('users') -&gt;where('id', '=', 1) -&gt;update(\['status' =&gt; 'active'\]); // Delete data Schema::table('users') -&gt;where('id', '=', 1) -&gt;delete(); // Count records $count = Schema::table('users') -&gt;where('status', '=', 'active') -&gt;count(); ``` ### Creating Tables Use CreateTable class to define database structures: ```php use App\\Database\\CreateTable; class Users extends CreateTable { public static function up(): void { self::table('users') -&gt;int('id')-&gt;primaryKey()-&gt;autoIncrement() -&gt;varchar('username', 100)-&gt;notNull()-&gt;unique() -&gt;varchar('email', 255)-&gt;nullable() -&gt;text('bio') -&gt;datetime('last\_login')-&gt;nullable() -&gt;int('status')-&gt;default(1) -&gt;create(); } public static function down(): void { self::drop('users'); } } ``` Available Column Types: - `int(name, \[length\])` - `varchar(name, length)` - `text(name)` - `datetime(name)` Column Modifiers: - `primaryKey()` - `autoIncrement()` - `notNull()` - `nullable()` - `unique()` - `default(value)` - `index()` - `foreignKey(table, column)` ## Error Handling Errors are logged to `error.log` file. Debug mode can be enabled by changing `display\_errors` in `bot.php`. # Telegram-Bot-PHP

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance46

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

409d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/87813642ea4fa0fcd0348af881c642cd5c494f7ec84129db06359f76fad5604e?d=identicon)[meysamnoori010](/maintainers/meysamnoori010)

---

Top Contributors

[![hshmatullahnoor](https://avatars.githubusercontent.com/u/204420579?v=4)](https://github.com/hshmatullahnoor "hshmatullahnoor (1 commits)")

### Embed Badge

![Health badge](/badges/eseytgbot-telegram-api/health.svg)

```
[![Health](https://phpackages.com/badges/eseytgbot-telegram-api/health.svg)](https://phpackages.com/packages/eseytgbot-telegram-api)
```

###  Alternatives

[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

712181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)[laravel/pail

Easily delve into your Laravel application's log files directly from the command line.

91545.3M590](/packages/laravel-pail)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
