Skip to content

Telegram da Bot yasash uchun qulay php plugin bunda siz ixtiyoriy turdagi botlarni yasashingiz mumkin

License

Notifications You must be signed in to change notification settings

mrrashidov/Telegram-PHP-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram-PHP-API

API PHP CURL

Telegram-API-PHP bu telegram messenjerida oson bot uchish uchun yozilgan open source code. Bu orqali siz istalgancha o'zingizga telegram botlari ochishingiz mumkin va juda oson.

Yuklab olish


Github orqali

Loyiha katalogidan ishga tushiring:

https://github.com/shoxruxrashidov/Telegram-API-PHP.git

Github orqali 2

Download tugmachasiga bosing va yuklab oling

Pluginni ornatish


TelegramBot.php-ni serveringizga nusxalash va uni yangi bot skriptingizga qo'shish kerak bo'ladi:

include 'Telegram.php';

$telegram = new TelegramBot();
$telegram->setToken('Sizning tokeningiz');

Konfiguratsiya (WebHook)

Eslatma: Webhook faqat bir maratta connect qilinadi.

echo $telegram->setWebhook('saytingiz manzili');

Namuna

 
    require_once 'TelegramBot.php';
  
    $telegram = new TelegramBot();
    $telegram->setToken('sizning token');
    $data = $telegram->getData();

Avto javob berish


    if ($data->text == 'salom'){
        $telegram->sendMessage('Salom Qalesiz?');
    }

Fotosurat yuborish


 if ($data->text == 'rasim yubor' || $data->text == 'rasim jonat'){
        $telegram->sendPhoto('https://www.fotor.com/ru/loopBannerImg/ru-homeloop2.jpg','senga rasim kerakmi ol ana bolmasa');
    }

Menyu bilan xabar yuborish


 if ($data->text == 'menu' || $data->text == 'default-menu'){
        $menu = $this->bot->buildKeyBoard([['🏠 Bosh Saxifa']], $onetime = false, true);
        $telegram->sendMessage('Test Menu',$menu);
    }

About

Telegram da Bot yasash uchun qulay php plugin bunda siz ixtiyoriy turdagi botlarni yasashingiz mumkin

Topics

Resources

License

Stars

Watchers

Forks

Languages