MadelineProto
Async PHP client/server API for the telegram MTProto protocol
...Internal peer management: you can provide a simple bot API chat id or a username to send a message or to call other mtproto methods! You can easily login as a user (2FA is supported) or as a bot! Simple error handling! It is highly customizable with a lot of different settings! Bot API file id/object support (even for users)! A Lua binding, a lua wrapper for td-cli scripts, Secret chats, MTProto 2.0, PFS, PFS in secret chats. MadelineProto can do everything official clients can do, and more! MadelineProto requires the mbstring, xml, json, fileinfo, gmp extensions to function properly.