Skip to content
This repository was archived by the owner on Oct 13, 2020. It is now read-only.

bitnooob/TelegramLib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TelegramLib

Библиотека для упрощенной разработки ботов Telegram.

Скачивание

$ git clone https://github.com/bitnooob/TelegramLib.git

Подключение

$bot = new \telegram\bot\Bot('token');

Пример

require_once 'autoload.php';

$bot = new \telegram\bot\Bot('token');
$longpoll = $bot->getLongPoll();

while (true) {
    $update = $longpoll->getUpdates();
    if (empty($update))
        continue;

    foreach ($update as $data) {
        $message = $data['message'];
        $from = $message['from'];

        $text = $message['text'];
        $user_id = $from['id'];

        $user = $bot->getUser($user_id);
        $user->sendMessage('hello');
    }
}

About

Библиотека для упрощенной разработки ботов Telegram.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages