castlepointanime/slack-api-bundle

用于与 Slack API 交互的 Symfony 扩展包

0.4 2015-01-27 19:54 UTC

This package is not auto-updated.

Last update: 2024-09-28 16:20:40 UTC


README

https://travis-ci.org/castlepointanime/slack-api-bundle.svg?branch=master

本项目是一个用于与 Symfony 交互的 Slack.com API 扩展包。其目的是提供一个易于使用的框架,用于编写与您的 Slack 团队交互的机器人和其他工具。

本扩展包提供的一些功能

  • 默认路由(及其相关控制器),可以捕获所有 Slack Webhooks
  • 允许服务注册并监听特定 Webhook 事件的调度器服务
  • 基于 Guzzle Services 的客户端,用于主 API
  • 处理出站 Webhooks、入站 Webhooks、斜杠命令、远程 Slackbot 以及主 API(即将推出 RTM Websockets)

目前项目仍在开发中,但几乎已准备好发布。然而,我仍然建议在 1.0 版本发布之前谨慎使用此扩展包。

安装

步骤 0:安装 Symfony

实际上,此程序可以在不使用 Symfony 的情况下使用,因为它只依赖于某些组件,但显然,如果您正在创建一个新项目,使用此扩展包与 Symfony 标准版 一起使用将会更容易。

步骤 1:下载扩展包

打开命令行,进入您的项目目录,并执行以下命令以下载此扩展包的最新稳定版本

$ composer require castlepointanime/slack-api-bundle

此命令需要您全局安装 Composer,如 Composer 文档的 [安装章节](https://getcomposer.org.cn/doc/00-intro.md) 中所述。

步骤 2:启用扩展包

然后,通过在您的项目 app/AppKernel.php 文件中添加以下行来启用扩展包

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...

            new CastlePointAnime\SlackApiBundle\SlackApiBundle(),
        );

        // ...
    }

    // ...
}

使用

文档仍在制作中。在不久的将来,以下链接将向您展示如何使用此扩展包

如果您有任何您认为应在文档中回答的问题,请在 GitHub 上提交问题。

贡献

欢迎所有贡献。只需提交一个拉取请求即可。本项目采用 AGPL 许可,因此所有提交的代码都必须在该许可下(或与之兼容的许可,但这会让法律问题变得复杂)。

许可

Copyright (C) 2015  Tyler Romeo <tylerromeo@gmail.com>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://gnu.ac.cn/licenses/>.