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.

54 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. * Chosen inline result command
  13. *
  14. * Gets executed when an item from an inline query is selected.
  15. */
  16. namespace Longman\TelegramBot\Commands\SystemCommands;
  17. use Longman\TelegramBot\Commands\SystemCommand;
  18. use Longman\TelegramBot\Entities\ServerResponse;
  19. class ChoseninlineresultCommand extends SystemCommand
  20. {
  21. /**
  22. * @var string
  23. */
  24. protected $name = 'choseninlineresult';
  25. /**
  26. * @var string
  27. */
  28. protected $description = 'Handle the chosen inline result';
  29. /**
  30. * @var string
  31. */
  32. protected $version = '1.2.0';
  33. /**
  34. * Main command execution
  35. *
  36. * @return ServerResponse
  37. */
  38. public function execute(): ServerResponse
  39. {
  40. // Information about the chosen result is returned.
  41. $inline_query = $this->getChosenInlineResult();
  42. $query = $inline_query->getQuery();
  43. return parent::execute();
  44. }
  45. }