定制 fullybaked/pslackr 二次开发

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

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

fullybaked/pslackr

最新稳定版本:0.1.4

Composer 安装命令:

composer require fullybaked/pslackr

包简介

Inbound Webook intergration for Slack.com

README 文档

README

Build Status Code Climate

pslackr [slak-er]

pSlackr is a library for integrating Slack.com's inbound web hook into your application enabling you to send messages to your group chat channels from your application

Installing

Via Composer

composer require fullybaked/pslackr

### Slack API Token

Pslackr uses the old style of sending the token with the request to Slack, so to find the correct token go to your inbound web hook on Slack and you should see

https://hooks.slack.com/services/A111AA1AA/B00BB0BBB/aBCDe1FGHijKlmNoP

Where ever Pslackr requires an API token you need to use the last string in the URL aBCDe1FGHijKlmNoP in the example above.

## Usage

Example of basic usage with suplied classes

<?php
require_once 'vendor/autoload.php';

use FullyBaked\Pslackr\Messages\CustomMessage;
use FullyBaked\Pslackr\Pslackr;

$message = new CustomMessage('Testing from Pslackr');

$config = ['token' => 'YOUR_TOKEN', 'domain' => 'YOUR_DOMAIN'];
$slack = new Pslackr($config);
$slack->send($message);

Customise the message

The supplied CustomMessage class details the optional parameters that can be sent as part of the request. These parameters allow you to customise the message.

  1. Channel
  2. Username
  3. Icon (url or emoji)
<?php 

use FullyBaked\Pslackr\Messages\CustomMessage;

$message = new CustomMessage('Testing from Pslackr');

$message->channel('#my-other-channel');

$message->username('slackbot');

$message->iconUrl('http://example.tld/path/to/my.png');
// OR //
$message->iconEmoji(':ghost:');

Changing the HTTP Client

By default Pslackr was built with Guzzle and has it listed as a dependency, however for various reasons you may wish to use your own HTTP client. If so, this can be acheived by implementing the Transport interface using your own choice of HTTP client.

统计信息

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

GitHub 信息

  • Stars: 6
  • Watchers: 0
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-03-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固