From c25c198dc4bc0beba1e7bef3600f68621da57a4b Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 12 Apr 2019 13:38:58 +0300 Subject: [PATCH] Web part upload There are redirection PHP scripts to redirect Garry's Mod GET and POST requests to the Discord API. CloudFlare that uses Discord do not allows GMod browser to send GET and POST requests that is the reason you must use redirection. Just upload this files to your web-server and configure api links at /lua/autorun/server/discord.lua --- web/request.php | 25 +++++++++++++++++++++++++ web/send.php | 29 +++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 web/request.php create mode 100644 web/send.php diff --git a/web/request.php b/web/request.php new file mode 100644 index 0000000..dc71d12 --- /dev/null +++ b/web/request.php @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/web/send.php b/web/send.php new file mode 100644 index 0000000..b68f923 --- /dev/null +++ b/web/send.php @@ -0,0 +1,29 @@ + array( + 'header' => "Content-type: application/json\r\n", + 'method' => 'POST', + 'content' => $_POST["content"] + ) + ); + $context = stream_context_create($options); + + $result = file_get_contents($_POST["webhook"], false, $context); +?> \ No newline at end of file