Debugging/testing facebook messenger bot

◇◆丶佛笑我妖孽 提交于 2019-12-24 00:52:35

问题


For testing purposes I usually put some logs or debugger into my code, probably as everybody does. To test my bot I would like to do the same but is there even a way to test/debug the messenger bot locally, or do I always have to deploy my tests?


回答1:


Just fill the webhook url with the url that you use for testing. You can send something to bot, and bot can receive the messages(if you are the administrator of the app). from the received messages you could get your sender_id, you can use the sender_id as the recipient and let bot send messages to the recipient. In this step you can just send a POST request independently for testing. After finishing all the testing above, remove the debugging part, it's time to go to app review!




回答2:


Try this out

https://github.com/SonOfSardaar/facebook-send-api-emulator

I wrote that as node application (send api emulation) with angular UI for messenger. this helped me to debug locally.



来源:https://stackoverflow.com/questions/37399219/debugging-testing-facebook-messenger-bot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!