'DiscordJS - Fetch Multiple Users at Once

Instead if fetching every user by itself, I am trying to fetch an array of users at once.

This is the code I am trying to use:

var idsArr= ['682999909523259483','234269235071811584','503303866016727050'];
  
    
const membersArr = await interaction.guild.members.fetch({
    idsArr,
});
    
console.log(membersArr);

Even though I only give it an array of 3 IDs, it logs every member of the server. Any suggestion on how to fix that?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source