1
0
Fork 0
Manager/classen/discord.php

19 lines
624 B
PHP
Raw Normal View History

2021-01-20 23:29:57 +00:00
<?php
function sendMessageToWebhook($webhook, $title, $message)
{
$RAWmessage = file_get_contents("style/discordMessage.json");
$RAWmessage = str_replace("%%message%%", $message, $RAWmessage);
$RAWmessage = str_replace("%%title%%", $title, $RAWmessage);
$options = [
'http' => [
'method' => 'POST',
'header' => 'Content-Type: application/json',
'timeout' => 3,
'content' => $RAWmessage
]
];
$result = file_get_contents($webhook, false, stream_context_create($options));
}
?>