-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Labels
Description
Hi,
Glad to see community js examples popping up!
I am trying to implement an adaptive card prompt inside of dialogs, but I cannot seem to replicate the brief example in the documentation mentioned here.
The code below is the run method of my top-level dialog.
public async run(turnContext: TurnContext, accessor: StatePropertyAccessor<DialogState>) {
const cardJson = require('./cards/test.json');
const card = CardFactory.adaptiveCard(cardJson);
const promptSettings: AdaptiveCardPromptSettings = {
card: card,
requiredInputIds: ['inputA', 'inputB'],
promptId: 'myCustomId',
};
const adaptiveCardPrompt = new AdaptiveCardPrompt(
'adaptiveCardPrompt',
promptSettings
);
const dialogSet = new DialogSet(accessor);
//@ts-ignore -- see error below
dialogSet.add(adaptiveCardPrompt);
dialogSet.add(this);
const dialogContext = await dialogSet.createContext(turnContext);
const results = await dialogContext.continueDialog();
if (results.status === DialogTurnStatus.empty) {
await dialogContext.beginDialog(this.id);
}
}
I get a runtime error: DialogSet.add(): Invalid dialog being added
Typescript error:
Argument of type 'AdaptiveCardPrompt' is not assignable to parameter of type 'Dialog<{}>'.
Type 'AdaptiveCardPrompt' is missing the following properties from type 'Dialog<{}>': onPreBubbleEventAsync, onPostBubbleEventAsync, hashedLabelts(2345)
Any workarounds, suggestions or solutions will be appreciated!