<?php

$webhook_url = "https://discord.com/api/webhooks/1503974710097084457/q5WXbLRbwOEvM9Inype8QBNgXjzcZydXDX8m6x1S_VccqElvOvAPAm6ZNhBGNFccnsyB";

$data = [
    "username" => "CTM Calendario",
    "embeds" => [
        [
            "title" => "Nuevo Evento",
            "description" => "Se ha creado un nuevo evento.",
            "color" => 16711680
        ]
    ]
];

$options = [
    "http" => [
        "header"  => "Content-type: application/json",
        "method"  => "POST",
        "content" => json_encode($data),
    ]
];

$context  = stream_context_create($options);
$result = file_get_contents($webhook_url, false, $context);

if ($result === FALSE) {
    echo "Error enviando webhook";
} else {
    echo "Webhook enviado correctamente";
}

?>
