1<?php
2/**
3 * https://birdie0.github.io/discord-webhooks-guide/structure/embed/color.html
4 */
5
6$conf = array();
7include "../conf/default.php";
8
9function send_message($webhook, $message)
10{
11    // format POST data
12    $payload = array("content" => "$message");
13    $json = json_encode($payload);
14    // init curl
15    $ch = curl_init($webhook);
16    // submit payload
17    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
18    curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
19    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
20    curl_exec($ch);
21    // close curl
22    Curl_close($ch);
23}
24
25$webhook = $conf['webhook'];
26$message = "This is a message.";
27send_message($webhook, $message);
28