badfarm/zanzara 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

badfarm/zanzara

最新稳定版本:0.9.1

Composer 安装命令:

composer require badfarm/zanzara

包简介

Asynchronous PHP Telegram Bot Framework

README 文档

README

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.

统计信息

  • 总下载量: 2.47k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 205
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 203
  • Watchers: 8
  • Forks: 29
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-06-11