forked from microsoft/BotBuilder-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cardResponseHelpers.js
32 lines (28 loc) · 943 Bytes
/
cardResponseHelpers.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
const { MessageFactory, InputHints } = require('botbuilder');
class CardResponseHelpers {
static toTaskModuleResponse(cardAttachment) {
return {
task: {
type: 'continue',
value: {
card: cardAttachment,
height: 450,
title: 'Task Module Fetch Example',
url: null,
width: 500
}
}
};
}
static toMessagingExtensionBotMessagePreviewResponse(cardAttachment) {
return {
composeExtension: {
activityPreview: MessageFactory.attachment(cardAttachment, null, null, InputHints.ExpectingInput),
type: 'botMessagePreview'
}
};
}
}
exports.CardResponseHelpers = CardResponseHelpers;