Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function discordSend($method, $url, $token, $postfields='') {
- $ch = curl_init('https://discordapp.com/api/'. $url);
- curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
- curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, false );
- curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
- curl_setopt($ch, CURLOPT_HTTPHEADER, [
- 'Authorization: ' .$token,
- 'Content-Type: application/json'
- ]);
- curl_setopt($ch,CURLOPT_POSTFIELDS,json_encode($postfields));
- $response = json_decode(curl_exec($ch),true);
- curl_close($ch);
- return $response;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement