Category : discord

After Discord switching to discord.com URL webhook, my code decided to create an error… However – it’s a bit weird error. The code looks like this: $ch = curl_init($webhook_url); curl_setopt( $ch, CURLOPT_HTTPHEADER, array(‘Content-Type: application/json’)); curl_setopt( $ch, CURLOPT_POST, 1); curl_setopt( $ch, CURLOPT_POSTFIELDS, $json_data); curl_setopt( $ch, CURLOPT_HEADER, 0); curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1); $response ..

Read more

<?php $botToken = ‘TOKEN’; $ch = curl_init(‘https://discordapp.com/api/guilds/SERVER_ID/members?limit=1000’); curl_setopt($ch, CURLOPT_HTTPHEADER, Array(‘Authorization: Bot ‘ . $botToken)); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $result = curl_exec($ch); curl_close($ch); $users = count(json_decode($result)); echo($result) //Missing Access", "code": 50001 ?> The authorization header seems to be the same via the API and my i haven’t changed my bot’s token. Any idea what ..

Read more

im using this code to get discord oauth2, no error and no result. nothing hope u guys could help me i dont wana use library or anything else. i just wana solve this problem best regard <?php ini_set(‘display_errors’, 1); ini_set(‘display_startup_errors’, 1); ini_set(‘max_execution_time’, 300); error_reporting(E_ALL); if(isset($_GET[‘code’])) { define(‘OAUTH2_CLIENT_ID’, ‘756666636026773524’); define(‘OAUTH2_CLIENT_SECRET’, ‘Q3Eb6qBGHIIFMKJqZZ8JxwtvmmajJLqW’); define(‘OAUTH2_REDIRECT’, ‘http://localhost/php/discord3/demo/index.php’); define(‘TOKEN_URL’, ‘https://discordapp.com/api/oauth2/token’); $token ..

Read more

Hi i am new to webhooks but i encounter a problem where the webhook doesnt work on online website but it seems to work on localhost xampp. This is the code: <?php ob_start(); function Webhook($mess){ $message=json_encode(["content"=>$mess]); $webhook=curl_init("Discord Link"); curl_setopt( $webhook, CURLOPT_HTTPHEADER, array(‘Content-type: application/json’)); curl_setopt($webhook, CURLOPT_POST, 1); curl_setopt($webhook,CURLOPT_POSTFIELDS ,$message); $result=curl_exec($webhook); return $result; } echo Webhook("hello"); ob_flush(); ..

Read more