pashkevich-s-d/trainee-telegram-bot-client

There is no license information available for the latest version (0.0.2) of this package.

Telegram bot client example

0.0.2 2023-02-18 20:36 UTC

This package is not auto-updated.

Last update: 2024-05-12 03:35:49 UTC


README

Telegram bot client example

Description

This project can be used as an example of creating packages and installing them using composer.

It can be useful for those who are learning PHP and related technologies, or for those who are teaching students.

Example

Add current package:

composer require pashkevich-s-d/trainee-telegram-bot-client

Then:

use \PashkevichSD\TraineeTelegramBotClient\Service\TelegramBotClient;
use \PashkevichSD\TraineeTelegramBotClient\Model\Request\Message;

$telegramBotClient = new TelegramBotClient('YourTelegramBotToken');

To be able to get updates:

$telegramBotClient->getUpdates();

To be able to send message:

telegramBotClient->sendMessage((new Message())->setChatId($chatId)->setText($message));