Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Webhook URL
- $url = '';
- // Fill with the content of the embed
- $obj = array (
- 'title' => '',
- 'description' => '',
- 'author' =>
- array (
- 'name' => '',
- 'icon_url' => '',
- ),
- 'color' => 36863,
- 'footer' =>
- array (
- 'text' => '',
- ),
- 'fields' =>
- array (
- 0 =>
- array (
- 'name' => 'Version',
- 'value' => '1.0.0',
- 'inline' => false,
- ),
- 1 =>
- array (
- 'name' => 'Changelog Link',
- 'value' => '',
- 'inline' => false,
- ),
- ),
- );
- $payload = array(
- 'content' => '',
- 'embeds' => array($obj)
- );
- $headers = array(
- 'Content-Type' => 'application/json',
- 'Content-Length' => strlen(urlencode(json_encode($obj)))
- );
- $curl_handle=curl_init();
- curl_setopt($curl_handle, CURLOPT_URL,$url);
- curl_setopt($curl_handle, CURLOPT_HTTPHEADER, $headers);
- curl_setopt($curl_handle, CURLOPT_POST, true);
- curl_setopt($curl_handle, CURLOPT_POSTFIELDS, json_encode($payload));
- curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
- curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($curl_handle, CURLOPT_USERAGENT, 'Chrome');
- $query = curl_exec($curl_handle);
- curl_close($curl_handle);
- print($query);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement