So i want to get the name of all the discord server owners that my bot is in. DiscordJs v14
I tried using this: `
const Guilds = client.guilds.cache.map(guild => guild.fetchOwner());
console.log(Guilds);
But it returned me this:
Promise { }`
I also saw tried this: Get server owners from what servers the bot is in but it does not work on discordjs v14
CodePudding user response:
You have to use Promise#all()
to wait for all the promises to resolve
const owners = await Promise.all(client.guilds.cache.map(guild => guild.fetchOwner()));
console.log(owners);