17 lines
476 B
PHP
17 lines
476 B
PHP
|
<?php
|
||
|
class Matterbridge {
|
||
|
protected $connection;
|
||
|
public function __construct() {
|
||
|
$this->connection = new \GuzzleHttp\Client();
|
||
|
}
|
||
|
public function post($text, $username) {
|
||
|
$this->connection->post($_ENV['MATTERBRIDGE_URL'].'/api/message', [
|
||
|
'body' => json_encode([
|
||
|
'gateway' => $_ENV['MATTERBRIDGE_GATEWAY'],
|
||
|
'text' => $text,
|
||
|
'username' => $username
|
||
|
]),
|
||
|
]);
|
||
|
}
|
||
|
}
|