roesten/rocketchat 问题修复 & 功能扩展

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

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

roesten/rocketchat

最新稳定版本:v0.2.0

Composer 安装命令:

composer require roesten/rocketchat

包简介

package to send messages in rocket chat channels

README 文档

README

It is a simple package for sending messages using rocket chat channels. This is very simple and without many dependencies.

How to install

composer require roestreich/rocketchatchannel

How to use

Create a new instance of Message

$message = new Message();
$message->setImportant(false);
$message->setSuccess(false);
#name channel
$message->setChannel('test');
$message->setText(Markdown::table(['Country','City'],['Spain','Madri']));

Create a new instance of RocketChat

$clientRocketChat = new RocketChat('https://rocketchat.com.br/api/v1/','UGS45hIeD29u0SYmwAdVmdF7cNbOd0ydg4487S9zgw5','SJSGHJLKlhdds');
$clientRocketChat->sendMessage($message);

And is it very simple!

Message types

Bold

$message->setText(Markdown::bold('Spain'));

Result Bold

Spain

Headings h1 > h6

$message->setText(Markdown::headings('Spain',1));
$message->setText(Markdown::headings('Spain',2));
$message->setText(Markdown::headings('Spain',3));
$message->setText(Markdown::headings('Spain',4));
$message->setText(Markdown::headings('Spain',5));
$message->setText(Markdown::headings('Spain',6));

Result Headings

Spain

Spain

Spain

Spain

Spain

Spain

List

$message->setText(Markdown::listItem(['Spain','Portugal','France']));

Result List

  • Spain
  • Portugal
  • France

Code Block

The second argument is optional and default is sh, but have many options for syntax highlighting code some examples: 'js','php','ruby'

$message->setText(Markdown::codeBlock('npm install --production
NODE_ENV=production node app','js'));

Result Code Block

npm install --production
NODE_ENV=production node app

Table

$message->setText(Markdown::table(['Country','City'],['Spain','Madri']));

Result Table

Country City
Spain Madri

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-02-14