- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
function filterMenu(){
global $keyboard, $settings;
$filter_status_name = [ 1 => 'анонсировано', 2 => 'сейчас выходит', 3 => 'вышедшее' ];
$filter_order_name = [ 1 => 'по рейтингу', 2 => 'по популярности', 3 => 'по алфавиту', 3 => 'по дате выхода' ];
$filter_kind_name = [ 1 => 'TV Сериал', 2 => 'фильм' ];
if( $settings['filter']['menu'] == 0 OR !isset($settings['filter']['menu']) ){
keyboard( 'Включить фильтр ', 0, [ 't' => '3', 'm' => 1 ] );
}else{
keyboard( 'Выключить фильтр ', 0, [ 't' => '3', 'm' => 0 ] );
switch ($settings['filter']['menu']) {
case 1:
keyboard( 'Статус' . ((isset($settings['filter']['status']))?': '.$filter_status_name[$settings['filter']['status']]:''), 1, [ 't' => '3', 'm' => 2 ] );
keyboard( 'Сортировка' . ((isset($settings['filter']['order']))?': '.$filter_order_name[$settings['filter']['order']]:''), 1, [ 't' => '3', 'm' => 3 ] );
keyboard( 'Тип' . ((isset($settings['filter']['kind']))?': '.$filter_kind_name[$settings['filter']['kind']]:''), 2, [ 't' => '3', 'm' => 4 ] );
keyboard( 'Жанр', 2, [ 't' => '3', 'm' => 5 ] );
break;
case 2:
keyboard( 'Анонсировано', 11, [ 't' => '3', 'm' => 1, 'n' => 1, 's' => 1 ] );
keyboard( 'Сейчас выходит', 11, [ 't' => '3', 'm' => 1, 'n' => 1, 's' => 2 ] );
keyboard( 'Вышло', 12, [ 't' => '3', 'n' => 1, 's' => 3 ] );
keyboard( 'Не важно', 90, [ 't' => '3', 'm' => 1, 'n' => 1, 's' => 0 ] );
break;
case 3:
keyboard( 'По рейтингу', 11, [ 't' => '3', 'm' => 1, 'n' => 2, 's' => 1 ] );
keyboard( 'По популярности', 11, [ 't' => '3', 'm' => 1, 'n' => 2, 's' => 2 ] );
keyboard( 'По алфавиту', 12, [ 't' => '3', 'm' => 1, 'n' => 2, 's' => 3 ] );
keyboard( 'По дате выхода', 12, [ 't' => '3', 'm' => 1, 'n' => 2, 's' => 4 ] );
break;
case 4:
keyboard( 'TV Сериал', 11, [ 't' => '3', 'm' => 1, 'n' => 3, 's' => 1 ] );
keyboard( 'Фильм', 11, [ 't' => '3', 'm' => 1, 'n' => 3, 's' => 2 ] );
keyboard( 'Не важно', 90, [ 't' => '3', 'm' => 1, 'n' => 3, 's' => 0 ] );
break;
}
}
$keyboard['inline_keyboard'] = array_values($keyboard['inline_keyboard']);
}
if( isset( $input['message'] ) ){
//sendMethod ( 'sendMessage', ['chat_id' => 66478514, 'text' => json_encode($input), 'parse_mode' => 'HTML'] );
if( $input['message']['chat']['type'] == 'private' ){
if( $chat_id == 166478514 ){
$horney = json_decode( file_get_contents("horney.json" ), true );
foreach ($horney['questions'] as $quest => $answer) {
$atext = explode(" ", $text);
$aquest = explode(" ", $quest);
$result = array_diff($atext, $aquest);
if( count($result) > 0 ) sendMethod ( 'sendMessage', ['chat_id' => 66478514, 'text' => $quest, 'parse_mode' => 'HTML'] );
}
}
if( stripos($text, 'start') == 1 ){
$start = explode(' ', $text )[1];
if( isset($start) ){
$parm = explode('_', $start );
if( $parm[0] == 'a' ){
$id = $parm[1];
goto getAnime; // пиздец