PHP code example of roesten / rocketchat

1. Go to this page and download the library: Download roesten/rocketchat 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/ */

    

roesten / rocketchat example snippets


composer 

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

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

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

$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));

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

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


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