Skip to main content

CommunityMemberClient

CommunityMemberClient: TypedEventEmitter<CommunityMemberEvents> & object

Type declaration

get()

Parameters

ParameterType
requestCommunityMemberGetRequest

Returns

Promise<CommunityMember>

Example

import {
CommunityMember,
CommunityMemberGetRequest,
UserGuid,
rootServer,
} from "@rootsdk/server-bot";

export async function getExample(userId: UserGuid): Promise<CommunityMember> {
try {
// Set up the request
const request: CommunityMemberGetRequest = {
userId: userId,
};

// Call the API
const communityMember: CommunityMember =
await rootServer.community.communityMembers.get(request);

return communityMember;
} catch (error) {
// Detect error
throw error;
}
}

list()

Parameters

ParameterType
requestCommunityMemberListRequest

Returns

Promise<CommunityMember[]>

Example

import {
CommunityMember,
CommunityMemberListRequest,
UserGuid,
rootServer,
} from "@rootsdk/server-bot";

export async function listExample(
userIds: UserGuid[],
): Promise<CommunityMember[]> {
try {
// Set up the request
const request: CommunityMemberListRequest = {
userIds: userIds,
};
// Call the API
const CommunityMembers: CommunityMember[] =
await rootServer.community.communityMembers.list(request);

return CommunityMembers;
} catch (error) {
// Detect error
throw error;
}
}

listAll()

Returns

Promise<CommunityMember[]>

Example

import { CommunityMember, rootServer } from "@rootsdk/server-bot";

export async function listAllExample(): Promise<CommunityMember[]> {
try {
// Call the API
const CommunityMembers: CommunityMember[] =
await rootServer.community.communityMembers.listAll();

return CommunityMembers;
} catch (error) {
// Detect error
throw error;
}
}