I'm attempting to create a Discord bot that can send all the server owner's IDs and usernames in a single embed. Here is the code I currently have:
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);
}
The current code logs the IDs to the console, which is useful, but I would prefer to display them in an embed rather than just the console.
My preference is to log the Discord names instead of the IDs, as Discord does not always show users by their ID alone.