I'm doing a lot of commands that are fetching for a target user and I'm using atm these functions : -
client.users.fetch(id);
client.users.fetch(id);
-
message.guild.members.fetch(targetUserId);
message.guild.members.fetch(targetUserId);
However I realize that this one throws exceptions when it does not find any user which I find a bit disturbing (putting try-catch everywhere is not very fun)
I also see some peoples fetching from the cache of the client or the guild and fetch in this way does not seem to generate an Exception.
But before going from one to the other way, I would like to know what is the difference between cached and non-cached data. Is there even one ? And does this somehow impact the search for