承接 telegram-bot-sdk/addon-manager 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

telegram-bot-sdk/addon-manager

Composer 安装命令:

composer require telegram-bot-sdk/addon-manager

包简介

Addon Manager for Telegram Bot SDK

README 文档

README

Join PHP Chat Chat on Telegram Build Status Latest Version Total Downloads

Addon Manager to add, remove, manage and load addons into Telegram Bot SDK.

If you want to develop addons for Telegram Bot SDK, please make sure to require this package in your composer file.

Install

$ composer require telegram-bot-sdk/addon-manager

Usage

Create An Addon

<?php

namespace Acme\Addons;

use Telegram\Bot\Addon\Addon;
use Telegram\Bot\Events\UpdateEvent;

class AcmeAddon extends Addon
{
    public function register()
    {
        $this->bot->onUpdate(function (UpdateEvent $event) {
            $bot = $event->bot;
            $update = $event->update;

            // Do something with the inbound update received.
        });
    }
}

Register Addon

Auto-Discovery

The Addon Manager supports auto-discovery which registers the addons automatically.

Simply create a discovery.json file in your project root.

{
  "telegram/addon-config": [
    "config/acme.php"
  ],
  "telegram/addon": [
    "Acme\\Addons\\AcmeAddon"
  ]
}

Manually Register

use Acme\Addons\AcmeAddon;
use Telegram\Bot\Addon\AddonManager;

// Make sure to register before initializing bot manager.
AddonManager::register(AcmeAddon::class);

Remove Addon

AddonManager::remove(AcmeAddon::class);

Get Addons

$addons = AddonManager::getAddons();

Auto-Discover & Register Addons

AddonManager::discover();

Are You Using Telegram Bot SDK?

If you're using Telegram Bot SDK build your Telegram Bots or have a project that's relevant to the SDK, We'd love to know and share it with the world.

Head over to Awesome Telegram Bots to share, discover, and learn more.

Contributing

Thank you for considering contributing to the project. Please read the contributing guide before creating an issue or sending in a pull request.

Code of Conduct

Please read our Code of Conduct before contributing or engaging in discussions.

Security

If you discover a security vulnerability within this project, please email Syed at syed at lukonet.com. All security vulnerabilities will be promptly addressed. You may view our full security policy here.

Credits

License

This project is open-sourced software licensed under the BSD 3-Clause license.

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2020-05-25