Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Load composer
- require __DIR__ . '/vendor/autoload.php';
- $bot_api_key = '5934156745:AAEJTHiEJlzzAE26D9LfUBSkIZr2xn6aHLU';
- $bot_username = 'Test_90923812_bot';
- $hook_url = 'https://artem.dev.647.su/core-develop/hook.php';
- try {
- // Create Telegram API object
- $telegram = new Longman\TelegramBot\Telegram($bot_api_key, $bot_username);
- // Set webhook
- $result = $telegram->setWebhook($hook_url);
- if ($result->isOk()) {
- echo $result->getDescription();
- }
- } catch (Longman\TelegramBot\Exception\TelegramException $e) {
- // log telegram errors
- echo $e->getMessage();
- }
Advertisement
Comments
-
- Постоянно выходит ошибка: Telegram returned an invalid response!
Add Comment
Please, Sign In to add comment