Skip to content

rezident/self-documented-telegram-bot-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Self-documented Telegram Bot Sdk 👌😎🤌

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);
...

About

Self-documented Telegram Bot Sdk

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages