Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
createHotelHeroCard (hotel) {
return CardFactory.heroCard(
hotel.name,
`${hotel.rating} stars. ${hotel.numberOfReviews} reviews. From ${hotel.priceStarting} per night.`,
CardFactory.images([hotel.image]),
CardFactory.actions([
{
type: 'openUrl',
title: 'More details',
value: `https://www.bing.com/search?q=hotels+in+${encodeURIComponent(hotel.location)}`
}
])
);
}
value: element,
type: 'imBack',
title: element
});
});
cardActions.push({
value: cardNoMatchText,
type: 'imBack',
title: cardNoMatchText
});
var heroCard = CardFactory.heroCard(
cardTitle,
[],
CardFactory.actions(cardActions));
return { attachments: [heroCard] };
}
{
title: 'Data Transfer',
price: '$38.45',
quantity: 368,
image: { url: 'https://github.com/amido/azure-vector-icons/raw/master/renders/traffic-manager.png' }
},
{
title: 'App Service',
price: '$45.00',
quantity: 720,
image: { url: 'https://github.com/amido/azure-vector-icons/raw/master/renders/cloud-service.png' }
}
],
tax: '$7.50',
total: '$90.95',
buttons: CardFactory.actions([
{
type: 'openUrl',
title: 'More Information',
value: 'https://azure.microsoft.com/en-us/pricing/details/bot-service/'
}
])
})
}
private createAudioCard() {
return CardFactory.audioCard(
'I am your father',
['https://www.mediacollege.com/downloads/sound-effects/star-wars/darthvader/darthvader_yourfather.wav'],
CardFactory.actions([
{
title: 'Read more',
type: 'openUrl',
value: 'https://en.wikipedia.org/wiki/The_Empire_Strikes_Back'
}
]),
{
image: { url: 'https://upload.wikimedia.org/wikipedia/en/3/3c/SW_-_Empire_Strikes_Back.jpg', alt: '' },
subtitle: 'Star Wars: Episode V - The Empire Strikes Back',
text: 'The Empire Strikes Back (also known as Star Wars: Episode V – The Empire Strikes Back) is a 1980 American epic space opera film directed by Irvin Kershner. Leigh Brackett and Lawrence Kasdan wrote the screenplay, with George Lucas writing the film\'s story and serving as executive producer. The second installment in the original Star Wars trilogy, it was produced by Gary Kurtz for Lucasfilm Ltd. and stars Mark Hamill, Harrison Ford, Carrie Fisher, Billy Dee Williams, Anthony Daniels, David Prowse, Kenny Baker, Peter Mayhew and Frank Oz.'
}
);
}
private createHeroCard() {
return CardFactory.heroCard(
'BotFramework Hero Card',
CardFactory.images(['https://sec.ch9.ms/ch9/7ff5/e07cfef0-aa3b-40bb-9baa-7c9ef8ff7ff5/buildreactionbotframework_960.jpg']),
CardFactory.actions([
{
title: 'Get started',
type: 'openUrl',
value: 'https://docs.microsoft.com/en-us/azure/bot-service/'
}
])
);
}
public static adaptiveCardActions(actions: (CardAction | string)[] | undefined): IAdaptiveCardAction[] {
let botBuilderBtns = CardFactory.actions(actions);
let acActions: IAdaptiveCardAction[] = [];
for (let i = 0; i < botBuilderBtns.length; ++i) {
let btn = botBuilderBtns[i];
let adapterBtn: IAdaptiveCardAction = {
id: undefined,
type: 'Action.Submit',
title: btn.title,
data: {},
};
delete btn.title;
adapterBtn.data[ 'msteams' ] = btn;
acActions.push(adapterBtn);
}
return acActions;
}
function createHeroCard() {
return CardFactory.heroCard(
'BotFramework Hero Card',
CardFactory.images(['https://sec.ch9.ms/ch9/7ff5/e07cfef0-aa3b-40bb-9baa-7c9ef8ff7ff5/buildreactionbotframework_960.jpg']),
CardFactory.actions([
{
type: 'openUrl',
title: 'Get Started',
value: 'https://docs.microsoft.com/en-us/azure/bot-service/'
}
])
);
}
async sendWelcomeMessage(turnContext) {
const activity = turnContext.activity;
if (activity && activity.membersAdded) {
const heroCard = CardFactory.heroCard(
'Welcome to GraphAuthenticationBot!',
CardFactory.images(['https://botframeworksamples.blob.core.windows.net/samples/aadlogo.png']),
CardFactory.actions([
{
type: ActionTypes.ImBack,
title: 'Me',
value: 'me'
},
{
type: ActionTypes.ImBack,
title: 'Recent',
value: 'recent'
},
{
type: ActionTypes.ImBack,
title: 'View Token',
value: 'view Token'
},
{
function createAudioCard() {
return CardFactory.audioCard(
'I am your father',
['http://www.wavlist.com/movies/004/father.wav'],
CardFactory.actions([
{
type: 'openUrl',
title: 'Read More',
value: 'https://en.wikipedia.org/wiki/The_Empire_Strikes_Back'
}
]),
{
subtitle: 'Star Wars: Episode V - The Empire Strikes Back',
text: 'The Empire Strikes Back (also known as Star Wars: Episode V – The Empire Strikes Back) is a 1980 American epic space opera film directed by Irvin Kershner. Leigh Brackett and Lawrence Kasdan wrote the screenplay, with George Lucas writing the film\'s story and serving as executive producer. The second installment in the original Star Wars trilogy, it was produced by Gary Kurtz for Lucasfilm Ltd. and stars Mark Hamill, Harrison Ford, Carrie Fisher, Billy Dee Williams, Anthony Daniels, David Prowse, Kenny Baker, Peter Mayhew and Frank Oz.',
image: 'https://upload.wikimedia.org/wikipedia/en/3/3c/SW_-_Empire_Strikes_Back.jpg'
}
);
}
createAudioCard() {
return CardFactory.audioCard(
'I am your father',
['https://www.mediacollege.com/downloads/sound-effects/star-wars/darthvader/darthvader_yourfather.wav'],
CardFactory.actions([
{
type: 'openUrl',
title: 'Read more',
value: 'https://en.wikipedia.org/wiki/The_Empire_Strikes_Back'
}
]),
{
subtitle: 'Star Wars: Episode V - The Empire Strikes Back',
text: 'The Empire Strikes Back (also known as Star Wars: Episode V – The Empire Strikes Back) is a 1980 American epic space opera film directed by Irvin Kershner. Leigh Brackett and Lawrence Kasdan wrote the screenplay, with George Lucas writing the film\'s story and serving as executive producer. The second installment in the original Star Wars trilogy, it was produced by Gary Kurtz for Lucasfilm Ltd. and stars Mark Hamill, Harrison Ford, Carrie Fisher, Billy Dee Williams, Anthony Daniels, David Prowse, Kenny Baker, Peter Mayhew and Frank Oz.',
image: 'https://upload.wikimedia.org/wikipedia/en/3/3c/SW_-_Empire_Strikes_Back.jpg'
}
);
}