使用Facebook帖子评论作为Messenger bot入口点

时间:2017-05-09 19:09:39

标签: facebook facebook-messenger

我看到Facebook营销人员使用典型的Facebook帖子,在那里他问了一个问题,例如"你认为X在营销或Y方面更有效吗?在评论中添加您的答案,我会给您正确的答案。"

在添加评论后,您立即收到了一条带有正确答案的Facebook Messenger消息,他用这个消息开始了#34;对话"我每天都会收到他的定期更新,直到我写回STOP。

我一直在搜索Facebook Messenger API文档,并且无法弄清楚如何在Facebook(而非Messenger)上使用此类交互作为Messenger机器人对话的切入点。

我知道Facebook有触发对话的广告,但这并不是这种互动的方式。

2 个答案:

答案 0 :(得分:4)

我知道有点晚了。这就是我过去回复评论的内容。 https://developers.facebook.com/docs/graph-api/reference/v2.12/object/private_replies

    tell application "Mail"
        activate

        set newMessage to make new outgoing message ¬
            with properties ¬
            {visible:true, subject:"[NOTES] "}

        make new cc recipient at newMessage ¬
            with properties ¬
            {address:"EmailAddress"}
    end tell


    tell application "System Events"
        tell ¬
            process "Mail" to tell ¬
            window 1 to tell ¬
            scroll area 1 to tell ¬
            UI element 1 to set focused to true

        keystroke "v" using command down
        keystroke return
    end tell

但您需要先执行此操作:https://developers.facebook.com/docs/graph-api/webhooks/以便您可以订阅用户对帖子发表评论的事件。

编辑:截至2018年,如果您的应用处于开发模式,则不会再在您的webhook中收到“Feed”事件。要解决此问题,只需使用Webhooks仪表板进行测试,并在webhook端点中使用硬编码数据或其他内容更改事件。

答案 1 :(得分:0)

您可以使用第三方软件或通过Facebook的图形API构建它。这是我发现的唯一一篇提供更多信息的文章(只是过滤了博客/销售的废话,并且有一些好的信息从页面开始大约40%)

https://chatbottutorial.com/fb-post-autoreply/

相关问题