Php Bot Framework is a framework for Telegram Bot API. Designed to be fast and easy to use, it provides all the features a user need. Take control of your bot using the command-handler system or the update type based function.
<?php
// Include the framework
require './vendor/autoload.php';
// Create a bot
$bot = new DanySpin97\PhpBotFramework\Bot("token");
// Add a command that will be triggered everytime the user click "/start"
$bot->addMessageCommand("start",
function($bot, $message) {
// Reply with "Hello"
$bot->sendMessage("Hello");
}
);
// Received updates from telegram using getUpdates
$bot->getUpdatesLocal();
- Designed to be the fast and easy to use
- Support for getUpdates and webhooks
- Support for the most important API methods
- Command-handle system for messages and callback queries
- Update type based processing
- Easy inline keyboard creation
- Inline query results handler
- Sql database support
- Redis support
- Support for multilanguage bot
- Support for bot state
- Highly documented
- Php 7.0 or greater
- php-mbstring
- Composer (to install this package and the required ones)
- Web server (required for webhook) (nginx reccomended)
- SSL certificate (required for webhook) (follow these steps to make a self-signed certificate or use Let's Encrypt)
To use this framework go in your project folder and execute these commands:
composer require danyspin97/php-bot-framework
composer install --no-dev
Check the documentation Here for more.
This Framework is developed and mantained by @DanySpin97.
PhpBotFramework is released under GNU Lesser General Public License. You may copy, distribute and modify the software provided that modifications are described and licensed for free under LGPL-3. Derivatives works (including modifications) can only be redistributed under LGPL-3, but applications that use the framework don't have to be.