Messenger Bot无法响应 [英] Messenger Bot Fails to Respond

查看:270
本文介绍了Messenger Bot无法响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的机器人已被批准并可公开使用(请参阅图片),但它不会回应除开发者之外的任何人。



我在Heroku上托管它。我试图用大量的控制台日志进行调试,并且我意识到当开发人员以外的任何人发送它时,它不记录输入App.Post(见下文)一个消息。



有没有人经历过这种行为?

  /// Facebook验证
app.get('/ webhook /',函数(req,res){
if(req.query ['hub.verify_token'] ==='******** *******'){
res.send(req.query ['hub.challenge'])
}
res.send('Error,wrong token')
$)

///加载服务器
app.listen(app.get('port'),function(){
console.log(' ('port'))
})

app.post('/ webhook /',function(req,res){
console .log(Enter App.Post);
messaging_events = req.body.entry [0] .messaging
for(i = 0; i< messaging_events.length; i ++){
...

更新:我找到了以下日志:

 错误:{message:'(#10)直到审核pages_messaging权限为止,才能向应用程序的管理员,开发人员或测试人员发送消息, ',
类型:'OAuthException',
代码:10,
fbtrace_id:'CVUDg ****'}


解决方案

你确定你的Facebook messenger bot已经被Facebook批准吗? b $ b

他们必须在管理员开发人员和测试人员可以使用它之前正式批准Messenger程序。



代码中没有任何内容会停止它从接收来自其他用户的消息,所以我猜你的机器人还没有真正被Facebook批准。



如果你想用一个除了你自己的用户,将他们添加为测试人员,他们将有权访问机器人,预批准。


My bot has been approved and is available publicly (see image), but it does not respond to anyone besides the developer.

I have it hosted on Heroku. I have tried to debug it with a ton of console logs, and I have realized that it doesn't log the "Enter App.Post" (see below) when any one other than the developer sends it a message.

Has anybody else experienced this behavior?

/// Facebook verification
app.get('/webhook/', function (req, res) {
    if (req.query['hub.verify_token'] === '***************') {
        res.send(req.query['hub.challenge'])
    }
    res.send('Error, wrong token')
})

/// Star up the server
app.listen(app.get('port'), function() {
    console.log('running on port', app.get('port'))
})

app.post('/webhook/', function (req, res) {
    console.log("Enter App.Post");
    messaging_events = req.body.entry[0].messaging
    for (i = 0; i < messaging_events.length; i++) {
        ....

Update: I found the following logs:

Error:  { message: '(#10) Cannot message users who are not admins, developers or testers of the app until pages_messaging permission is reviewed and the app is live.',
type: 'OAuthException',
code: 10,
fbtrace_id: 'CVUDg****' }

解决方案

Are you sure your Facebook messenger bot has been approved by Facebook?

They have to formally approve specifically the messenger bot before anyone besides admins developers and testers can use it.

There's nothing in the code provided that would stop it from receiving messages from other users, so I'm guessing your bot hasn't actually been approved by Facebook yet.

If you're trying to test it with a user besides yourself, add them as a tester and they will have access to the bot, pre-approval.

这篇关于Messenger Bot无法响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆