when fetch_all_members is enabled, new guilds should also do that (#623)

* when fetch_all_members is enabled, new guilds should also do that

* Fix Gus' derp (#1)

* Fix my derp (#2)

* Fix another of Gus' derps (#3)
This commit is contained in:
Gus Caplan
2016-09-06 23:43:06 -05:00
committed by Schuyler Cebulskie
parent ab4707f9b4
commit b9caa2ee5d

View File

@@ -27,7 +27,11 @@ class ClientDataManager {
* @event Client#guildCreate * @event Client#guildCreate
* @param {Guild} guild The created guild * @param {Guild} guild The created guild
*/ */
this.client.emit(Constants.Events.GUILD_CREATE, guild); if (this.client.options.fetch_all_members) {
guild.fetchMembers().then(() => { this.client.emit(Constants.Events.GUILD_CREATE, guild); });
} else {
this.client.emit(Constants.Events.GUILD_CREATE, guild);
}
} }
return guild; return guild;