Facebook Messenger API机器人:“打字泡沫" "指标泡沫"

Facebook Messenger API机器人:“打字泡沫

问题描述:

我创建了一个Messenger机器人,而我执行的某些操作可能需要一些时间.因此,为了使用户等待,我想在屏幕上显示指示器气泡". (当您与之交谈的人打字时,您会看到的那个人):

I've created a messenger bot, and some action that I perform can take some time. So in order to make the user wait I would like to display the "Indicator Bubble" (the one you see when the people you talk with are typing):

Messenger API文档中未定义如何执行该操作,但是当您按"callBack"时,他们似乎有可能执行该操作.在他们的卡上.

It is not defined in the Messenger API documentation how to do it, but it seems possible has they perform it when you hit "callBack" on their card.

我该如何模拟呢?

现在可以通过发件人操作"将其添加到Messenger bot API中.您可以在此处找到文档.

It's now available into the messenger bot API via the Sender Action. You can find the documentation here.

这只是一个具有开/关值的帖子,用于显示/隐藏气泡指示器.

It's just a post with an on or off value to display / hide the bubble indicator.

{
    "recipient":{
          "id":"USER_ID"
    },
    "sender_action":"typing_on" // typing_off
}