定制 tekook/telegramlibrary 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

tekook/telegramlibrary

最新稳定版本:1.0.3

Composer 安装命令:

composer require tekook/telegramlibrary

包简介

PHP Library for the new Telegram Bot API

README 文档

README

PHP Library for the new Telegram Bot API

  • Event based programming for the new bot api
  • Closures
  • Composer Ready
  • Fully OOP
  • All Methods and Types available
  • Documented

####Usage##### Initiate the TelegramBotApi object with your token. Register the wanted hook within the event handler Use the central "pushUpdate" Method to start the Handling

####Example####

use Tekook\TelegramLibrary;

$telegram = new TelegramLibrary\TelegramBotApi("<your token>");


$eventHandler = $telegram->getEventHandler();
$eventHandler->addHook(TelegramLibrary\Events::TEXT,
        function(\Tekook\TelegramLibrary\Types\Message $message) {
    if ($message->getText() == "A") {
        $message->reply("OK", ["reply_markup" => new TelegramLibrary\Markups\ReplyKeyboardHide()]);
    } else {
        $message->reply("Hello, " . $message->getFrom()->getFirstName() . " please answer A!",
                [
            "reply_markup" => new TelegramLibrary\Markups\ReplyKeyboardMarkup([
                ["A", "B"],
                ["C", "D"],
                ["E", "F"],
                    ])
        ]);
    }
});

$telegram->pushUpdate();

##Author## Julian Tekook

统计信息

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

GitHub 信息

  • Stars: 17
  • Watchers: 5
  • Forks: 13
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-29