Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @param CallbackQuery $query
- * @param Telegram $telegram
- * @param Update $update
- * @return \Longman\TelegramBot\Entities\ServerResponse
- * @throws \Longman\TelegramBot\Exception\TelegramException
- */
- public function newOrder(CallbackQuery $query, Telegram $telegram, Update $update) {
- $callback_data = $query->getData();
- if (strpos($callback_data, 'newOrder_') !== 0) {
- return Request::emptyResponse();
- }
- $current = substr($callback_data, strlen('newOrder_')); // ID of service
- $update['message']['text'] = $current;
- $result = (new NeworderCommand($telegram, $update))->preExecute();
- return $result;
- }
- /**
- * SURVEY COMMAND
- */
- /**//**//**//**//**//**//**//**//**//**//**//**//**//**//**//**//**//**//**//**//**//**//**/
- switch ($state) {
- case 0:
- if ($text === '' || ($this->getCallbackQuery() !== null && $text !== '') || !is_numeric($text) || self::searchOrder($text) == false) {
- $notes['state'] = 0;
- $this->conversation->update();
- $data['text'] = 'Write service ID';
- if ($text !== '')
- $data['text'] = 'Please, write service ID';
- $result = Request::sendMessage($data);
- break;
- }
- $notes['service_id'] = $text;
- $service = self::searchService($notes['order_id']);
- $text = '';
- case 1:
- ...
- case 2:
- ...
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement