mirror of
https://github.com/stoatchat/javascript-client-sdk.git
synced 2026-07-19 17:13:31 -04:00
feat: add a way to skip offline users when syncing members
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"type": "module",
|
||||
"name": "revolt.js",
|
||||
"version": "5.2.4",
|
||||
"version": "5.2.5",
|
||||
"main": "dist/index.js",
|
||||
"repository": "https://github.com/revoltchat/revolt.js",
|
||||
"author": "Paul Makles <insrt.uk>",
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
export const LIBRARY_VERSION = "5.2.4";
|
||||
export const LIBRARY_VERSION = "5.2.5";
|
||||
|
||||
export const defaultConfig = {
|
||||
apiURL: "https://api.revolt.chat",
|
||||
|
||||
+3
-1
@@ -310,7 +310,7 @@ export class Server {
|
||||
* Optimised member fetch route.
|
||||
* ! OPTIMISATION
|
||||
*/
|
||||
async syncMembers() {
|
||||
async syncMembers(skipOffline?: boolean) {
|
||||
const data = await this.client.req(
|
||||
"GET",
|
||||
`/servers/${this._id}/members` as "/servers/id/members",
|
||||
@@ -330,6 +330,8 @@ export class Server {
|
||||
}
|
||||
}
|
||||
|
||||
if (skipOffline) return;
|
||||
|
||||
let j = 0;
|
||||
// Each batch takes between 70 and 90ms.
|
||||
const batch = () => {
|
||||
|
||||
Reference in New Issue
Block a user