Format Embed Description

I'm having trouble formatting an embed leaderboard with the embed builder. I have the following for my embed description, which is part of a loop that goes through a sorted array. It works, but for the bold user, the colon onwards is on a new line.
if (topTenUsers[i].id == interaction.user.id){
description += `**${i+1}. ${member.displayName}**: ${formattedData} [(i)](${interaction.channel.url} "${lbData}")\n`
} else {
description += `${i+1}. ${member.displayName}: ${formattedData} [(i)](${interaction.channel.url} "${lbData}")\n`
}
if (topTenUsers[i].id == interaction.user.id){
description += `**${i+1}. ${member.displayName}**: ${formattedData} [(i)](${interaction.channel.url} "${lbData}")\n`
} else {
description += `${i+1}. ${member.displayName}: ${formattedData} [(i)](${interaction.channel.url} "${lbData}")\n`
}
I've attached a couple of examples of the output, one of which shows that even when the embed is wide enough to fit the whole line, it still splits it. Have I missed something obvious? Thanks 🙂
No description
No description
2 Replies
d.js toolkit
d.js toolkit•11mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Millman97
Millman97OP•11mo ago
Awesome, thanks for the help GWcmeisterPeepoLove
Want results from more Discord servers?
Add your server