Skip to content

Commit

Permalink
fix: typings for server member broke in recent api release
Browse files Browse the repository at this point in the history
  • Loading branch information
insertish committed Mar 15, 2024
1 parent a4906f9 commit 6355792
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
10 changes: 1 addition & 9 deletions src/classes/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
10 changes: 7 additions & 3 deletions src/collections/ServerMemberCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 6355792

Please sign in to comment.