[Feature Request] Add to API: User's shown social media
It would be great to see all user's shown social media links using the bot. Allows to scan your discord for content creators and mark them automatically with the respective roles/ be notified when someone more or less famous joins. Users can see it anyway, so why not bots?
-
pretty good thing to add
0 -
Yes, give people an easier way to scrape user data
0 -
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 -
This can be done with a user token.
GET /users/{user id}/profileExample 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 -
doliiphin That worked! Although I wish to refuse from using my own token as much as possible.
-1 -
Uh using your own token is against TOS .___.
1 -
JDJG Yeah, that would matter if Discord staff actually looked at the Feedback section literally ever lul
-1
Yorum yazmak için lütfen oturum açın.
Yorumlar
7 yorum