Share via


TeamsAttachmentDownloader class

Downloads attachments from Teams using the bots access token.

Constructors

TeamsAttachmentDownloader<TState>(string)

Methods

downloadAndStoreFiles(TurnContext, TState)

Downloads files from the attachments in the current turn context and stores them in state.

downloadFiles(TurnContext)

Download any files relative to the current user's input.

Constructor Details

TeamsAttachmentDownloader<TState>(string)

new TeamsAttachmentDownloader(stateKey?: string)

Parameters

stateKey

string

Method Details

downloadAndStoreFiles(TurnContext, TState)

Downloads files from the attachments in the current turn context and stores them in state.

function downloadAndStoreFiles(context: TurnContext, state: TState): Promise<void>

Parameters

context
TurnContext

The turn context containing the activity with attachments.

state

TState

The turn state to store the files in.

Returns

Promise<void>

A promise that resolves when the downloaded files are stored.

downloadFiles(TurnContext)

Download any files relative to the current user's input.

function downloadFiles(context: TurnContext): Promise<InputFile[]>

Parameters

context
TurnContext

Context for the current turn of conversation.

Returns

Promise<InputFile[]>

Promise that resolves to an array of downloaded input files.