1. Go to this page and download the library: Download tahrz/simple-telegram-bot 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/ */
// create instance of ConnectionService
$connectionService = new ConnectionService();
// make connection without answer
$connectionService->init('<API_METHOD_NAME>');
// make connection with array answer type
$arrayResult = $connectionService->withArrayResponse('<API_METHOD_NAME>');
// make connection with object anaswer type
$objectResult = $connectionService->withObjectResponse('<API_METHOD_NAME>');
// create instance of WebhookConfigurationHelper
$webhookConfigurationHelper = new WebhookConfigurationHelper($connectionService);
// get webhook info
$setWebhook = $webhookConfigurationHelper->getWebhookInfo();
// set new webhook
$getWebhook = $webhookConfigurationHelper->setWebhook();
// remove webhook
$removeWebhook = $webhookConfigurationHelper->removeWebhook();
// create instance of WebhookGetUpdateHelper
$webhookUpdateHelper = new WebhookGetUpdateHelper();
// create instance of GetUpdateHelper
$getUpdateHelper = new GetUpdateHelper($connectionService);
// work only if you add webhook
$updatesWithWebhookAsArray = $webhookUpdateHelper->asArray();
$updatesWithWebhookAsObject = $webhookUpdateHelper->asObject();
// work only without webhook
$updatesWithoutWebhook = $getUpdateHelper->asArray();
$updatesWithoutWebhook = $getUpdateHelper->asObject();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.