|Classes of Marcel Pociot||>||PHP Slack Bot||>||readme-facebook.md||>||Download|
BotMan with Facebook Messenger
Note: Facebook Messenger requires a valid URL in order to set up webhooks. If you are using Laravel Valet, you can get an external URL for testing using the
This URL needs to validate itself against Facebook. When you create the webhook on the Facebook developer website, you have to choose a unique verify token, which you can check against in your verify controller.
BotMan comes with a method to simplify the verification process. Just place this line after the initialization:
To connect BotMan with your Facebook Messenger Bot, you first need to follow the official quick start guide to create your Messenger Bot and retrieve an access token.
Once you have obtained the page access token, place it in your BotMan configuration.
If you want BotMan to automatically verify each incoming Facebook webhook, you can optionally place your app secret in the BotMan configuration array.
For Laravel, the page access token needs to be in your
If you don't use Laravel, you can pass the page access token to the
And that's it - you can now use BotMan with your Facebook bot!