mirror of
https://github.com/danbulant/discord.js
synced 2026-07-06 03:31:03 +00:00
Webpack build for branch master: c2029a66e9
This commit is contained in:
parent
3ac13f5363
commit
cbb058a322
2 changed files with 5 additions and 4 deletions
|
|
@ -24315,17 +24315,18 @@ class GuildMemberStore extends DataStore {
|
||||||
*/
|
*/
|
||||||
fetch(options) {
|
fetch(options) {
|
||||||
if (!options) return this._fetchMany();
|
if (!options) return this._fetchMany();
|
||||||
const user = this.resolveID(options);
|
const user = this.client.users.resolveID(options);
|
||||||
if (user) return this._fetchSingle({ user, cache: true });
|
if (user) return this._fetchSingle({ user, cache: true });
|
||||||
if (options.user) {
|
if (options.user) {
|
||||||
options.user = this.resolveID(options.user);
|
options.user = this.client.users.resolveID(options.user);
|
||||||
if (options.user) return this._fetchSingle(options);
|
if (options.user) return this._fetchSingle(options);
|
||||||
}
|
}
|
||||||
return this._fetchMany(options);
|
return this._fetchMany(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
_fetchSingle({ user, cache }) {
|
_fetchSingle({ user, cache }) {
|
||||||
if (this.has(user)) return Promise.resolve(this.get(user));
|
const existing = this.get(user);
|
||||||
|
if (existing) return Promise.resolve(existing);
|
||||||
return this.client.api.guilds(this.guild.id).members(user).get()
|
return this.client.api.guilds(this.guild.id).members(user).get()
|
||||||
.then(data => this.create(data, cache));
|
.then(data => this.create(data, cache));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
discord.master.min.js
vendored
2
discord.master.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue