PHPackages                             kalexhaym/laravel-telegram-bot - 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. [API Development](/categories/api)
4. /
5. kalexhaym/laravel-telegram-bot

ActiveProject[API Development](/categories/api)

kalexhaym/laravel-telegram-bot
==============================

Telegram Bot package for Laravel

2.0.3(1y ago)437MITPHP

Since Oct 1Pushed 1y ago1 watchersCompare

[ Source](https://github.com/kalexhaym/laravel-telegram-bot)[ Packagist](https://packagist.org/packages/kalexhaym/laravel-telegram-bot)[ RSS](/packages/kalexhaym-laravel-telegram-bot/feed)WikiDiscussions master Synced today

READMEChangelog (7)Dependencies (6)Versions (8)Used By (0)

[![](https://github.com/kalexhaym/laravel-telegram-bot/workflows/Tests/badge.svg)](https://github.com/kalexhaym/laravel-telegram-bot/actions)[![](https://camo.githubusercontent.com/1437bece12be29127b5007794c1f6c49302fe73f30677cb600690cb6a3b10576/68747470733a2f2f636f6465636f762e696f2f67682f6b616c65786861796d2f6c61726176656c2d74656c656772616d2d626f742f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/kalexhaym/laravel-telegram-bot)[![Packagist](https://camo.githubusercontent.com/07a2092542915778af54af531d776f819e17885836a5c2a2847a78b7f352d302/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b616c65786861796d2f6c61726176656c2d74656c656772616d2d626f742e737667)](https://packagist.org/packages/kalexhaym/laravel-telegram-bot)

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

[](#installation)

```
composer require kalexhaym/laravel-telegram-bot

```

Publish config
==============

[](#publish-config)

```
php artisan vendor:publish --tag=telegram-config

```

Make Commands and Callbacks
===========================

[](#make-commands-and-callbacks)

```
php artisan make:telegram-command Start
php artisan make:telegram-callback Start

```

Make Text Handler
=================

[](#make-text-handler)

```
php artisan make:telegram-text-handler Text

```

Make Polls Handler
==================

[](#make-polls-handler)

```
php artisan make:telegram-polls-handler Polls

```

Setup
=====

[](#setup)

After creating a Command or Callback, it must be registered in config/telegram.php

[![commands-registration.png](.github/IMAGES/commands-registration.png)](.github/IMAGES/commands-registration.png)

Add Telegram Bot token in .env

```
TELEGRAM_TOKEN=

```

Getting updates
===============

[](#getting-updates)

There are two mutually exclusive ways of receiving updates for your bot - the getUpdates method

```
php artisan telegram:poll-updates

```

and webhooks

```
php artisan telegram:set-hook

```

Usage
=====

[](#usage)

Send a simple message

```
$message->sendMessage('Hello, world!');

```

Send a simple message with keyboard

```
use Kalexhaym\LaravelTelegramBot\Keyboard;

$keyboard = (new Keyboard())
        ->inline()
        ->resizable()
        ->addButton('Test Callback', 'callback')
        ->addLink('Test Link', 'https://test.com');

$message->setKeyboard($keyboard)->sendMessage('Hello, world!');

```

Send photo
*Use this method to send photos.*

```
use Kalexhaym\LaravelTelegramBot\Photo;

$message->sendPhoto('https://test.com/photo.jpg');
// OR
$message->sendPhoto(new Photo('photo.jpg'));

```

Send Audio
*Use this method to send audio files, if you want Telegram clients to display them in the music player.*

```
use Kalexhaym\LaravelTelegramBot\Audio;

$message->sendAudio('https://test.com/photo.mp3');
// OR
$message->sendAudio(new Audio('photo.mp3'));

```

Send Document
*Use this method to send general files.*

```
use Kalexhaym\LaravelTelegramBot\Document;

$message->sendDocument('https://test.com/photo.pdf');
// OR
$message->sendDocument(new Document('photo.pdf'));

```

Send Video
*Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as Document).*

```
use Kalexhaym\LaravelTelegramBot\Video;

$message->sendVideo('https://test.com/photo.mp4');
// OR
$message->sendVideo(new Video('photo.mp4'));

```

Send Animation
*Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound).*

```
use Kalexhaym\LaravelTelegramBot\Animation;

$message->sendAnimation('https://test.com/photo.gif');
// OR
$message->sendAnimation(new Animation('photo.gif'));

```

Send Voice
*Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message.
For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as Audio or Document).*

```
use Kalexhaym\LaravelTelegramBot\Voice;

$message->sendVoice('https://test.com/photo.mp3');
// OR
$message->sendVoice(new Voice('photo.mp3'));

```

Send poll
*Use this method to send a native poll.*

```
use Kalexhaym\LaravelTelegramBot\Poll;

// Regular poll
$poll = (new Poll('Question', ['answer_1', 'answer_2']))
        ->allowsMultipleAnswers()
        ->notAnonymous();

// Quiz
$poll = (new Poll('Question', ['answer_1', 'answer_2']))
        ->quiz(0, 'Explanation')
        ->openPeriod(3600);

$message->sendPoll($poll);

```

###  Health Score

27

—

LowBetter than 46% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

Every ~23 days

Recently: every ~1 days

Total

7

Last Release

544d ago

Major Versions

1.0.2 → 2.0.02025-02-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/cf5239984e4dbc7df5ead334020d68a0ba56339c90fe4fc93aabc1849438dc77?d=identicon)[kalexhaym](/maintainers/kalexhaym)

---

Top Contributors

[![kalexhaym](https://avatars.githubusercontent.com/u/37374594?v=4)](https://github.com/kalexhaym "kalexhaym (107 commits)")

---

Tags

laravelbottelegram

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/kalexhaym-laravel-telegram-bot/health.svg)

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

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.9k3.8M1.2k](/packages/statamic-cms)[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.8M228](/packages/backpack-crud)[unopim/unopim

UnoPim Laravel PIM

10.8k2.5k](/packages/unopim-unopim)[bagisto/bagisto

Bagisto Laravel E-Commerce

28.0k175.2k9](/packages/bagisto-bagisto)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

353.6k](/packages/eslazarev-wildberries-sdk)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

793.9k](/packages/scriptdevelop-whatsapp-manager)

PHPackages © 2026

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