diff --git a/src/classes/Server.ts b/src/classes/Server.ts index d4d6933a..f49fb829 100644 --- a/src/classes/Server.ts +++ b/src/classes/Server.ts @@ -578,15 +578,7 @@ export class Server { }); if (existing) return existing; - - const member = await this.#collection.client.api.get( - `/servers/${this.id as ""}/members/${userId as ""}` - ); - - return this.#collection.client.serverMembers.getOrCreate( - member._id, - member - ); + return this.#collection.client.serverMembers.fetch(this.id, userId); } #synced: undefined | "partial" | "full"; diff --git a/src/collections/ServerMemberCollection.ts b/src/collections/ServerMemberCollection.ts index fd6c25d5..958e45e8 100644 --- a/src/collections/ServerMemberCollection.ts +++ b/src/collections/ServerMemberCollection.ts @@ -38,9 +38,13 @@ export class ServerMemberCollection extends ClassCollection< const member = this.get(serverId + userId); if (member) return member; - const data = await this.client.api.get( - `/servers/${serverId as ""}/members/${userId as ""}` - ); + const data = (await this.client.api.get( + `/servers/${serverId as ""}/members/${userId as ""}`, + { + roles: false, + } + // TODO: fix typings in revolt-api + )) as API.Member; return this.getOrCreate(data._id, data); }