api.ai ve Heroku kullanarak Facebook messenger chatbot OAuth İstisna (node.js)

oy
1

Benim kod ve aşağıda attı hatayı paylaştı. Temelde, öğretici takip http://www.girliemac.com/blog/2017/01/06/facebook-apiai-bot-nodejs/ ve bir tane daha. Benim chatbot Smalltalk için değil hava API şeyler için çalışır. Ben Chatbot bana farklı şehirlerde hava durumu hakkında cevap vermek yapmaya çalışıyorum. Ben tam öğretici izlemiştir.

  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' }

// sadece hava API şeyler için index.js kod

 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
          }
        });
      }
    })
  }

});

Nasıl bu hatayı düzeltebilirim?

Oluştur 23/09/2017 saat 05:00
kaynak kullanıcı
Diğer dillerde...                            


1 cevaplar

oy
1

İçinde mesajla gönderiyor sayfa kapsamlı kimliği nedeniyle hatadır recipient.idgeçerli değildir. Varsayarsak kurdunuz sendMessage()büyük olasılıkla sorun Facebook'ta Uygun role sahip değil bot ile sohbet kullandığınız hesap yani corrently öğreticisindeki işlevini.

bot (yani sunulan ve onaylanmamıştır) Kamu değilse bot mesaj göndermek için kullandığınız Facebook hesabı uygulama ayarlarınızda yönetici, geliştirici veya test rol verilmelidir.

Cevap 26/09/2017 saat 04:25
kaynak kullanıcı

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