modify filters
This commit is contained in:
parent
096f91cd74
commit
e4c80782f8
4 changed files with 114 additions and 12 deletions
37
classes/webhook_comp/discord.php
Normal file
37
classes/webhook_comp/discord.php
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace classes\webhook_comp;
|
||||
|
||||
|
||||
class discord
|
||||
{
|
||||
private $json;
|
||||
private $readable = "";
|
||||
|
||||
public function __construct($json)
|
||||
{
|
||||
$this->json = $json;
|
||||
}
|
||||
|
||||
public function readableMessage()
|
||||
{
|
||||
if(!empty($this->json->content))
|
||||
{
|
||||
return $this->json->content;
|
||||
}
|
||||
|
||||
if(!empty($this->json->embeds->title))
|
||||
{
|
||||
$this->readable .= $this->json->embeds->title . PHP_EOL;
|
||||
}
|
||||
|
||||
if(!empty($this->json->embeds->description))
|
||||
{
|
||||
$this->readable .= preg_replace("/(?:__|[*#])|\[(.*?)\]\(.*?\)/"," ",$this->json->embeds->description) . PHP_EOL;
|
||||
$this->readable .= $this->json->embeds->url;
|
||||
}
|
||||
|
||||
return $this->readable;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue