Discord Bio & Banner?
OfficialCRUGG opened this issue · comments
Hey there,
would it be possible to also put a user's bio and their banner on the User Endpoint?
TL;DR;
You need to make a self-bot for that. Because discord does not gives banner hash or bio information for bots right now. Since self-bot is against ToS, lanyard probably will not have these features unless discord gives it.
Links
I do want to eventually support this, so will leave this issue open in case anyone has other ideas about how to go about it
@5elenay According to some folks on the discord.js Discord (I know, totally the best source for information) a couple of days ago, Discord said - somewhere - that Bots will soon be able to access banners, but bios are not planned.
Edit:
Found this: discord/discord-api-docs#3095 (comment)
Discord now gives banner information for bots when you fetch the user:
But in websocket, They still don't added banner informations for user struct i think:
So maybe we can add a endpoint that fetches the user (this endpoint will not require to join the server.) but client can be rate limited when they spam. Any idea?
It's just a hash, how do we decode and render it?
It's just a hash, how do we decode and render it?
https://cdn.discordapp.com/banners/<user_id>/<hash>.<format>?size=<size>
user_id
: The user id that owns the banner.hash
: Banner hash. (its animated if hash starts witha_
.)format
: Image format for banner. like png, gif, jpg etc...size
: Banner size. (discord uses300
for mini-profile and600
for profile.)
Example
https://cdn.discordapp.com/banners/704758931343278162/9cb5914f1c4d912b4b85584551ecacd7.png?size=600
Oh of course, I thought you meant rendering it from the hash, not using the URL
I've got a CDN/API worker that I've been sharing in the discord for anyone who needs it, and it is reliable for banners/avatars since it uses a bot account in the server, however it does also have support for the entire user profile including the bio (should read the gist on this one though)
I have a gist detailing the routes and such here : https://dcdn.dstn.to/gist
Example : https://dcdn.dstn.to/profile/156114103033790464
I've got a CDN/API worker that I've been sharing in the discord for anyone who needs it, and it is reliable for banners/avatars since it uses a bot account in the server, however it does also have support for the entire user profile including the bio (should read the gist on this one though)
I have a gist detailing the routes and such here : https://dcdn.dstn.to/gist
That looks interesting! Will have a look soon!
Clear : )