예제 #1
0
 public function send_message($message, $mentions = array())
 {
     $curl_handle = new curl_handle();
     $url = "https://discordapp.com/api/channels/" . $this->current_channel . "/messages";
     $request = array('content' => $message);
     if (!empty($mentions)) {
         $request["mentions"] = $mentions;
     }
     $header = array("Authorization: " . $this->auth_token);
     return json_decode($curl_handle->post($url, json_encode($request), $header, "JSON"), true);
 }
예제 #2
0
 public function logout()
 {
     require_once PHP_DISCORD_DIR . "/library/curl_handle.class.php";
     $curl_handle = new curl_handle();
     $return = $curl_handle->post("https://discordapp.com/api/auth/logout", array("token" => $this->token));
 }