mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 17:13:31 +01:00
allow users and members to not be cached (#1097)
This commit is contained in:
@@ -270,11 +270,12 @@ class Client extends EventEmitter {
|
||||
* Caches a user, or obtains it from the cache if it's already cached.
|
||||
* <warn>This is only available when using a bot account.</warn>
|
||||
* @param {string} id The ID of the user to obtain
|
||||
* @param {boolean} [cache=true] Insert the user into the users cache
|
||||
* @returns {Promise<User>}
|
||||
*/
|
||||
fetchUser(id) {
|
||||
fetchUser(id, cache = true) {
|
||||
if (this.users.has(id)) return Promise.resolve(this.users.get(id));
|
||||
return this.rest.methods.getUser(id);
|
||||
return this.rest.methods.getUser(id, cache);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user