[Feature Request] Add to API: User's shown social media

Commenti

7 commenti

  • Zac

    pretty good thing to add

    0
  • donovan_dmc

    Yes, give people an easier way to scrape user data

    0
  • Anatoly

    donovan_dmc You can hide these if you don't want them to be shown. If you have set them to be shown to everyone, anyone can already get access to it. Would it satisfy you if there'd be an option for users to be able set these to "show to noone", "show to friends only", "show to users only" and "show to everyone"?

    0
  • doliiphin

    This can be done with a user token.

    GET /users/{user id}/profile

    Example as fetch:

    async function getUserSocials(userId, token) {
    return (await fetch(`https://discord.com/api/v8/users/${userId}/profile`, {
    headers: { authorization: token },
    method: "GET"
    })).json();
    }

    There's no documentation for it but, here, I'll write some.

    Get User Socials

    | FIELD               | TYPE                           | DESCRIPTION                              |
    |---------------------|--------------------------------|------------------------------------------|
    | connected_accounts  | array of account objects       | accounts the user has connected          |
    | mutual_guilds       | array of partial guild objects | string id + string nick                  |
    | premium_guild_since | ISO8601 timestamp              | when the user started boosting the guild |
    | premium_since       | ISO8601 timestamp              | when the user got nitro                  |
    | user                | user object                    | the associated user object               |
     You can test the above function out for yourself to see the full return object
    If your bot isn't being used that much you can just use that function, otherwise, maybe make another account and implement some user rate-limiting (just catch the error and stop requests until retry_after is over)
    0
  • Anatoly

    doliiphin That worked! Although I wish to refuse from using my own token as much as possible.

    -1
  • JDJG

    Uh using your own token is against TOS .___.

    1
  • doliiphin

    JDJG Yeah, that would matter if Discord staff actually looked at the Feedback section literally ever lul

     

    -1

Accedi per aggiungere un commento.