PHP code example of usermp / telebot

1. Go to this page and download the library: Download usermp/telebot 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/ */

    

usermp / telebot example snippets


use Telebot\Telebot;
$token = 'YOUR_TELEGRAM_BOT_TOKEN';
$telebot = new Telebot($token);

$webhookUrl = 'YOUR_WEBHOOK_URL'; 
$response   = $telebot->setWebhook($webhookUrl);

$chatId   = 'CHAT_ID'; 
$text     = 'Hello, world!'; 
$response = $telebot->sendMessage($chatId, $text);

$updates = $telebot->getUpdates();