'open web', 'url'=>'https://google.com'], ], [ ['text'=>'yes', 'callback_data'=>'yes'], ['text'=>'no', 'callback_data'=>'no'] ] ]; $inline_kb_option = [ 'inline_keyboard'=>$inline_keyboard ]; switch ($text){ case "/start" : show_menu(); break; } function show_menu(){ $json_keyboard = json_encode($GLOBALS['inline_kb_option']); $reply = "Hi Boss, Welcome.\nChoose an Option:"; $url = $GLOBALS['bot_url']."/sendMessage"; $post_params = [ 'chat_id'=>$GLOBALS['chat_id'], 'text'=>$reply, 'reply_markup'=>$json_keyboard ]; sendReply($url, $post_params); } function send_message($msg = "test message"){ $url = $GLOBALS['bot_url']."/sendMessage"; $post_params = [ 'chat_id'=>$GLOBALS['chat_id'], 'text'=>$msg ]; sendReply($url, $post_params); } function send_photo(){ $url = $GLOBALS['bot_url']."/sendPhoto"; $post_params = [ 'chat_id'=>$GLOBALS['chat_id'], 'photo'=>new CURLFILE(realpath('2024-07-18 (2).png')), 'caption'=>'huhk', ]; sendReply($url, $post_params); } function send_video(){ $url = $GLOBALS['bot_url']."/sendVideo"; $post_params = [ 'chat_id'=>$GLOBALS['chat_id'], 'video'=>new CURLFILE(realpath('2025-06-07 03-35-25.mkv')), 'caption'=>'tffht', ]; sendReply($url, $post_params); } function send_music(){ $url = $GLOBALS['bot_url']."/sendAudio"; $post_params = [ 'chat_id'=>$GLOBALS['chat_id'], 'audio'=>new CURLFILE(realpath('naruto_shippuden_loneliness_trap_remix.mp3')), 'caption'=>'https://t.me/the_revenantsbot', 'title'=>'Loneliness', 'performer'=>'Naruto Shippuden' ]; sendReply($url, $post_params); } function send_location(){ $url = $GLOBALS['bot_url']."/sendLocation"; $post_params = [ 'chat_id'=>$GLOBALS['chat_id'], 'latitude'=>35.730199, 'longitude'=>51.3555777, ]; sendReply($url, $post_params); } function send_file(){ $url = $GLOBALS['bot_url']."/sendDocument"; $post_params = [ 'chat_id'=>$GLOBALS['chat_id'], 'document'=>new CURLFILE(realpath('download.jfif')), 'caption'=>'ssg', ]; sendReply($url, $post_params); } function send_contact(){ $url = $GLOBALS['bot_url']."/sendContact"; $post_params = [ 'chat_id'=>$GLOBALS['chat_id'], 'phone_number'=>989336889861, 'first_name'=>'Iman', 'last_name'=>'Malekan' ]; sendReply($url, $post_params); } function callbackReply(){ //answers with text $callback_data = $GLOBALS['data']; if($callback_data == 'yes'){ send_message("yes clicked"); } elseif($callback_data == 'no'){ send_message("no clicked"); } } function callback_query_notification($cqn){ //answers with notification $url = $GLOBALS['bot_url']."/answerCallbackQuery"; $post_params = [ 'callback_query_id'=>$GLOBALS['callback_query_id'], 'text'=>'Your Response: '.$cqn, 'show_alert'=>true, ]; sendReply($url, $post_params); } ?>