mirror of
https://github.com/danbulant/discord.js
synced 2026-06-09 01:31:29 +00:00
Fix #1854
This commit is contained in:
parent
eb5ba4e45e
commit
5121a02f13
1 changed files with 3 additions and 3 deletions
|
|
@ -63,7 +63,7 @@ class GuildMemberStore extends DataStore {
|
||||||
*/
|
*/
|
||||||
fetch(options) {
|
fetch(options) {
|
||||||
if (!options) return this._fetchMany();
|
if (!options) return this._fetchMany();
|
||||||
const user = this.client.resolver.resolveUser(options);
|
const user = this.client.resolver.resolveUserID(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.client.resolver.resolveUser(options);
|
options.user = this.client.resolver.resolveUser(options);
|
||||||
|
|
@ -73,8 +73,8 @@ class GuildMemberStore extends DataStore {
|
||||||
}
|
}
|
||||||
|
|
||||||
_fetchSingle({ user, cache }) {
|
_fetchSingle({ user, cache }) {
|
||||||
if (this.has(user.id)) return Promise.resolve(this.get(user.id));
|
if (this.has(user)) return Promise.resolve(this.get(user));
|
||||||
return this.client.api.guilds(this.guild.id).members(user.id).get()
|
return this.client.api.guilds(this.guild.id).members(user).get()
|
||||||
.then(data => {
|
.then(data => {
|
||||||
if (cache) return this.create(data);
|
if (cache) return this.create(data);
|
||||||
else return new GuildMember(this, data);
|
else return new GuildMember(this, data);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue