FileTranscriptStore class

The file transcript store stores transcripts in file system with each activity as a file.

Remarks

This class provides an interface to log all incoming and outgoing activities to the filesystem. It implements the features necessary to work alongside the TranscriptLoggerMiddleware plugin. When used in concert, your bot will automatically log all conversations.

Below is the boilerplate code needed to use this in your app:

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

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

Constructors

FileTranscriptStore(string)

Creates an instance of FileTranscriptStore.

Methods

deleteTranscript(string, string)

Delete a conversation and all of it's activities.

getTranscriptActivities(string, string, string, Date)

Get all activities associated with a conversation id (aka get the transcript).

listTranscripts(string, string)

List all the logged conversations for a given channelId.

logActivity(Activity)

Log an activity to the transcript.

Constructor Details

FileTranscriptStore(string)

Creates an instance of FileTranscriptStore.

new FileTranscriptStore(folder: string)

Parameters

folder

string

Root folder where transcript will be stored.

Method Details

deleteTranscript(string, string)

Delete a conversation and all of it's activities.

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

Parameters

channelId

string

Channel Id where conversation took place.

conversationId

string

Id of the conversation to delete.

Returns

Promise<void>

A promise representing the asynchronous operation.

getTranscriptActivities(string, string, string, Date)

Get all activities associated with a conversation id (aka get the transcript).

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

Parameters

channelId

string

Channel Id.

conversationId

string

Conversation Id.

continuationToken

string

(Optional) Continuation token to page through results.

startDate

Date

(Optional) Earliest time to include.

Returns

Promise<PagedResult<Activity>>

PagedResult of activities.

listTranscripts(string, string)

List all the logged conversations for a given channelId.

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

Parameters

channelId

string

Channel Id.

continuationToken

string

(Optional) Continuation token to page through results.

Returns

Promise<PagedResult<TranscriptInfo>>

PagedResult of transcripts.

logActivity(Activity)

Log an activity to the transcript.

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

Parameters

activity

Activity

Activity being logged.

Returns

Promise<void>

a promise representing the asynchronous operation.