/telegram-bot-php

Telegram bot framework

Primary LanguagePHPMIT LicenseMIT

Framework

PHP SQLite MySQLi PDO

GitHub forks GitHub Repo stars GitHub watchers

Ishlatish

Composer orqali yuklash

composer require khamdullaevuz/telegram-bot-php

Ulanish

require_once __DIR__.'/vendor/autoload.php';

use Framework\Config;
use Framework\Method;
use Framework\Plugin;
use Framework\Update;

Config::setApiToken("API_TOKEN");

$input = Update::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"){
	Method::sendMessage($chat_id, [
		'text'=>"Salom",
		'reply_markup'=>$keyboard
	]);
}

Github orqali yuklash

git clone https://github.com/khamdullaevuz/telegram-bot-php
cd telegram-bot-php

Ulanish

require_once __DIR__.'/src/loader.php';

use Framework\Config;
use Framework\Method;
use Framework\Plugin;
use Framework\Update;

Config::setApiToken("API_TOKEN");

$input = Update::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"){
	Method::sendMessage($chat_id, [
		'text'=>"Salom",
		'reply_markup'=>$keyboard
	]);
}

Ma'lumotlar bazasi bilan ishlash

Mavjud ma'lumotlar bazasi: mysqli, sqlite, pdo

use Framework\DataBase\SQLite;
$db = new SQLite("my.db");

Examples

Example: example

Created by: Elbek Khamdullaev