0

So I want to get the name of all the discord server owners that my bot is in. Discord.js v14

I tried using this:

const Guilds = client.guilds.cache.map(guild => guild.fetchOwner());
console.log(Guilds);

But it returned me this: Promise { <pending> }

I also tried this: Get server owners from what servers the bot is in, but it does not work on discord.js v14

MrMythical
  • 8,908
  • 2
  • 17
  • 45
Vasilis
  • 5
  • 3

1 Answers1

1

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);
Androz2091
  • 2,931
  • 1
  • 9
  • 26