Skip to content

Commit

Permalink
when fetch_all_members is enabled, new guilds should also do that (#623)
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
Gus Caplan authored and Gawdl3y committed Sep 7, 2016
1 parent ab4707f commit b9caa2e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/client/ClientDataManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ class ClientDataManager {
* @event Client#guildCreate
* @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;
Expand Down

0 comments on commit b9caa2e

Please sign in to comment.