Skip to main content

CommunityClient

CommunityClient: TypedEventEmitter<CommunityEvents> & object

Type declaration

edit()

Parameters

ParameterType
requestCommunityEditRequest

Returns

Promise<Community>

Example

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

export async function editExample(): Promise<Community> {
try {
// Set up the request
const request: CommunityEditRequest = {
name: "MyNewCommunityName",
pictureHex: "#FF0000",
updatePicture: false,
pictureTokenUri: undefined,
defaultChannelId: undefined,
rejectUnverifiedEmail: false,
};

// Call the API
const community: Community =
await rootServer.community.communities.edit(request);

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

get()

Returns

Promise<Community>

Example

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

export async function getExample(): Promise<Community> {
try {
// Call the API
const community: Community = await rootServer.community.communities.get();

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