PHP code example of jiemo / leanchat
1. Go to this page and download the library: Download jiemo/leanchat library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jiemo / leanchat example snippets
use Jiemo\LeanChat\Client;
use Jiemo\LeanChat\Message\Attachment;
use Jiemo\LeanChat\Message\Body;
$body = new Body();
$body->title = '@所有人 测试' ;
$body->channel = '#test';
$body->displayUserName = 'test';
$body->displayUserAvatarUrl = 'http://example.com/t.png';
$attachment = new Attachment();
$attachment->color = Attachment::COLOR_WARNING;
$attachment->title = 'test';
$attachment->description = 'tset';
$body->addAttachment($attachment);
$client = new Client('http://xxx');
$client->send($body);
php bin/leanchat.php