Skip to content

botify-framework/botify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Botify Framework

Create your own Telegram API bot asynchronously in PHP

How to use

Installation

  • Install with git
git clone https://github.com/botify-framework/botify 

Then composer install

  • Install with composer
composer create-project --prefer-dist botify-framework/botify 

Note You must install the framework directly as a master project

Webhook mode

use Botify\Events\Handler;
use Botify\TelegramAPI;

require_once __DIR__ .'/bootstrap/app.php';

$bot = new TelegramAPI([
    'token' => '123456789:AAABBBCCCDDDEEE',
]);

$bot->loopAndHear(Handler::UPDATE_TYPE_WEBHOOK);

Http server mode

use Botify\Events\Handler;
use Botify\TelegramAPI;

require_once __DIR__ .'/bootstrap/app.php';

$bot = new TelegramAPI([
    'token' => '123456789:AAABBBCCCDDDEEE',
]);

$bot->loopAndHear(Handler::UPDATE_TYPE_SOCKET_SERVER);

Long polling mode

use Botify\Events\Handler;
use Botify\TelegramAPI;

require_once __DIR__ .'/bootstrap/app.php';

$bot = new TelegramAPI([
    'token' => '123456789:AAABBBCCCDDDEEE',
]);

$bot->loopAndHear(Handler::UPDATE_TYPE_POLLING);

Support group

About

Build your Telegram bots asynchronously in PHP

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •