<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
californiamountainsnake / longmantelegrambot-inline-keyboard-selection example snippets
return [
'selected_value_prefix' => '☑ ',
'button_clear' => 'Reset',
'button_all' => 'All',
'button_ok' => 'OK',
'wrong_value_single' => 'Wrong value! Select one value from the keyboard.',
'wrong_value_multiple' => 'Wrong value! Select one or more values from the keyboard.',
'nothing_selected_error' => 'You select nothing! Select one or more values from the keyboard.',
];
class MyCommand extends \Longman\TelegramBot\Commands\Command {
use OneSelection;
public function execute(): ServerResponse
{
$isSelected = $this->oneSelection(
'my_one_selection_1',
[
'value1' => 'name1',
'value2' => 'name2',
],
'Please, select one value!',
$this->getMessage()->getText(),
true
);
if (!$isSelected) {
return $this->emptyResponse();
}
return $this->sendTextMessage (\print_r($this->getOneSelectionResult('my_one_selection_1'), true));
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.