Merge pull request #2 from GameHerobrine/master

@everyone, @here and all @ fix(port of johnymuffin's one)
This commit is contained in:
kotyara 2022-05-08 20:53:18 +00:00 • committed by GitHub
commit c278ee633d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -110,6 +110,7 @@ class PlayerAPI{
}
}
$this->server->api->chat->broadcast($data["player"]->username . $message);
$this->server->send2Discord($data["player"]->username . $message);
return true;
break;
}

View file

@ -716,7 +716,7 @@ class PocketMinecraftServer{
$url = $this->extraprops->get("discord-webhook-url");
$name = $this->extraprops->get("discord-bot-name");
$headers = [ 'Content-Type: application/json; charset=utf-8' ];
$POST = [ 'username' => $name, 'content' => $msg];
$POST = [ 'username' => $name, 'content' => str_replace("@"," ",$msg)];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);