Working version of project
This commit is contained in:
parent
0b21896cd5
commit
5411c00ee9
9 changed files with 259 additions and 46 deletions
27
classes/webhook.php
Normal file
27
classes/webhook.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
namespace Classes;
|
||||
|
||||
class Webhook extends Core
|
||||
{
|
||||
private $json;
|
||||
|
||||
public function __construct(string $json)
|
||||
{
|
||||
parent::__construct();
|
||||
if($json)
|
||||
{
|
||||
$this->json = json_decode($json, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new \Exception("JSON is required to use this class");
|
||||
}
|
||||
}
|
||||
|
||||
public function getMessage()
|
||||
{
|
||||
return $this->json->text;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue