How to Get Answer From command /survey ?
hi, can you please give an example , how to make the results from command /survey sent to the admin bot ?
I assume you're saving all data to the $notes variable?
After the last stage, when the survey command is finished, you can simply send whatever data from $notes that you like to to the admin user.
Have a look at how this is done in the example: https://github.com/php-telegram-bot/example-bot/blob/cbaec2e66519da9bc01b7ca97e4b0c9666d7bb84/Commands/SurveyCommand.php#L241
Like this sir ? make two result ? $this->conversation->update(); $out_text = '/Survey result:' . PHP_EOL; unset($notes['state']); foreach ($notes as $k => $v) { $out_text .= PHP_EOL . ucfirst($k) . ': ' . $v; }
$data['photo'] = $notes['photo_id'];
$data['reply_markup'] = Keyboard::remove(['selective' => true]);
$data['caption'] = $out_text;
$this->conversation->stop();
$result = Request::sendPhoto($data);
$result = Request::sendPhoto([
'chat_id' => '$admin_user',
'photo' => $data,
]);
break;