Skip to content
forked from badfarm/zanzara

Asynchronous PHP Telegram Bot Framework built on top of ReactPHP

License

Notifications You must be signed in to change notification settings

awohsen/zanzara

This branch is 6 commits ahead of badfarm/zanzara:develop.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7fff7a0 · Nov 8, 2023
Dec 21, 2021
Nov 8, 2023
Nov 8, 2023
Nov 4, 2020
Nov 7, 2020
Oct 10, 2020
Apr 22, 2020
Dec 10, 2020
Apr 24, 2020
Apr 25, 2023
Jul 18, 2023
Jul 18, 2023
Dec 10, 2020
Dec 10, 2020
Jun 2, 2020

Repository files navigation

Asynchronous PHP Telegram Bot Framework built on top of ReactPHP

Bot API PHP Build Code style License


Features

  • Long polling support (no webserver required)
  • Middleware chain for requests
  • Conversations and sessions (no database required)
  • Based on ReactPHP asynchronous non-blocking I/O model
  • Scheduled functions/timers provided by ReactPHP
  • Bulk message sending (no more 429 annoying errors)

Installation

composer require badfarm/zanzara

Quickstart

Create a file named bot.php and paste the following code:

<?php

use Zanzara\Zanzara;
use Zanzara\Context;

require __DIR__ . '/vendor/autoload.php';

$bot = new Zanzara("YOUR-BOT-TOKEN");

$bot->onCommand('start', function (Context $ctx) {
    $ctx->sendMessage('Hello');
});

$bot->run();

Then run it from command line as follows:

$ php bot.php

Enjoy your bot!

Check out the Wiki for documentation.

About

Asynchronous PHP Telegram Bot Framework built on top of ReactPHP

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%