javascriptdiscord.jsembedfooterreplit

Showing [object Object] in embed footer


SEE THIS PIC:
SEE THIS PIC

I have given the codes which I tried.

If I don't add iconURL then it works fine (ONLY FYI).

I am using discord.js v13.

CODE 1

const embed = new MessageEmbed()
        .setTitle("Thanks for Boosting <a:gifland_boost:810489455805857833>")
        .setURL(`https://discord.com/channels/948465967862784070/959091641577246770`)
        .setDescription(`Congratulations, you've got 20 coins to add projects in uptimer bot.\n Add one using: \`,add <url>\`\nCheck Coins: \`,balance\``)
        .setFooter({ text: `Send From [${newMember.guild.name}]` , iconURL: 'https://i.imgur.com/oO5ZSRK.png'})
        .setColor("#ff52bf");

CODE 2

const embed = new MessageEmbed()
        .setTitle("Thanks for Boosting <a:gifland_boost:810489455805857833>")
        .setURL(`https://discord.com/channels/948465967862784070/959091641577246770`)
        .setDescription(`Congratulations, you've got 20 coins to add projects in uptimer bot.\n Add one using: \`,add <url>\`\nCheck Coins: \`,balance\``)
        .setFooter({ text: `Send From [${newMember.guild.name}]` , iconURL: newMember.guild.icon})
        .setColor("#ff52bf");

i did some experiments and i got to know that the problem is not in iconURL ,the problem is in text my theory - i removed iconURL and just kept the text and when i checked , the problem exist but when i removed text also , the problem gets solved so this means that the problem is in text and not in iconURL or proxyIconURL


Solution

  • The error is in iconURL. I wrote newMember.guild.icon which was returning a hash but for footer.iconURL it requires a URL. So the solution is newMember.guild.iconURL() which will return a URL.