{"TITLE":"Radio","DESCRIPTION":"Radio Callback","TYPE_EVENT":"9","ENABLE":"1","CODE":"if (strripos($callback, 'Radio') > -1) {\r\n\t$confirm_emoji = \thex2bin('E29C85');\r\n\t$cross_emoji =  \thex2bin('E29D8C');\r\n\t$refresh_emoji =\thex2bin('E299BB');\r\n\t$radio_emoji= \t\thex2bin('F09F93BB');\r\n\t$radioLast_emoji= \thex2bin('E2AD90');\r\n\t$sound_emoji= \t\thex2bin('F09F948A');\r\n\t$script_emoji = \thex2bin('F09F9384');\r\n\r\n\tswitch (explode('*', $callback)[1]) {\r\n\t    case \"Off\":\r\n    \t\tcm('RadioSetting.Control', array('cmd'=>'stop'));\r\n    \t\t$this->sendAnswerCallbackQuery($callback_id,$cross_emoji.\"\u0420\u0430\u0434\u0438\u043e \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u043e\", false);\r\n    \t\t$skip = true;\r\n\t        break;\r\n    \t\t$skip = true;\r\n\t        break;\r\n    \tcase \"Show\":\r\n    \t\t$this->sendAction($chat_id,\"typing\");\r\n\t\t\t$rec = SQLSelect(\"SELECT * FROM app_radio;\");\r\n\t\t\t$total = count($rec);\r\n\t\t\tfor($i = 0; $i < $total; $i++) {\r\n\t\t\t    $option[] = $this->buildInlineKeyboardButton($text = $radio_emoji.$rec[$i][\"name\"],\"\",\"Radio*\".$rec[$i][\"name\"],\"\");\r\n\t\t\t}\r\n\t\t\t$option[] = $this->buildInlineKeyboardButton($text = $cross_emoji.\"\u0412\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c\", \"\", \"Radio*Off\");\r\n    \t\t$option[] = $this->buildInlineKeyboardButton($text = $radioLast_emoji.\"\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f\", \"\", \"Radio*\".gg('RadioSetting.LastStationName'));\r\n    \t\t$option[] = $this->buildInlineKeyboardButton($text = $sound_emoji.\"\u0413\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u044c\", \"\", \"Radio*Value\");\r\n    \t\t$option[] = $this->buildInlineKeyboardButton($text = $refresh_emoji.\"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\", \"\", \"Radio*Refresh\");\r\n    \t\t$option[] = $this->buildInlineKeyboardButton($text = $script_emoji.\"\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f\", \"\", \"Scripts*Show\");\r\n\t\t\t$count_row = 3;\r\n\t\t\t$keyb = $this->buildInlineKeyBoard(array_chunk($option, $count_row));\r\n\t\t\t$this->sendContent(array('chat_id' => $chat_id, 'text' => \"\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0434\u0438\u043e:\", 'reply_markup' => $keyb));\r\n    \t\t$this->sendAnswerCallbackQuery($callback_id, $confirm_emoji.\"\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e\", false);\r\n    \t\t$skip = true;\r\n    \t\tbreak;\r\n\t    case \"Refresh\":\r\n    \t\t$rec = SQLSelect(\"SELECT * FROM app_radio;\");\r\n\t\t\t$total = count($rec);\r\n\t\t\tfor($i = 0; $i < $total; $i++) {\r\n\t\t\t    $option[] = $this->buildInlineKeyboardButton($text = $radio_emoji.$rec[$i][\"name\"],\"\",\"Radio*\".$rec[$i][\"name\"],\"\");\r\n\t\t\t}\r\n\t\t\t$option[] = $this->buildInlineKeyboardButton($text = $cross_emoji.\"\u0412\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c\", \"\", \"Radio*Off\");\r\n    \t\t$option[] = $this->buildInlineKeyboardButton($text = $radioLast_emoji.\"\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f\", \"\", \"Radio*\".gg('RadioSetting.LastStationName'));\r\n    \t\t$option[] = $this->buildInlineKeyboardButton($text = $sound_emoji.\"\u0413\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u044c\", \"\", \"Radio*Value\");\r\n    \t\t$option[] = $this->buildInlineKeyboardButton($text = $refresh_emoji.\"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\", \"\", \"Radio*Refresh\");\r\n    \t\t$option[] = $this->buildInlineKeyboardButton($text = $script_emoji.\"\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f\", \"\", \"Scripts*Show\");\r\n\t\t\t$count_row = 3;\r\n\t\t\t$keyb = $this->buildInlineKeyBoard(array_chunk($option, $count_row));\r\n\t\t\t$this->editMessage($chat_id, $message_id, \"\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0434\u0438\u043e:\", $keyb);\r\n    \t\t$this->sendAnswerCallbackQuery($callback_id, $confirm_emoji.\"\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e\", false);\r\n    \t\t$skip = true;\r\n\t        break;\r\n    \tcase \"Value\":\r\n    \t\tif (explode('*', $callback)[2] != \"\") {\r\n            \tcm('RadioSetting.Control', array('vol'.explode('*', $callback)[2]));\r\n            \t$this->sendAnswerCallbackQuery($callback_id, $confirm_emoji.\"\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e\", false);\r\n            \t$skip = true;\r\n            \tbreak;\r\n            }\r\n    \t\tfor($i = 10; $i <= 100; $i=$i+10) {\r\n\t\t\t    $option[] = $this->buildInlineKeyboardButton($text = $sound_emoji.$i,\"\",\"Radio*Value*\".$i,\"\");\r\n\t\t\t}\r\n\t\t\t$option[] = $this->buildInlineKeyboardButton($text = $radio_emoji.\"\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f\", \"\", \"Scripts*Show\");\r\n    \t\t$keyb = $this->buildInlineKeyBoard(array_chunk($option, 4));\r\n\t\t\t$this->sendContent(array('chat_id' => $chat_id, 'text' => \"\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0432\u0443\u043a\u043e\u043c \u0440\u0430\u0434\u0438\u043e:\", 'reply_markup' => $keyb));\r\n    \t\t$skip = true;\r\n    \t\tbreak;\r\n\t    default:\r\n    \t\t$radio = explode('*', $callback)[1];\r\n        \tcm('RadioSetting.Control',array('sta'=>$radio,'cmd'=>'play')); \r\n    \t\t$rec = SQLSelect(\"SELECT * FROM app_radio;\");\r\n\t\t\t$total = count($rec);\r\n\t\t\tfor($i = 0; $i < $total; $i++) {\r\n\t\t\t    $option[] = $this->buildInlineKeyboardButton($text = $radio_emoji.$rec[$i][\"name\"],\"\",\"Radio*\".$rec[$i][\"name\"],\"\");\r\n\t\t\t}\r\n\t\t\t$option[] = $this->buildInlineKeyboardButton($text = $cross_emoji.\"\u0412\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c\", \"\", \"Radio*Off\");\r\n    \t\t$option[] = $this->buildInlineKeyboardButton($text = $radioLast_emoji.\"\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f\", \"\", \"Radio*\".gg('RadioSetting.LastStationName'));\r\n    \t\t$option[] = $this->buildInlineKeyboardButton($text = $sound_emoji.\"\u0413\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u044c\", \"\", \"Radio*Value\");\r\n    \t\t$option[] = $this->buildInlineKeyboardButton($text = $refresh_emoji.\"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\", \"\", \"Radio*Refresh\");\r\n    \t\t$option[] = $this->buildInlineKeyboardButton($text = $script_emoji.\"\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f\", \"\", \"Scripts*Show\");\r\n\t\t\t$count_row = 3;\r\n\t\t\t$keyb = $this->buildInlineKeyBoard(array_chunk($option, $count_row));\r\n\t\t\t$this->editMessage($chat_id, $message_id, \"\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0434\u0438\u043e:\", $keyb);\r\n     \t\t$this->sendAnswerCallbackQuery($callback_id,$confirm_emoji.\"\u0420\u0430\u0434\u0438\u043e \".$radio.\" \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043e\", false);\r\n    \t\t$skip = true;\r\n\t        break;\r\n\t}\r\n}"}