mirkhamidov/simple-bot-telegram

1.1 2021-03-24 21:25 UTC

This package is auto-updated.

Last update: 2024-10-25 06:10:26 UTC


README

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require mirkhamidov/simple-bot-telegram "*"

or add

"mirkhamidov/simple-bot-telegram": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

<?php
$tg = new TelegramBot($tokenForBot);
$tg->sendMessage('Message with inline keyboard', $chatId, [
 'reply_markup' => json_encode([
     'inline_keyboard'=>[
         [
             ['text'=>"refresh",'callback_data'=> time()]
         ]
     ]
 ]);
?>

PS: Inspired by aki/yii2-bot-telegram