PHP code example of ww-site / rumaxbot

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

    

ww-site / rumaxbot example snippets


use RuMaxBot\DataTransferObjects\SendMessageData;
use RuMaxBot\Enums\MessageFormat;
use RuMaxBot\Facades\RuMaxBot;

RuMaxBot::send(new SendMessageData(
    text: '🚀 Деплой прошёл успешно!',
    format: MessageFormat::Markdown,
));

use RuMaxBot\Contracts\RuMaxBotClientInterface;
use RuMaxBot\DataTransferObjects\SendMessageData;

final readonly class DeployNotifier
{
    public function __construct(
        private RuMaxBotClientInterface $ruMaxBot,
    ) {}

    public function notifySuccess(): void
    {
        $this->ruMaxBot->send(new SendMessageData(text: 'Deploy OK'));
    }
}
bash
php artisan vendor:publish --tag=rumaxbot-config
dotenv
RUMAXBOT_BASE_URL=https://rumaxbot.ru
RUMAXBOT_API_TOKEN=mbk_your_api_key_here
RUMAXBOT_TIMEOUT=30
bash
php artisan rumaxbot:test
bash
php artisan rumaxbot:test --message="Привет из Laravel"
php artisan rumaxbot:test --message="<b>HTML</b>" --format=html
bash
php artisan rumaxbot:test
php artisan rumaxbot:test --message="Привет из Laravel"
php artisan rumaxbot:test --message="<b>HTML</b>" --format=html
bash
php artisan test --filter RuMaxBot