PHPackages                             mboretto/messenger-bot - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. mboretto/messenger-bot

ActiveLibrary[API Development](/categories/api)

mboretto/messenger-bot
======================

PHP Messanger bot

0.1.1(9y ago)022MITPHPPHP &gt;=5.5.0

Since Dec 4Pushed 9y ago1 watchersCompare

[ Source](https://github.com/MBoretto/messenger-bot)[ Packagist](https://packagist.org/packages/mboretto/messenger-bot)[ Docs](https://github.com/mboretto/messenger-bot)[ RSS](/packages/mboretto-messenger-bot/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (8)Dependencies (6)Versions (11)Used By (0)

Messenger Bot
=============

[](#messenger-bot)

Php wrapper around the [Facebook Messenger Platform](https://developers.facebook.com/docs/messenger-platform). Strongly inspired to [irazasyed/telegram-bot-sdk](https://github.com/irazasyed/telegram-bot-sdk) and [akalongman/php-telegram-bot](https://github.com/irazasyed/telegram-bot-sdk);

Installation
------------

[](#installation)

1. [Set up the facebook page and application](https://developers.facebook.com/docs/messenger-platform/guides/setup)
2. Library installation

    composer require mboretto/messenger-bot
3. Edit the \[hook.php\](() file with your Facebook credential.
4. Point the webhook to your https domain.

Features
--------

[](#features)

- GenericTemplate, ButtonTemplate, ThreadSettings, Buttons, QuickReply, fetching user info and Commands...
- Automatic message splitting if characters exceed the limit

### Middleware

[](#middleware)

Sometimes you need to execute some routines for each incoming messaging object. In order to do this you can exploit the middleware layer. Middleware instances need to implement the *Middleware\\Layer* Class. Middleware can be before the core function:

```
