PHP code example of khamdullaevuz / telegram-bot-php
1. Go to this page and download the library: Download khamdullaevuz/telegram-bot-php library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
khamdullaevuz / telegram-bot-php example snippets
Khamdullaevuz\Telegram;
use Khamdullaevuz\Plugin;
$telegram = new Telegram();
$input = Telegram::getInput();
if($input->message){
$message = $input->message;
$chat_id = $message->chat->id;
$text = $message->text;
}
$keyboard = Plugin::buildInlineKeyboard([
[["Inline Keyboard test","inline"]],
]);
if($text == "/start"){
$telegram->sendMessage($chat_id, [
'text'=>"Salom",
'reply_markup'=>$keyboard
]);
}
bash
composer