Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $hookObject = json_encode([
- "content" => $content,
- "username" => $username,
- "avatar_url" => $avatar_url,
- "tts" => false,
- "embeds" => [
- [
- "title" => $title,
- "type" => "rich",
- "description" => $message,
- "url" => $url,
- "color" => hexdec("FFFFFF"),
- "thumbnail" => [
- "url" => $thumbnail
- ],
- "fields" => [
- [
- "name" => "Name 1",
- "value" => "Value 1",
- "inline" => true
- ],
- [
- "name" => "Name 2",
- "value" => "Value 2",
- "inline" => true
- ],
- [
- "name" => "Name 3",
- "value" => "Value 3",
- "inline" => true
- ]
- ]
- ]
- ]
- ], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE );
- $ch = curl_init();
- curl_setopt_array($ch, [
- CURLOPT_URL => $webhook,
- CURLOPT_POST => true,
- CURLOPT_POSTFIELDS => $hookObject,
- CURLOPT_HTTPHEADER => [
- "Length" => strlen($hookObject),
- "Content-Type" => "multipart/form-data"
- ]
- ]);
- $response = curl_exec($ch);
- curl_close($ch);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement