miraliog/pelegram

PHP Library for Telegtram, pelegram

Maintainers

Package info

github.com/miraliog/pelegram

pkg:composer/miraliog/pelegram

Transparency log

Statistics

Installs: 24

Dependents: 0

Suggesters: 0

Stars: 0

v1.0.5 2026-08-29 14:37 UTC

This package is auto-updated.

Last update: 2026-08-29 14:37:33 UTC


README

A lightweight PHP wrapper for the Telegram Bot API.

pelegram provides a simple interface for building Telegram bots with PHP, including API methods, update handling, routing, and convenient access to update data.

Requirements

  • PHP 8.1+
  • Guzzle HTTP 7.x

Installation

Install pelegram with Composer:

composer require miraliog/pelegram

Quick Example

<?php

require 'vendor/autoload.php';

use miraliog\pelegram\Bot;
use miraliog\pelegram\Router;
use miraliog\pelegram\Update;

$bot = new Bot('YOUR_BOT_TOKEN');
$router = new Router();

$router->onCommand('start', function (Bot $bot, Update $update) {
    $bot->sendMessage(
        $update->chatId(),
        'Hello from pelegram!'
    );
});

$update = new Update(
    json_decode(file_get_contents('php://input'), true)
);

$router->dispatch($bot, $update);

That's it.

pelegram is designed to stay close to the Telegram Bot API while keeping bot code clean and simple.

License

MIT