I'm trying to make a Discord bot send all of the server owner's ids and usernames in one embed. This is my current code:
else if (command === '!test'){
const owners = client.guilds.cache.forEach(guild => console.log('<@' + guild.ownerID + '>'));
const owners1 = JSON.stringify(owners)
const embed = new Discord.MessageEmbed()
.setColor('#fc2eff')
.setTitle('Owners who added bartt')
.setDescription(owners1)
.setTimestamp();
msg.channel.send(embed);
}
it logs the ids to console which is what I need but I want to show them in an embed not just console.
I'd rather log Discord names and not ids purely for the fact Discord doesn't always show users from their id.