Skip to content

khamdullaevuz/telegram-bot-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram bot php

PHP Redis

GitHub forks GitHub Repo stars GitHub watchers

Ishlatish

Composer orqali yuklash

composer require khamdullaevuz/telegram-bot-php

Ulanish

<?php
require 'vendor/autoload.php';

use 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
	]);
}

Konfiguratsiya

.env.example fayldan .env fayl yaratib olamiz

cp .env.example .env

.env faylga kerakli sozlamalarni yozib olamiz

Examples

Example: example

Created by: Elbek Khamdullaev