फेसबुक दूत chatbot में OAuth अपवाद api.ai और Heroku का उपयोग कर (Node.js)

वोट
1

मैं अपने कोड और त्रुटि है कि नीचे से ऊपर पॉप साझा किया है। असल में, मैं ट्यूटोरियल का पालन किया http://www.girliemac.com/blog/2017/01/06/facebook-apiai-bot-nodejs/ और एक दूसरे से। मेरे chatbot smalltalk के लिए लेकिन मौसम एपीआई सामान के लिए नहीं काम करता है। मैं बनाने के लिए chatbot मुझे विभिन्न शहरों में मौसम के बारे में जवाब देने की कोशिश कर रहा हूँ। मैं ट्यूटोरियल वास्तव में पालन किया है।

  Error:  { message: '(#100) No matching user found',
  type: 'OAuthException',
   code: 100,
  error_subcode: 2018001,
   fbtrace_id: 'DeubaTWU6Gg' }
 Error:  { message: '(#100) No matching user found',
   type: 'OAuthException',
   code: 100,
   error_subcode: 2018001,
   fbtrace_id: 'FSiMes3IwHv' }

// सिर्फ मौसम एपीआई सामान के लिए index.js से कोड

 app.post('/ai', (req, res) => {
  //console.log('*** Webhook for api.ai query ***');
  //console.log(req.body.result);

  if (req.body.result.action === 'weather') {
 //  console.log('*** weather ***');
    let city = req.body.result.parameters['geo-city'];
    let restUrl = 'http://api.openweathermap.org/data/2.5/weather?APPID='+process.env.WEATHER_API_KEY+'&q='+city;

    request.get(restUrl, (err, response, body) => {
      if (!err && response.statusCode == 200) {
        let json = JSON.parse(body);
       // console.log(json);
        let tempF = ~~(json.main.temp * 9/5 - 459.67);
        let tempC = ~~(json.main.temp - 273.15);
        let msg = 'The current condition in ' + json.name + ' is ' + json.weather[0].description + ' and the temperature is ' + tempF + ' ℉ (' +tempC+ ' ℃).'
        return res.json({
          speech: msg,
          displayText: msg,
          source: 'weather'
        });
      } else {
        let errorMessage = 'I failed to look up the city name.';
        return res.status(400).json({
          status: {
            code: 400,
            errorType: errorMessage
          }
        });
      }
    })
  }

});

मैं यह त्रुटि कैसे ठीक करूं?

23/09/2017 को 05:00
का स्रोत उपयोगकर्ता
अन्य भाषाओं में...                            


1 जवाब

वोट
1

क्योंकि पेज-दायरे वाले आईडी आप में संदेश के साथ भेज रहे हैं त्रुटि है recipient.idमान्य नहीं है। आप यह सोचते हैं की स्थापना की है sendMessage()corrently ट्यूटोरियल से समारोह, सबसे अधिक संभावना समस्या फेसबुक खाता है, जो बॉट के साथ चैट का उपयोग कर रहे उचित भूमिका नहीं है।

बॉट सार्वजनिक नहीं है, तो (यानी प्रस्तुत नहीं किया गया है और मंजूरी दे दी) आप बॉट के लिए संदेश भेजने के लिए उपयोग कर रहे हैं फेसबुक खाता व्यवस्थापक, डेवलपर, या परीक्षक अपनी ऐप सेटिंग में भूमिका दी जानी है।

26/09/2017 को 04:25
का स्रोत उपयोगकर्ता

Cookies help us deliver our services. By using our services, you agree to our use of cookies. Learn more