FileTranscriptStore class

ファイル トランスクリプト ストアは、各アクティビティをファイルとして使用してファイル システムにトランスクリプトを格納します。

注釈

このクラスは、すべての受信アクティビティと送信アクティビティをファイルシステムに記録するインターフェイスを提供します。 TranscriptLoggerMiddleware プラグインと共に動作するために必要な機能を実装します。 一致して使用すると、ボットはすべての会話を自動的にログに記録します。

アプリでこれを使用するために必要な定型コードを次に示します。

const { FileTranscriptStore, TranscriptLoggerMiddleware } = require('botbuilder');

adapter.use(new TranscriptLoggerMiddleware(new FileTranscriptStore(__dirname + '/transcripts/')));

コンストラクター

FileTranscriptStore(string)

FileTranscriptStore のインスタンスを作成します。

メソッド

deleteTranscript(string, string)

会話とそのすべてのアクティビティを削除します。

getTranscriptActivities(string, string, string, Date)

会話 ID に関連付けられているすべてのアクティビティを取得します (トランスクリプトの取得とも呼ばれます)。

listTranscripts(string, string)

特定の channelId に対してログに記録されたすべての会話を一覧表示します。

logActivity(Activity)

トランスクリプトにアクティビティを記録します。

コンストラクターの詳細

FileTranscriptStore(string)

FileTranscriptStore のインスタンスを作成します。

new FileTranscriptStore(folder: string)

パラメーター

folder

string

トランスクリプトが格納されるルート フォルダー。

メソッドの詳細

deleteTranscript(string, string)

会話とそのすべてのアクティビティを削除します。

function deleteTranscript(channelId: string, conversationId: string): Promise<void>

パラメーター

channelId

string

会話が行われたチャネル ID。

conversationId

string

削除する会話の ID。

戻り値

Promise<void>

非同期操作を表す promise。

getTranscriptActivities(string, string, string, Date)

会話 ID に関連付けられているすべてのアクティビティを取得します (トランスクリプトの取得とも呼ばれます)。

function getTranscriptActivities(channelId: string, conversationId: string, continuationToken?: string, startDate?: Date): Promise<PagedResult<Activity>>

パラメーター

channelId

string

チャネル ID。

conversationId

string

会話 ID。

continuationToken

string

(省略可能)結果をページングする継続トークン。

startDate

Date

(省略可能)含める最も早い時刻。

戻り値

Promise<PagedResult<Activity>>

アクティビティの PagedResult。

listTranscripts(string, string)

特定の channelId に対してログに記録されたすべての会話を一覧表示します。

function listTranscripts(channelId: string, continuationToken?: string): Promise<PagedResult<TranscriptInfo>>

パラメーター

channelId

string

チャネル ID。

continuationToken

string

(省略可能)結果をページングする継続トークン。

戻り値

Promise<PagedResult<TranscriptInfo>>

トランスクリプトの PagedResult。

logActivity(Activity)

トランスクリプトにアクティビティを記録します。

function logActivity(activity: Activity): Promise<void>

パラメーター

activity

Activity

ログに記録されているアクティビティ。

戻り値

Promise<void>

非同期操作を表す promise。