Search code examples
javascriptnext.jsdiscord

How do I get the correct Image url from discord using web3auth


Scenario is - I can login using Discord as a social login in web3auth. I get the user name and profileImage. But the image url looks like this

https://cdn.discord.com/embed/avatars/0.png

this url doesn't work. It produces this error in console

FetchError: request to https://cdn.discord.com/embed/avatars/0.png failed, reason: getaddrinfo ENOTFOUND cdn.discord.com

If I paste this in search engine then I get this

This site can’t be reachedCheck if there is a typo in cdn.discord.com. DNS_PROBE_FINISHED_NXDOMAIN


Solution

  • It looks like cdn.discord.com doesn't exist. Their actual URL seems to be cdn.discordapp.com are you sure you posted the right URL? If so, Discord gives you the wrong information. I see no issue on your side. You can contact them or attempt to manually replace the addresses and it might work.

    If you meant to post cdn.discordapp.com instead, then you are likely encountering DNS issues with your machine.