This repository has been archived on 2024-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
discord-questbook/Matterbridge.php

17 lines
476 B
PHP
Raw Normal View History

2021-09-24 16:59:31 +03:00
<?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
]),
]);
}
}