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.

42 lines
1.2 KiB

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 configuration file is used as the main script for the PHP Telegram Bot Manager.
  13. *
  14. * For the full list of options, go to:
  15. * https://github.com/php-telegram-bot/telegram-bot-manager#set-extra-bot-parameters
  16. */
  17. // Load composer
  18. require_once __DIR__ . '/vendor/autoload.php';
  19. // Load all configuration options
  20. /** @var array $config */
  21. $config = require __DIR__ . '/config.php';
  22. try {
  23. $bot = new TelegramBot\TelegramBotManager\BotManager($config);
  24. // Run the bot!
  25. $bot->run();
  26. } catch (Longman\TelegramBot\Exception\TelegramException $e) {
  27. // Log telegram errors
  28. Longman\TelegramBot\TelegramLog::error($e);
  29. // Uncomment this to output any errors (ONLY FOR DEVELOPMENT!)
  30. // echo $e;
  31. } catch (Longman\TelegramBot\Exception\TelegramLogException $e) {
  32. // Uncomment this to output log initialisation errors (ONLY FOR DEVELOPMENT!)
  33. // echo $e;
  34. }