rezident/self-documented-telegram-bot-sdk

Self-documented Telegram Bot Sdk

Installs: 27

Dependents: 1

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/rezident/self-documented-telegram-bot-sdk

6.6.0 2023-03-22 05:09 UTC

This package is auto-updated.

Last update: 2025-10-22 10:53:20 UTC


README

This is a simple Telegram Bot SDK written in PHP.

Usage

Getting Bot updates

use Rezident\SelfDocumentedTelegramBotSdk\components\Executor;
use Rezident\SelfDocumentedTelegramBotSdk\methods\GettingUpdates\GetUpdatesMethod;

$executor = new Executor('8360528562:Eim2eitahSh3ohshi7zee2Hoh2gaewee6eV');
$updates = GetUpdatesMethod::new()->exec($executor);

foreach ($updates as $update) {
    echo $update->getMessage()->getText();
}

Sending messages

use Rezident\SelfDocumentedTelegramBotSdk\components\Executor;
use Rezident\SelfDocumentedTelegramBotSdk\methods\GettingUpdates\GetUpdatesMethod;

$executor = new Executor('8360528562:Eim2eitahSh3ohshi7zee2Hoh2gaewee6eV');
$sentMessage = SendMessageMethod::new(8376498, 'Hello my dear friend!')->exec($executor);
...