hybridlogic/slack 问题修复 & 功能扩展

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

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

hybridlogic/slack

Composer 安装命令:

composer require hybridlogic/slack

包简介

A library for working with Slack.

README 文档

README

A library of useful classes for working with Slack.

At the moment this library is mainly focused on slash commands but may grow in the future. It supports defining multiple commands and matching actions within them.

Build Status Packagist

0.0 Table of Contents

  1. Introduction
  2. Install
  3. Examples
  4. Running Tests
  5. Troubleshooting
  6. Changelog

1.0 Introduction

Slack is a cross-platform messaging platform that offers multiple integrations with third-party services. One of the most useful of these integrations is in the form of slash commands e.g.

/cinema movies tonight

Slash commands make a HTTP POST request to a server and display the result to the user. This library aims to make dealing with these commands a bit simpler, including:

  • Parsing the incoming data
  • Matching text against command patterns
  • Ensuring security tokens match
  • Filtering available teams, channels and users
  • Serving responses
  • Handling delayed responses

At the moment there is no support for the Slack Web API or RTM as these have been done elsewhere by others. This library lets you get a slash command online quickly and easily. Look in the examples directory for more info.

2.0 Installation

PHP Slack is available on Composer via Packagist. To install simply run:

composer require hybridlogic/slack

Alternatively clone the git repository and use a PSR-4 compatible autoloader.

3.0 Examples

Slack::dispatcher()
	->setFilter(
		Slack::filter()
			->allowedTeamIds('T01234567')
			->allowedUserIds('U01234567')
	)
	->addCommand(
		Slack::command('ABCDEF01234567')
			->on('', function(){
				return Slack::response('Welcome to this command');
			})
			->on('^say (.+)$', function($req){
				$text = $req->param(0);
				return Slack::response("Hello $text");
			})
	)
	->dispatch(Slack::request())
	->serve()
;

4.0 Running Tests

phpunit tests

5.0 Troubleshooting

Make sure you meet the requirements for running a slash command host i.e. publicly accessible and served over HTTPS.

6.0 Changelog

  • [2016-02-21] Initial release

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-02-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固