Bot replies do not have to be text only, you can also include links, images, GIFs, videos.
Note that that bot preview in Studio does not show media, these will need to be tested manually in the live widget.
Adding links
To add a link in the reply, you can specify the URL to link to, and the text that would appear in the reply. For example to have the text "LeadDesk website" appear, linking to our website, use:
[link src='https://leaddesk.com' text='LeadDesk website']
Replace the value for src and text as needed, making sure to keep the single quotes around them.
Adding images
To include an image you will need the direct URL for the image you want to use. You can usually find this by:
- Right-click the image on a website and selecting Open image in a new tab.
- Go to the new tab, and copy the URL from the address bar.
Use that URL as the src in the following format:
[image src='https://i.pinimg.com/originals/c4/fc/9b/c4fc9b9ba1044adfa1fda7a93da82088.jpg']
The asset will be shown in the webchat widget as an independent message:
Setting the width
You can set the width for any media included in the responses. Add the parameter width and a value into the code, for example:
[image src='https://i.pinimg.com/originals/c4/fc/9b/c4fc9b9ba1044adfa1fda7a93da82088.jpg'
width 200]
Adding GIFs
If you are using Giphy for .gifs, these can be included in the same way as images. Here, you should be careful to uses the media link for the GIF.
Adding videos
For videos, use video rather than image. Again, the src should be the URL of the video, specifically the embed URL.
[video src='https://www.youtube.com/embed/zsnXbwMoHBg']
Finding the embed URL of a YouTube video
The URL of the YouTube video must include /embed/. To find the link to copy and paste:
- Click the Share button underneath the video on YouTube.
- In the Share dialog, click the Embed button.
- Copy the URL from the Embed video dialog.
- Paste the link into the chatbot reply, using the format described above.