I know this is a very very dumb question, but I'm very tired and just cant seem to come up with an idea to fix this:
const fetched = filteredResult.sort((a, b) => b.data - a.data).slice(0, 10)
const fetchUser = async id => client.users.fetch(id);
message.channel.send(
new Discord.MessageEmbed()
.setTitle("Pp Leaderboard")
.setColor(roleColor === "#000000" ? "#ffffff" : roleColor)
.setDescription(
fetched.map((v, i) => {
v.ID = v.ID.replace("globalMessages_", "");
return `#${i + 1} **${fetchUser(v.ID).then(user => { user.tag })}** with ${commaNumber(v.data)} thanks\n`;
})
)
)
This is a thanks leaderboard command ^^^. It shows top ten global rankings.
Don't worry about the other stuff - only about fetchUser(v.ID)... Once I do the command it returns an embed with the text and then in the place with fetchUser it shows [Object promise].
I want it somehow to return the tag of that discord user in that place. Thank you in advance!