res){ let data = req.body; let queryMovieName = data.queryResult.parameters.MovieName; let propertiesObject = { query:queryMovieName, api_key:MOVIE_API_KEY, language:'zh-TW' }; request({ uri:"https://api.themoviedb.org/3/search/movie?", json:true, qs:propertiesObject },function(error, response, body){ if(!error && response.statusCode == 200){ if(body.results.length!=0){ let thisFulfillmentMessages = []; let movieTitleObject = {}; if(body.results[0].title == queryMovieName){ movieTitleObject.text = {text:[body.results[0].title]}; }else{ movieTitleObject.text = {text:["系統內最相關的電影是"+body.results[0].title]}; } thisFulfillmentMessages.push(movieTitleObject);