'open web', 'url'=>'https://google.com'], ], [ ['text'=>'yes', 'callback_data'=>'yes'], ['text'=>'no', 'callback_data'=>'no'] ] ]; $inline_kb_option = [ 'inline_keyboard'=>$inline_keyboard ]; $keyboard_result = show_menu(); $result_arrey = json_decode($keyboard_result); $message_id = $result_arrey['result']['message_id']; change_glass_keyboard(); 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 ]; return sendReply($url, $post_params); } function send_message($msg = "test message"){ $url = $GLOBALS['bot_url']."/sendMessage"; $post_params = [ 'chat_id'=>$GLOBALS['chat_id'], 'text'=>$msg ]; return sendReply($url, $post_params); } function change_glass_keyboard(){ sleep(5); $new_inline_keyboard = [ [ ['text'=>'digikala', 'url'=>'https://digikala.com'],['text'=>'aparat', 'url'=>'https://aparat.com'], ], ]; $new_inline_kb_option = [ 'inline_keyboard'=>$new_inline_keyboard, ]; $new_json_keyboard = json_encode($new_inline_kb_option); $new_reply = "Hi Boss, Welcome.\nChoose an Option:"; $new_url = $GLOBALS['bot_url']."/editMessageReplyMarkup"; $new_post_params = [ 'chat_id'=>$GLOBALS['chat_id'], 'message_id'=>$GLOBALS['message_id'], 'reply_markup'=>$new_json_keyboard, ]; return sendReply($new_url, $new_post_params); } ?>