简体   繁体   English

如何使用测试用户和测试页面测试 facebook 聊天机器人

[英]How to test facebook chatbot with test user and test page

I have a chatbot that I want to test with test users on Facebook.我有一个聊天机器人,我想在 Facebook 上与测试用户一起测试。

I have created a test app from the main app, per Facebook's recommendations.根据 Facebook 的建议,我从主应用创建了一个测试应用。 And in that I have created test users.并且我已经创建了测试用户。 Those account work and I can log into them.这些帐户有效,我可以登录它们。

To test a chatbot, you need to have a page that it's enabled on.要测试聊天机器人,您需要有一个启用它的页面。 So I have created a page in the test user account.所以我在测试用户帐户中创建了一个页面。

I can even see that chatbot app, correctly named, in the "Business Integrations" menu option.我什至可以在“业务集成”菜单选项中看到正确命名的聊天机器人应用程序。

I can also message the page from the test user account.我还可以从测试用户帐户向页面发送消息。 However, those messages are never sent to the chatbot.但是,这些消息永远不会发送到聊天机器人。 There is zero traffic.流量为零。

Using my real account, I can create a test page and link it to the very same test app for the chatbot and it works just fine.使用我的真实帐户,我可以创建一个测试页面并将其链接到聊天机器人的相同测试应用程序,它工作得很好。 I can message that test page and the chatbot receives the message and processes it.我可以向该测试页面发送消息,然后聊天机器人接收消息并进行处理。

The difference is that on the app page, the "real world" test page shows up because I own it, so I can add it to the chatbot app.不同的是,在应用程序页面上,“真实世界”测试页面出现,因为我拥有它,所以我可以将它添加到聊天机器人应用程序中。 However as the test user is a separate user, the test user page doesn't show up in the options to add a page, only the pages that I own.但是,由于测试用户是单独的用户,因此测试用户页面不会显示在添加页面的选项中,只会显示我拥有的页面。

There is a menu option to log in as another user, but doing that as the test user gives the error that a test user cannot access the developer.facebook.com service.有一个菜单选项可以作为另一个用户登录,但是作为测试用户这样做会给出测试用户无法访问 developer.facebook.com 服务的错误。 So no luck there.所以那里没有运气。

So in short, it LOOKs like the test page is linked to the test chatbot app because it appears in "business integrations", but no traffic is routing.所以简而言之,它看起来像测试页面链接到测试聊天机器人应用程序,因为它出现在“业务集成”中,但没有流量路由。

Things changed in 2018 at Facebook. 2018 年 Facebook 发生了变化。 The old way of using Graph API to link your test page to your chatbot app no longer works.使用 Graph API 将测试页面链接到聊天机器人应用程序的旧方法不再有效。 Facebook's own documentation is massively out of date and their recommendations not only don't work, the permissions tags no longer exist. Facebook 自己的文档已经严重过时,他们的建议不仅不起作用,权限标签也不再存在。

Has anyone solved this puzzle?有没有人解决这个难题?

You have to use the test user to create a test page and then issue commands directly through the graph API (using curl , for example) to allow the page to use the app.您必须使用测试用户创建一个测试页面,然后直接通过图形 API(例如使用curl )发出命令,以允许该页面使用该应用程序。 The details for doing that are available on a FB bug report linked in this answer Can you use Facebook "Test Users" to test a Messenger Bot?执行此操作的详细信息可在此答案中链接的 FB 错误报告中找到您可以使用 Facebook“测试用户”来测试 Messenger Bot 吗?

The test user cannot see your own pages nor see you but you can see the test page created by the test user and interact with it.测试用户看不到您自己的页面,也看不到您,但您可以看到测试用户创建的测试页面并与之交互。 Sadly, because the test user cannot see you, the bot cannot get the information about the user interacting with the page either (which might cause exceptions in your bot code).遗憾的是,由于测试用户看不到您,机器人也无法获取有关用户与页面交互的信息(这可能会导致机器人代码出现异常)。 The best way is to interact using a separate test user.最好的方法是使用单独的测试用户进行交互。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM