Skip to content

gest/telegest is a small PHP library for interacting with the Telegram Bot API. It is designed to simplify the process of creating and managing Telegram bots, presenting a user-friendly interface for working with the Telegram API.

Notifications You must be signed in to change notification settings

jestsi/telegest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gest/telegest

📖 Description

gest/telegest is a small PHP library for interacting with the Telegram Bot API. It is designed to simplify the process of creating and managing Telegram bots, presenting a user-friendly interface for working with the Telegram API.

🚀 Features

  • Sending messages and media files
  • Processing incoming messages and commands
  • Asynchronous HTTP request support via Guzzle and ReactPHP
  • Dependency injection using PHP-DI

⚙️ Installation

You can install the library using Composer:

composer require gest/telegest

📚 Usage/Examples

🤖 Echo bot

$bot = new TGBot($token);

$bot
    ->getUpdateHandler()
    ->attachCallable(UpdateType::Message, fn($message) => (new TGBotClient)->sendMessage($message))
    ->handleUpdates()
    ->run();

Answer on inline query

$bot = new TGBot($token);
$bot
    ->getUpdateHandler()
    ->attachCallable(UpdateType::InlineQuery, function ($query) use ($bot) {
        $builder = (new InlineQueryAnswerBuilder($query->id))
            ->addArticleResult('1', 'test', '/delete')
            ->addPhotoResult('2', 
                'https://w7.pngwing.com/pngs/140/284/png-transparent-animated-woody-illustation-buzz-lightyear-sheriff-woody-jessie-toy-story-film-toy-story-cartoon-pixar-toy-story-3.png', 
                'https://www.pinclipart.com/picdir/big/209-2099521_thumb-up-comments-english-lovers-clipart.png')
            ->addLocationResult('3', 48.90174, 2.27829, 'Париж');
        (new TGBotClient)->sendAnswerInlineQuery($builder);
    })
    ->handleUpdates()
    ->run();

🛠️ Stack

Bible Library: ReactPHP, Guzzle, PHP-DI PHP Version

Guzzle

ReactPHP

PHP-DI

MIT License

🆘 Support

[email protected]


gest/telegest

📖 Описание

gest/telegest - это небольшая PHP-библеотека для взаимодействия с API Telegram Bot. Она предназначена для упрощения процесса создания и управления Telegram-ботами, представляя удобный интерфейс для работы с API Telegram.

🚀 Возможности

  • Отправка сообщений и медиафайлов
  • Обработка входящих сообщений и команд
  • Поддержка асинхронного HTTP-запроса через Guzzle и ReactPHP
  • Внедрение зависимостей с использованием PHP-DI

⚙️ Установка

Установить библиотеку можно с помощью Composer:

composer require gest/telegest

📚 Использование/Примеры

🤖 Бот ретранслятор сообщений

$bot = new TGBot($token);

$bot
    ->getUpdateHandler()
    ->attachCallable(UpdateType::Message, fn($message) => (new TGBotClient)->sendMessage($message))
    ->handleUpdates()
    ->run();

🛠️ Стек

Библеотека: ReactPHP, Guzzle, PHP-DI PHP Version

Guzzle

ReactPHP

PHP-DI

MIT License

🆘 Поддержка

[email protected]

About

gest/telegest is a small PHP library for interacting with the Telegram Bot API. It is designed to simplify the process of creating and managing Telegram bots, presenting a user-friendly interface for working with the Telegram API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages