Experimental ClientOptions.fetch_all_members

This commit is contained in:
Amish Shah
2016-08-29 13:54:29 +01:00
parent 001460acc0
commit 144638e746
7 changed files with 52 additions and 15 deletions

View File

@@ -582,6 +582,9 @@ class Guild {
if (this._fetchWaiter) {
throw new Error('already fetching guild members');
}
if (this.memberCount === this.members.size) {
return resolve(this);
}
this._fetchWaiter = resolve;
this.client.ws.send({
op: Constants.OPCodes.REQUEST_GUILD_MEMBERS,
@@ -592,7 +595,7 @@ class Guild {
},
});
this._checkChunks();
setTimeout(() => reject(new Error('members not here in time')), 10000);
setTimeout(() => reject(new Error('members not here in time')), 120 * 1000);
});
}