Skip to content

Commit

Permalink
Fix requestGuildMembers guard checks (#1052)
Browse files Browse the repository at this point in the history
  • Loading branch information
Snazzah authored Nov 29, 2020
1 parent fb06856 commit 6c6abb6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/gateway/Shard.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,12 @@ class Shard extends EventEmitter {
if(!opts.user_ids && !opts.query) {
opts.query = "";
}
if(!opts.query && (this.client.options.intents && !(this.client.options.intents & Constants.Intents.guildMembers))) {
if(!opts.query && !opts.user_ids && (this.client.options.intents && !(this.client.options.intents & Constants.Intents.guildMembers))) {
throw new Error("Cannot request all members without guildMembers intent");
}
if(opts.presences && (this.client.options.intents && !(this.client.options.intents & Constants.Intents.guildPresences))) {
throw new Error("Cannot request members presences without guildPresences intent");
}
if(opts.user_ids && opts.user_ids.length > 100) {
throw new Error("Cannot request more than 100 users by their ID");
}
Expand Down

0 comments on commit 6c6abb6

Please sign in to comment.