Skip to content

Instantly share code, notes, and snippets.

@gerardorochin
Created April 17, 2020 04:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gerardorochin/925018e387d283a9ee344cb501884e82 to your computer and use it in GitHub Desktop.
Save gerardorochin/925018e387d283a9ee344cb501884e82 to your computer and use it in GitHub Desktop.
<?php
$data = array(
"content" => "Pickle Rick motherfuckers!",
);
$ch = curl_init("https://discordapp.com/api/webhooks/<WEBHOOK_ID>/<TOKEN>");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$x = curl_exec($ch);
print_r($x);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment