Facebook Instant Game Bot消息通常会导致“此时无法向用户发送Instant Game消息". [英] Facebook Instant game bot message often results in "Cannot send Instant Game message to user at this time"

查看:159
本文介绍了Facebook Instant Game Bot消息通常会导致“此时无法向用户发送Instant Game消息".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个Facebook即时游戏,并且正在通过关联的bot向自己发送测试消息.

I'm making a Facebook instant game, and am sending myself test messages via the associated bot.

有效.但并非总是如此,为什么?

我经常得到这个:

{
    "error": {
        "message": "(#100) Cannot send Instant Game message to user at this time.",
        "type": "OAuthException",
        "code": 100,
        "error_subcode": 2018144,
        "fbtrace_id": "DNZhKZlP83D"
    }
}

此错误代码未在错误中未列出代码文档.

我想这可能是某些消息发送限制,但是我认为,作为该应用的列出的开发人员,我将不受任何限制.

I suppose it could be some message sending limit, but I would assume that as the listed developer of the app I would be exempt from any limits.

更多详细信息,以防它们相关

我已经订阅了Webhooks,并创建了一个与我的即时游戏应用程序相关的页面,并具有访问令牌.我要向其发送消息的用户是我,列为开发人员.

I have subscribed to the webhooks, and created a page associated with my instant game app and have the access token for it. The user I am trying to message is me, listed as the developer.

当我收到一个game_play事件,例如:

When I receive a game_play event such as:

{
    "object": "page",
    "entry": [{
        "id": "189899011738553",
        "time": 1521899151513,
        "messaging": [{
            "recipient": {
                "id": "189899011738553"
            },
            "timestamp": 1521899151513,
            "sender": {
                "id": "1647209385355472"
            },
            "game_play": {
                "game_id": "176650212970169",
                "player_id": "1293384810761815"
            }
        }]
    }]
}

我找到了发件人ID,并发送了这样的回复:

I find the sender ID, and send a response like so:

{
    "message": {
        "attachment": {
            "type": "template",
            "payload": {
                "template_type": "generic",
                "elements": [{
                    "buttons": [{
                        "type": "game_play",
                        "title": "Play"
                    }],
                    "title": "Hello World"
                }]
            }
        }
    },
    "recipient": {
        "id": "1647209385355472"
    }
}

这是cURL版本:

curl -X POST \
  'https://graph.facebook.com/me/messages?access_token=MY_ACCESS_TOKEN' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '{"message": {"attachment": {"type": "template", "payload": {"template_type": "generic", "elements": [{"buttons": [{"type": "game_play", "title": "HELLO"}], "title": "HELLO WORLD"}]}}}, "recipient": {"id": "1647209385355472"}}'

尽管显示了OAuthException,但只是为了表明访问令牌是有效的,并且确实确实可以正常工作:

And just to show the access token is valid, despite the "OAuthException", and that it does really sometimes work:

推荐答案

我们确保现在已记录此错误.

We've ensured that this error is now documented.

此消息表明,向Instant Game用户发送消息的消息数或时间窗口超出了Instant Games漫游器策略.

This message indicates that the number of messages or time window in which messages are sent to the user of an Instant Game exceeds the Instant Games bot policy.

这适用于开发人员和管理员以及该应用程序的用户.玩游戏或与机器人进行通信应重置这些限制.

This applies to developers and administrators as well as users of the app. Playing the game or communicating with the bot should reset these limits.

这篇关于Facebook Instant Game Bot消息通常会导致“此时无法向用户发送Instant Game消息".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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