quhang/bearychat 问题修复 & 功能扩展

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

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

quhang/bearychat

Composer 安装命令:

composer require quhang/bearychat

包简介

bearychat robot message api

README 文档

README

bearychat robot message api

Install

composer require quhang/bearychat

Usage

$message = new \Quhang\BearyChat\Message($webhook);

$attachment = new \Quhang\BearyChat\Attachment([
    'title' => 'title_1',
    'url' => 'https://bearychat.com',
    'text' => 'attachment_text',
    'color' => '#ffa500',
    'images' => ['url' => 'http://img3.douban.com/icon/ul15067564-30.jpg'],
]);

# or
# $attachment = new \Quhang\BearyChat\Attachment();
# $attachment->title('title_1')
#    ->url('https://bearychat.com')
#    ->text('attachment_text')
#    ->color('#ffa500')
#    ->image('http://img3.douban.com/icon/ul15067564-30.jpg');

$message->send();

Laravel

laravel 5.5+

  1. you can publish config, then set your webhook in .env BEARYCHAT_WEBHOOK. This is unnecessary.
php artisan vendor:publish
  1. 使用 BearyChat to send message. BearyChat is a \Quhang\BearyChat\Message instance.
\Quhang\BearyChat\BearyChat::text('hello')->send()

laravel 5.1 ~ 5.4

  1. if you want to config your webhook, you need add Quhang\BearyChat\LaravelServiceProvider to config/app.php
'providers' => [
    // ...
    Quhang\BearyChat\LaravelServiceProvider::class,
    // ...
]
  1. if you want to use Facade, you need add Quhang\BearyChat\BearyChat to config/app.php
'aliases' => [
    // ...
    'BearyChat' => Quhang\BearyChat\BearyChat::class,
    // ...
]

Methods

function text(string $text); # set text
function notification(bool $need = true); # notification control
function markdown(bool $need = true); # markdown control
function channel(string $name); # set channel name
function to(string $username); # send to someone
function attachment(Attachment $attach); # append a attachment
function appendAttachment(Attachment $attach); # alias attachment
function webhook($webhook); # set webhook url
function send(bool $need = true); # send

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-02-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固