You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
867 B

1 year ago
  1. <?php
  2. /**
  3. * This file is part of the PHP Telegram Bot example-bot package.
  4. * https://github.com/php-telegram-bot/example-bot/
  5. *
  6. * (c) PHP Telegram Bot Team
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. /**
  12. * This file is used to unset / delete the webhook.
  13. */
  14. // Load composer
  15. require_once __DIR__ . '/vendor/autoload.php';
  16. // Load all configuration options
  17. /** @var array $config */
  18. $config = require __DIR__ . '/config.php';
  19. try {
  20. // Create Telegram API object
  21. $telegram = new Longman\TelegramBot\Telegram($config['api_key'], $config['bot_username']);
  22. // Unset / delete the webhook
  23. $result = $telegram->deleteWebhook();
  24. echo $result->getDescription();
  25. } catch (Longman\TelegramBot\Exception\TelegramException $e) {
  26. echo $e->getMessage();
  27. }