mirror of
https://github.com/danbulant/discord.js
synced 2026-06-07 00:32:03 +00:00
fix fetching all members
This commit is contained in:
parent
c3d7c73e47
commit
51fe80fd11
2 changed files with 2 additions and 2 deletions
|
|
@ -139,7 +139,7 @@ class WebSocketConnection extends EventEmitter {
|
||||||
this.status = Constants.Status.NEARLY;
|
this.status = Constants.Status.NEARLY;
|
||||||
if (!this.client.options.fetchAllMembers) return this.triggerReady();
|
if (!this.client.options.fetchAllMembers) return this.triggerReady();
|
||||||
// Fetch all members before marking self as ready
|
// Fetch all members before marking self as ready
|
||||||
const promises = this.client.guilds.map(g => g.fetchMembers());
|
const promises = this.client.guilds.map(g => g.members.fetch());
|
||||||
Promise.all(promises)
|
Promise.all(promises)
|
||||||
.then(() => this.triggerReady())
|
.then(() => this.triggerReady())
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ class GuildCreateHandler extends AbstractHandler {
|
||||||
* @event Client#guildCreate
|
* @event Client#guildCreate
|
||||||
* @param {Guild} guild The created guild
|
* @param {Guild} guild The created guild
|
||||||
*/
|
*/
|
||||||
if (client.options.fetchAllMembers) await guild.fetchMembers();
|
if (client.options.fetchAllMembers) await guild.members.fetch();
|
||||||
client.emit(Constants.Events.GUILD_CREATE, guild);
|
client.emit(Constants.Events.GUILD_CREATE, guild);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue