facebook-messenger-bot error: When & why this error raised "(#100) Length of param name_placeholder[text] must be less than or equal to 640"

facebook-messenger-bot error: When & why this error raised "(#100) Length of param name_placeholder[text] must be less than or equal to 640"

我有一个 Django 应用程序连接到 Facebook 页面的 Messenger。当任何 Facebook 用户向 Facebook 页面发送消息时,我的应用程序会在解析 Facebook 用户的消息后尝试自动响应。如果从我的 Django 应用程序发送消息期间发生任何错误,我将错误文本存储在 table 的列中。当我试图分析发送消息时产生的错误时,我发现一个错误文本如下

"(#100) Length of param name_placeholder[text] must be less than or equal to 640"

而且我无法重新生成它。

还有一个类似的错误"(#100) Length of param message[text] must be less than or equal to 2000",写的很清楚,可以重新生成

我在 Google 上搜索过,没有找到任何可以帮助我的东西。

我只想知道错误发生的时间和原因,以便我可以修改我的应用程序来处理它。

我使用以下 api 向 Facebook 用户发送消息 https://graph.facebook.com/v2.6/me/messages?access_token=PAGE_ACCESS_TOKEN 使用此 header 参数
{'content-type': 'application/json'}
这个数据

{
    "messaging_type": "RESPONSE",
    "recipient": {
        "id": "receiver_id"
    },
    "message": {
        "text": "message_text"
    }
}

注意:我知道 Facebook 提供了错误代码、类型、error_subcode 和其他信息,但不幸的是只有错误消息存储在 table 中。所以我没有错误的代码和子代码。

如果您想发送 Button Template,则文本的限制为 640 个字符。可能是您的文本太长,这就是您收到此错误消息的原因。

参见 message.attachment.payload > text最多 640 个字符的 UTF-8 编码文本。文本将出现在按钮上方。

如果您只发送一个普通的 text message over the Send API,那么这将有 2000 个字符的限制。