Skip to content

Commit

Permalink
chore: add helper method for resolving server member
Browse files Browse the repository at this point in the history
  • Loading branch information
insertish committed Oct 15, 2023
1 parent 534d15a commit a41c40b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/classes/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,18 @@ export class Server {
);
}

/**
* Helper function to retrieve cached server member by their ID in this server
* @param userId User's ID
* @returns Server Member (if cached)
*/
getMember(userId: string) {
return this.#collection.client.serverMembers.getByKey({
server: this.id,
user: userId,
});
}

/**
* Create a channel
* @param data Channel create route data
Expand Down

0 comments on commit a41c40b

Please sign in to comment.