From 113ecd1edc0eb8c8899470e554e940a5d201d3e2 Mon Sep 17 00:00:00 2001 From: kotyara <62548070+kotyaralih@users.noreply.github.com> Date: Mon, 9 May 2022 02:43:27 +0500 Subject: [PATCH] OOF --- src/PocketMinecraftServer.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/PocketMinecraftServer.php b/src/PocketMinecraftServer.php index 218b8c9b..68c545d1 100644 --- a/src/PocketMinecraftServer.php +++ b/src/PocketMinecraftServer.php @@ -717,9 +717,15 @@ 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]; - include_once('discord.php'); - discord::run($url, $headers, $POST); + $POST = [ 'username' => $name, 'content' => str_replace("@", "", $msg)]; + $ch = curl_init(); + 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) } } }