You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Discord/Discord.php
+62-6Lines changed: 62 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1070,16 +1070,13 @@ protected function setupChunking()
1070
1070
$this->logger->debug('sending chunk with '.count($chunk).' large guilds');
1071
1071
1072
1072
foreach ($chunkas$guild_id) {
1073
-
$payload = Payload::new(
1074
-
Op::OP_GUILD_MEMBER_CHUNK,
1073
+
$this->requestGuildMembers(
1074
+
$guild_id,
1075
1075
[
1076
-
'guild_id' => $guild_id,
1077
1076
'query' => '',
1078
1077
'limit' => 0,
1079
-
],
1078
+
]
1080
1079
);
1081
-
1082
-
$this->send($payload);
1083
1080
}
1084
1081
$this->loop->addTimer(1, $sendChunks);
1085
1082
};
@@ -1137,6 +1134,65 @@ public function connectWs(): void
1137
1134
});
1138
1135
}
1139
1136
1137
+
/**
1138
+
* Requests guild members from the Discord gateway.
1139
+
*
1140
+
* @param Guild|string $guild_id ID of the guild or Guild object. Required.
1141
+
* @param array $options
1142
+
* @param string $options['query'] String that username starts with, or an empty string to return all members. Required when not including user_ids.
1143
+
* @param int $options['limit'] Maximum number of members to send matching the query. 0 with empty query returns all. Required when including a query.
1144
+
* @param ?bool|null $options['presences'] Whether to include presences of matched members.
1145
+
* @param ?string|array|null $options['user_ids'] Snowflake or array of snowflakes to specify which users to fetch. Required when not including a query.
1146
+
* @param ?string|null $options['nonce'] Nonce to identify the Guild Members Chunk response.
1147
+
*
1148
+
* @throws \InvalidArgumentException Either query or user_ids must be set.
0 commit comments