Ashy Ashcsi
Ashy Ashcsi

Reputation: 1597

emoticons or images with buttons in ms botframework nodejs sdk version 3

I want to display image beside button rendered using builder.Prompts. Please find the code below:

builder.Prompts.choice(session, 'Is it useful ?', 'Yes|No', { maxRetries: 0 });

How do I add image url or emoticon beside these options ? Is it possible to add an image here ?

Thanks

Upvotes: 0

Views: 157

Answers (1)

Mick
Mick

Reputation: 3024

On which channel is your bot active? Using images isn't supported on most channels, the use of emojis is supported. You can just add emojis in your code since it is just unicode, but the rendering can be different per channel. Or use a package like node-emoji to insert them.

const options = ['Option 1 😉', 'Option 2 😎']; builder.Prompts.choice(session, 'Is it useful ?', options, { maxRetries: 0 });

Instead of using a string separated by pipes (|), I prefer to use an array with all choice options.

Upvotes: 1

Related Questions