GithubHelp home page GithubHelp logo

devblack / zanzara Goto Github PK

View Code? Open in Web Editor NEW

This project forked from badfarm/zanzara

0.0 0.0 1.0 1.13 MB

Asynchronous PHP Telegram Bot Framework built on top of ReactPHP

License: MIT License

PHP 99.95% Dockerfile 0.05%

zanzara's Introduction

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.

zanzara's People

Contributors

awohsen avatar bohzio avatar cheeghi avatar dependabot[bot] avatar devblack avatar hamidqp avatar ildarsaitkulov avatar sergix44 avatar

Forkers

ryouusama

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.