Skip to main content

Interface: IChatSessionService

services.IChatSessionService

Table of contents

Methods

Methods

addAuxiliaryBar

addAuxiliaryBar(auxiliaryBar, component): void

Adds a new auxiliary bar to the chat window

Parameters

NameType
auxiliaryBarIAuxiliaryData
componentReactNode

Returns

void

Defined in

src/services/chat.ts:167


addPlusButtonAction

addPlusButtonAction(action): void

Adds a new action to the plus button menu

Parameters

NameType
actionISubMenuProps

Returns

void

Defined in

src/services/chat.ts:175


changeMemberSettings

changeMemberSettings(memberId, settings): void

Change the settings of a chat member

Parameters

NameTypeDescription
memberIdstringThe id of the member
settingsChatMemberSettingThe new settings (It will only override the settings specified in the object, settings that are not specified will remain the same)

Returns

void

Defined in

src/services/chat.ts:182


getBrains

getBrains(): IBrainClient[]

Gets all brains that are in the chat.

Returns

IBrainClient[]

Defined in

src/services/chat.ts:147


getMembers

getMembers(): ChatMember[]

Gets all the chat members

Returns

ChatMember[]

Defined in

src/services/chat.ts:187


messages

messages(): Promise\<ChatMessage[]>

Gets all the chat messages

Returns

Promise\<ChatMessage[]>

Defined in

src/services/chat.ts:152


onMessageReceived

onMessageReceived(callback): void

Subscribe to onMessageReceived event

Parameters

NameType
callback(message: ChatMessage) => void

Returns

void

Defined in

src/services/chat.ts:157


onMessageUpdated

onMessageUpdated(callback): void

Subscribe to onMessageUpdated event

Parameters

NameType
callback(message: ChatMessage) => void

Returns

void

Defined in

src/services/chat.ts:162


sendMessage

sendMessage(options): Promise\<boolean>

Sends a message to the chat.

Parameters

NameTypeDescription
optionsSendChatMessageOptionsMessage options

Returns

Promise\<boolean>

True if the message was sent successfully, false otherwise.

Defined in

src/services/chat.ts:142