php discord webhook
function postToDiscord() { $data = array("content" => "Your Content", "username" => "Webhooks"); $curl = curl_init("https://discordapp.com/api/webhooks/YOUR-WEBHOOK-URL-HERE"); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); return curl_exec($curl); }
php discord webhook sender
{ "username": "Lir Roleplay bot", "avatar_url": "https://i.imgur.com/TvLyzfi.png", "content": "", "embeds": [ { "title": "***Правила будуть доповнюватися адміністрацією та находяться у стані розвитку***", "color": 11731199, "description": "", "timestamp": "", "author": {}, "image": {}, "thumbnail": {}, "footer": {}, "fields": [] } ], "components": [] }