Botman is a framework agnostic library for building your own chat bots in PHP. With the same chat bot logic you can connect to a variety of chat services like HipChat, Slack, Telegram, Facebook Messenger, Google Hangouts and a variety of others (just search for “botman/driver” on Packagist). You can also build your own drivers for the services which are currently not supported (can’t think of one top of my head), or simply integrate it with your website.
I came across this library via this article.