提供: Bright Pattern Documentation
• English
removeFromChatConference
チャットから別のエージェントを消去します。interactionId が指定されていない場合は、アクティブなインタラクションに対して処理が行われます。
リクエスト
構文
| removeFromChatConference(partyId: string, interactionId?: string): Promise<OperationResult<null>> |
パラメータ
| パラメータ | パラメータ値 | データ型 | オプション/必須 | 説明 |
| partyId | 文字列 | 必須 | チャットから消去しようとしているチャット参加者のidです。このidは、メソッド「inviteToChatConference」を使用してユーザーを追加する際に使用されるidとは異なります。 正しい id は、インタラクションのプロパティ「chatParties」から取得できます。このプロパティは、インタラクションに関連するイベント(ON_INTERACTION_STATE_CHANGE など)をサブスクライブすることで取得できます。 | |
| interactionId | 文字列 | オプション | 参加者を消去したいチャットインタラクションの id です。特定されていませんなら、アクティブなインタラクションが使用されます。 |
リクエスト例
const interactionsMap = {};
let activeInteractionId = null;
adApi.on("ON_NEW_INTERACTION", interaction => {
interactionsMap[interaction.id] = interaction
})
adApi.on("ON_INTERACTION_STATE_CHANGE", interaction => {
interactionsMap[interaction.id] = interaction
})
adApi.on("ON_INTERACTION_REMOVED", interaction => {
interactionsMap[interaction.id] を削除します
})
adApi.on('ON_ACTIVE_INTERACTION_SWITCHED', interactionId => {
activeInteractionId = interactionId
})
function removeLastChatParty() {
const activeChatParties = interactionsMap[activeInteractionId].chatParties
const lastChatParty = activeChatParties[activeChatParties.length - 1]
adApi.removeFromChatConference(lastChatParty.id, activeInteractionId)
}
戻り値
null