type2docfx
Version:
A tool to convert json format output from TypeDoc to universal reference model for DocFx to consume.
18 lines (14 loc) • 715 B
text/typescript
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import { Activity, TurnContext, ActivityTypes, InputHints } from 'botbuilder';
export function sendPrompt(context: TurnContext, prompt: string|Partial<Activity>, speak?: string): Promise<void> {
// Compose activity
const msg: Partial<Activity> = typeof prompt === 'string' ? { text: prompt } : Object.assign({}, prompt);
if (speak) { msg.speak = speak }
if (!msg.type) { msg.type = ActivityTypes.Message }
if (!msg.inputHint) { msg.inputHint = InputHints.ExpectingInput }
// Send activity and eat response.
return context.sendActivity(msg).then(() => { });
}