Skip to content

Piket564/PhpBotFramework

 
 

Repository files navigation

Php Bot Framework

Total Downloads Latest Stable Version Build Status Codacy Badge License

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.

Usage

<?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();

Features

  • 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

Requisites

  • 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)

Installation

To use this framework go in your project folder and execute these commands:

composer require danyspin97/php-bot-framework
composer install --no-dev

Documentation

Check the documentation Here for more.

Bot using this wrapper

Author

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.

About

A framework for Telegram Bot API written in PHP.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 97.9%
  • HTML 2.1%