Skip to main content
Community site session details

Community site session details

Session Id : 30ZJvALivPdBHj8WdFOOYB
Copilot Studio - General
Answered

Bot Avatar and User Avatar images not working

Like (0) ShareShare
ReportReport
Posted on 26 Aug 2020 05:06:49 by

Hi,

Bot and User Avatar images are not working. Does anybody know how to fix this?

Please refer to the below code and snapshot

 

a3.png

 

<!DOCTYPE html>
<html>
<head>
 <title>Contoso Sample Web Chat</title>
 <!-- This styling is for the canvas demonstration purposes. It is recommended
that style is moved to separate file for organization in larger projects -->
 <style>
 html, body {
 height: 100%;
 }
 body {
 margin: 0;
 }
 h1 {
 font-size: 16px;
 font-family: Segoe UI;
 line-height: 20px;
 color: whitesmoke;
 display: table-cell;
 padding: 13px 0px 0px 20px;
 }
 #heading {
 background-color: black;
 height: 50px;
 }
 .main {
 margin: 18px;
 border-radius: 4px;
 }

 div[role="form"]{
 background-color: black;
 }
 #webchat {
 position: fixed;
 height: calc(100% - 50px);
 width: 100%;
 top: 50px;
 overflow: hidden;
 }
 </style>
</head>
<body>
 <div>
 <div id="heading">

 <!-- Change the h1 text to change the bot name -->
 <h1>Contoso Bot Name</h1>

 </div>
 <div id="webchat" role="main"></div>
 </div>
 <script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
 <script>
 const styleOptions = {
 botAvatarImage:'https://image.flaticon.com/icons/svg/639/639365.svg',
 userAvatarImage: 'https://image.flaticon.com/icons/svg/189/189093.svg',
 // Add styleOptions to customize web chat canvas
 hideUploadButton: true
 };

 // Add your BOT ID below
 var BOT_ID = "ABC";

 var theURL = "https://powerva.microsoft.com/api/botmanagement/v1/directline/directlinetoken?botId=" + BOT_ID;

 fetch(theURL)
 .then(response => response.json())
 .then(conversationInfo => {
 window.WebChat.renderWebChat(
 {
 directLine: window.WebChat.createDirectLine({
 token: conversationInfo.token,
 }),
 styleOptions
 },
 document.getElementById('webchat')
 );
 })
 .catch(err => console.error("An error occurred: " + err));
 </script>
 </body>
</html>

 

 Regards,

Hemanth

Categories:
  • Community Power Platform Member Profile Picture
    on 27 Aug 2020 at 14:59:22
    Re: Bot Avatar and User Avatar images not working

    Hi @renatoromao ,

     

    That's awesome. It's working now. Thanks.

     

    Regards,

    Hemanth 

  • Verified answer
    CU22081450-0 Profile Picture
    Most Valuable Professional on 27 Aug 2020 at 14:39:49
    Re: Bot Avatar and User Avatar images not working

    Hi @Anonymous ,

     

    I will send the feedback to Microsoft, but you can fix using this code:

     

    const styleOptions = {
    botAvatarInitials: 'BT',
    accent: '#00809d',
    botAvatarBackgroundColor: "#FFFFFF",
    botAvatarImage: 'https://image.flaticon.com/icons/svg/639/639365.svg',
    hideUploadButton: true,
    };

  • Community Power Platform Member Profile Picture
    on 27 Aug 2020 at 14:21:23
    Re: Bot Avatar and User Avatar images not working

    Hi @renatoromao 

     

    I have published the chatbot and the images on the website and it's not working but i see the botAvatarInitials and  userAvatarInitials are working.

    The code that i have added as the example in this blog is the basic example that is provided on the PVA blog URL:https://powervirtualagents.microsoft.com/en-us/blog/change-your-power-virtual-agents-default-canvas-bot-icon-and-name/

     

    Please check. I don't see that botAvatarImage and userAvatarImage are not working. Please try the example code provided in your instance or http://jsfiddle.net/

     

    Regards,

    Hemanth

  • CU22081450-0 Profile Picture
    Most Valuable Professional on 27 Aug 2020 at 13:48:33
    Re: Bot Avatar and User Avatar images not working

    Hi @Anonymous ,

     

    Maybe you chatbot are getting error to use the external image.

    Try to download the image and publish it into your website (the same that you publish the chatbot) and reference the botAvatarImage and userAvatarImage using your website.

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 468 Super User 2025 Season 2

#2
stampcoin Profile Picture

stampcoin 52 Super User 2025 Season 2

#3
trice602 Profile Picture

trice602 46 Super User 2025 Season 2