PHPackages                             tje3d/telegram - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tje3d/telegram

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tje3d/telegram
==============

1.3.1(9y ago)61231MITPHPPHP &gt;=5.5

Since Apr 14Pushed 8y ago1 watchersCompare

[ Source](https://github.com/tje3d/Telegram)[ Packagist](https://packagist.org/packages/tje3d/telegram)[ RSS](/packages/tje3d-telegram/feed)WikiDiscussions stable Synced 3w ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

Telegram Bot API
================

[](#telegram-bot-api)

PHP Telegram Bot API, Supports Laravel.

Installation
============

[](#installation)

`composer require tje3d/telegram`

Laravel Only
============

[](#laravel-only)

### Service Provider

[](#service-provider)

`Tje3d\Telegram\Laravel\TelegramServiceProvider::class`

### Facade

[](#facade)

`'Bot' => Tje3d\Telegram\Laravel\Facades\Bot::class`

### Publish Assets

[](#publish-assets)

`artisan vendor:publish --tag=telegram`

Will make a config file named telegram (config/telegram.php)

Examples
========

[](#examples)

### ✔️ Initialize a Bot

[](#️-initialize-a-bot)

```
$bot = new \Tje3d\Telegram\Bot($token);
$info = $bot->getMe();
print_r($info);

```

### ✔️ Set Web Hook

[](#️-set-web-hook)

```
$bot->setWebhook('https://sld.tld');

```

### ✔️ Get Updates

[](#️-get-updates)

```
$response = $bot->getUpdates();
...
$response = $bot->getUpdates($offset=0, $limit=100, $timeout=10); // Long pull

```

### ✔️ Send text message (known as sendMessage)

[](#️-send-text-message-known-as-sendmessage)

```
$bot->sendMethod(
	(new \Tje3d\Telegram\Methods\Text())
	    ->text('test')
	    ->chat_id($chatId)
);

```

#### ⭐️ Or pass configuration as array

[](#️-or-pass-configuration-as-array)

```
$bot->sendMethod(
    (new Tje3d\Telegram\Methods\Text(['text' => 'hi', 'chat_id' => $chatId]))
);

```

### ✔️ Keyboard

[](#️-keyboard)

#### ⭐️ Reply Keyboard

[](#️-reply-keyboard)

```
$bot->sendMethod(
	(new Tje3d\Telegram\Methods\Text)
		->text('My Sample Text')
		->chat_id($chatId)
		->reply_markup(
			(new Tje3d\Telegram\Markups\ReplayKeyboardMarkup)
    			->row(function($handler){
    				$handler->addButton(['text' => 'btn1']);
    				$handler->addButton(['text' => 'my special button ⭐️']);
    			})
    			->row(function($handler){
    				$handler->addButton(['text' => 'WOW']);
    			})
    			->row(function($handler){
    				$handler->addButton(['text' => 'Hey this is third line!']);
    			})
    			->row(function($handler){
    				$handler->addButton(['text' => '1']);
    				$handler->addButton(['text' => '2']);
    				$handler->addButton(['text' => '3']);
    				$handler->addButton(['text' => '4']);
    			})
		)
);

```

[![image](https://cloud.githubusercontent.com/assets/5238989/24823179/1c9cb8d2-1c11-11e7-96b1-212be128454f.png)](https://cloud.githubusercontent.com/assets/5238989/24823179/1c9cb8d2-1c11-11e7-96b1-212be128454f.png)

#### ⭐️ Inline Keyboard

[](#️-inline-keyboard)

```
$bot->sendMethod(
	(new Tje3d\Telegram\Methods\Text)
		->text('My Sample Text')
		->chat_id($testChatId)
		->reply_markup(
			(new Tje3d\Telegram\Markups\InlineKeyboardMarkup)
    			->row(function($handler){
    				$handler->addButton(['text' => 'btn1', 'url' => 'http://sld.tld']);
    				$handler->addButton(['text' => 'my special button ⭐️', 'url' => 'http://sld.tld']);
    			})
    			->row(function($handler){
    				$handler->addButton(['text' => 'WOW', 'callback_data' => 'doSomethingSpecial']);
    			})
		)
);

```

[![image](https://cloud.githubusercontent.com/assets/5238989/24823178/1c9aa09c-1c11-11e7-9ec0-85ad42c41440.png)](https://cloud.githubusercontent.com/assets/5238989/24823178/1c9aa09c-1c11-11e7-9ec0-85ad42c41440.png)

### ✔️ Photo, Audio, Video, Document ...

[](#️-photo-audio-video-document-)

```
$bot->sendMethod(
	(new \Tje3d\Telegram\Methods\Photo)
		->chat_id($chatId)
		->photo(realpath('pic.png'))
);

...

$bot->sendMethod(
	(new \Tje3d\Telegram\Methods\Video)
		->chat_id($chatId)
		->video(realpath('video.mp4'))
		->duration(10) // optional
		->width(320) // optional
		->height(320) // optional
);

...

$bot->sendMethod(
	(new \Tje3d\Telegram\Methods\Audio)
		->chat_id($chatId)
		->audio(realpath('video.mp3'))
		->duration(30) // optional
		->performer('tje3d') // optional
		->title('Great music') // optional
);
...

```

### ✔️ ChatAction

[](#️-chataction)

```
$bot->sendMethod(
	(new \Tje3d\Telegram\Methods\ChatAction)
		->chat_id($testChatId)
		->typing() // Could be: upload_photo, record_video, upload_video, record_audio, upload_audio, upload_document, find_location
);

```

Exceptions
==========

[](#exceptions)

Throw's Tje3d\\Telegram\\Exceptions\\TelegramResponseException if sendMethod failed.

```
try {
	$bot = new \Tje3d\Telegram\Bot($token);
	$response = $bot->sendMethod(
		(new \Tje3d\Telegram\Methods\Text())
		    ->text($text)
		    ->chat_id($chatId)
	);
} catch (TelegramResponseException $e) {
	print_r($e->response());
}

```

Contact me
==========

[](#contact-me)

You can contact me via [Telegram](https://telegram.me/tje3d) or [Email](mailto:tje3d@yahoo.com).

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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

Every ~7 days

Total

4

Last Release

3336d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/73386c7e0e78428da63e62e1a61f1a1dab64261be3a38022d1d88fedcfbf90eb?d=identicon)[tje3d](/maintainers/tje3d)

---

Top Contributors

[![moeinporkamel](https://avatars.githubusercontent.com/u/202500882?v=4)](https://github.com/moeinporkamel "moeinporkamel (38 commits)")

---

Tags

composerlaravellaravel-packagelaravel-telegrampackagepackagisttelegramtelegram-apitelegram-bottelegram-bot-api

### Embed Badge

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

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

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

749284.3k35](/packages/civicrm-civicrm-core)[roundcube/roundcubemail

The Roundcube Webmail suite

7.0k1.4k3](/packages/roundcube-roundcubemail)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)[nfse-nacional/nfse-php

This is my package nfse

1523.1k](/packages/nfse-nacional-nfse-php)

PHPackages © 2026

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