Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

badfarm/zanzara

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

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /