fetch users
I'm developing a team system in my Discord bot, where each team can have multiple users. Now I want to create a select menu to remove users who are already in a team.
The idea is to fetch these users to dynamically build the menu, but since a team can have many users, I'm pretty sure this will hit the Discord API rate limits. Has anyone faced a similar issue or has suggestions on how to handle this in the best way?
I was trying to use interaction.guild.members.fetch by passing an array of users, but this only works for users in the server, which is also a problem.
7 Replies
if you call fetch on a user that's already cached it'll return the cached one, it won't fetch
so, is <Guild>.members.fetch() the best choice?
but this only works for users in the serveryou mentioned this, so my guess is that you want to fetch users, not members it'd be <Client>.users.fetch() instead
lol yeah sorry
tysm
what if you want updates information
bots receive updates of users they share servers with via the userUpdate event
so those will already be up to date
if it's an arbitrary user then yeah you might want to force the fetch