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_file($webhook, $path_img) 10{ 11 // format POST data 12 $file = new CURLFile($path_img); 13 $file->setPostFilename("logo.png"); 14 $data = array('image' => $file); 15 // init curl 16 $ch = curl_init($webhook); 17 // submit payload 18 curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); 19 curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 20 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 21 curl_exec($ch); 22 // close curl 23 Curl_close($ch); 24} 25 26$webhook = $conf['webhook']; 27$path_img = "images/logo.png"; 28send_file($webhook, $path_img); 29