A simple PHP wrapper for the Telegram Bot API

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/mehdihamid1223/telemon

1.0.0 2025-10-04 07:50 UTC

This package is auto-updated.

Last update: 2026-01-04 08:20:51 UTC


README

A simple PHP wrapper for the Telegram Bot API, providing object-oriented access to Telegram responses with autocomplete support in IDEs.

Installation

composer require MehdiHamid32/telemon

Usage

<?php

use Telemon\Telemon;

require_once __DIR__ . '/vendor/autoload.php';

try {
    $telemon = Telemon::create('YOUR_BOT_TOKEN');

    $message = $telemon->sendMessage([
        'chat_id' => 123,
        'text' => 'Hello, world!'
    ]);

    if ($message->ok()) {
        echo "Message ID: " . $message->result()->messageId();
    } else {
        echo "Error: " . $message->description();
    }
} catch (Exception $e) {
    echo "Exception: " . $e->getMessage();
}

Features

✅ Easy-to-use OOP wrapper for Telegram Bot API ✅ IDE autocomplete support for Telegram objects (Message, User, Chat, etc.) ✅ Error handling with exceptions ✅ Supports all Telegram Bot API methods

License

MIT License © 2025 Mehdi Hamid