-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Guild Member object #17
Comments
What exactly did it return? Was it just completely empty? What have you tried so far up to this point? |
Yeah, it's just NULL. I tried adding a bot token and changing the authorization from |
The rabbit hole goes deeper. I discovered |
Hello @benthetechguy. Thanks for showing interest in the project, and wanting to further expand the possibilities of the script. What you're looking for is this endpoint: To use this endpoint, please make sure you enable the scope You'd want to pass in the specific ID of the guild you want to return the object for. function get_guild_member($id)
{
$url = $GLOBALS['base_url'] . "/api/users/@me/guilds/$id/member";
$headers = array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $_SESSION['access_token']);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($curl);
curl_close($curl);
$results = json_decode($response, true);
return $results;
} This will return the values from the Guild Member Object, where you can find the ISO8601 timestamp in the Hope this helps, and we will be sure to add this to the demo! |
Perfect, that worked! By the way, what terms can I use this software under? I use it in my website, but there is no license, so it's unclear what I can do with it. I made an issue #16 and it was said that a license would be added, but it's been months and there is no license yet. |
I did actually get a chance to chat with Markis about a license for this project back in May, as per your request in the issue. While we found a solution, it seems that there was a bit of miscommunication, and the issue was closed without an actual implementation. I apologize for that. A couple of hours ago this was fixed, and this project is now properly licensed. |
Ah, I missed that. Thanks!
|
I use this script in my website, and I want to check how long ago a user joined my server.
Looking at the Discord API, that information is accessible via the Guild Member object.
I attempted to add a function for get Guild Member based on the existing
get_user
function:I didn't test any of the other values, but the
joined_at
one I wanted was empty, so I did something wrong.Do you have any idea what I may have done wrong here? It would be excellent if this could be in the official script.
The text was updated successfully, but these errors were encountered: