YaKotikTvoy

set.php

Jul 1st, 2023
40
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. <?php
  2. // Load composer
  3. require __DIR__ . '/vendor/autoload.php';
  4.  
  5. $bot_api_key = '5934156745:AAEJTHiEJlzzAE26D9LfUBSkIZr2xn6aHLU';
  6. $bot_username = 'Test_90923812_bot';
  7. $hook_url = 'https://artem.dev.647.su/core-develop/hook.php';
  8.  
  9. try {
  10. // Create Telegram API object
  11. $telegram = new Longman\TelegramBot\Telegram($bot_api_key, $bot_username);
  12.  
  13. // Set webhook
  14. $result = $telegram->setWebhook($hook_url);
  15. if ($result->isOk()) {
  16. echo $result->getDescription();
  17. }
  18. } catch (Longman\TelegramBot\Exception\TelegramException $e) {
  19. // log telegram errors
  20. echo $e->getMessage();
  21. }
Advertisement
Comments
Add Comment
Please, Sign In to add comment