mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 12:39:43 +00:00
OOF
This commit is contained in:
parent
144dbf5cef
commit
113ecd1edc
1 changed files with 9 additions and 3 deletions
|
|
@ -717,9 +717,15 @@ class PocketMinecraftServer{
|
||||||
$url = $this->extraprops->get("discord-webhook-url");
|
$url = $this->extraprops->get("discord-webhook-url");
|
||||||
$name = $this->extraprops->get("discord-bot-name");
|
$name = $this->extraprops->get("discord-bot-name");
|
||||||
$headers = [ 'Content-Type: application/json; charset=utf-8' ];
|
$headers = [ 'Content-Type: application/json; charset=utf-8' ];
|
||||||
$POST = [ 'username' => $name, 'content' => $msg];
|
$POST = [ 'username' => $name, 'content' => str_replace("@", "", $msg)];
|
||||||
include_once('discord.php');
|
$ch = curl_init();
|
||||||
discord::run($url, $headers, $POST);
|
curl_setopt($ch, CURLOPT_URL, $url);
|
||||||
|
curl_setopt($ch, CURLOPT_POST, true);
|
||||||
|
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||||
|
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($POST));
|
||||||
|
$response = curl_exec($ch)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue