Search code examples
javascriptcsschatbotbotman

How can I change default backround color of botman.io widget


Im using botman.io package for chatboot widget. Everything works perfectly but problem is that i can't change default background color of chat widget. On inspect console it shown that boman widget calls ( https://cdn.jsdelivr.net/npm/[email protected]/build/assets/css/chat.css ) link, but i cant find that call on my localhost project. If anyone know solution i would appreciate.

<script src="{{ asset('/js/webflow.js') }}"></script>
<script> 
        var botmanWidget = {
        title:'Scarletbot',
        introMessage: 'Hello, I am a Scarlet! I am here to assist you and answer all your questions about our products and services!',
        mainColor:'#c02026',
        aboutText:'',
        bubbleBackground:'#c02026',
        headerTextColor: '#fff',
    };

</script>
<script id="botmanWidget" src="{{ asset('/js/widget.js') }}"></script>

enter image description here


Solution

  • You may add frameEndpoint in

    var botmanWidget = {
        frameEndpoint: '<?php echo base_url('botdemo/chatserver1');?>',
        title:'Scarletbot',
        introMessage: 'Hello, I am a Scarlet! I am here to assist you and answer all your questions about our products and services!',
        mainColor:'#c02026',
        aboutText:'',
        bubbleBackground:'#c02026',
        headerTextColor: '#fff',
    };
    

    frameEndpoint is nothing but source of iframe loaded by botman-widget

    frameEndpoint source is like :

    <!doctype html>
    <html>
    <head>
        <title>BotMan Widget</title>
        <meta charset="UTF-8">
        <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/botman-web-widget@0/build/assets/css/chat.min.css">
    </head>
    <body>
        <script id="botmanWidget" src='https://cdn.jsdelivr.net/npm/botman-web-widget@0/build/js/chat.js'></script>
    </body>
    </html>
    

    Here you may use own css as well.