freezing-carpenter-9818
08/09/2023, 7:54 PMhttps://cdn.discordapp.com/attachments/1138923156019613817/1138923156233531565/Screenshot_2023-08-09_at_20.53.25.png▾
bumpy-butcher-41910
08/09/2023, 7:55 PMfreezing-elephant-85019
08/09/2023, 8:56 PMhttps://cdn.discordapp.com/attachments/1138923156019613817/1138938820507750430/image.png▾
https://cdn.discordapp.com/attachments/1138923156019613817/1138938820709073067/image.png▾
freezing-elephant-85019
08/09/2023, 8:58 PM/* Styling for the avatar of the bot */
.bpw-bot-avatar img,
.bpw-bot-avatar svg {
background: #000000;
border: 3px solid #ffffff;
visibility: hidden;
}
.bpw-bot-avatar {
margin-right: 5px;
background:
url(data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7);
background-repeat: no-repeat;
background-position: center;
border-radius: 50px;
border: 2px solid orange;
width: 45px;
height: 45px;
}
freezing-elephant-85019
08/09/2023, 8:59 PM.bpw-bot-avatar svg
rule and added a new one - .bpw-bot-avatar
freezing-elephant-85019
08/09/2023, 9:00 PMfreezing-elephant-85019
08/09/2023, 9:01 PMfreezing-carpenter-9818
08/09/2023, 9:14 PMfreezing-carpenter-9818
08/10/2023, 10:04 AMwindow.innerWidth
.
2. trigger to open the chat window and deploy the irst messages.
opinion: do ou think this is the correct way to go about running both scripts, is there a simpler option?
the problem: when using the window.innerwidth the trigger does not work for both desktop and mobile.freezing-carpenter-9818
08/10/2023, 10:06 AM<script>
if (window.innerWidth <= 500) { // Adjust the value based on the desired screen width
// Add the script code here that you want to run on mobile devices
var script1 = document.createElement('script');
script1.src = "https://cdn.botpress.cloud/webchat/v0/inject.js";
document.body.appendChild(script1);
var script2 = document.createElement('script');
script2.src = "https://mediafiles.botpress.cloud/hidden-for-privacy/webchat/config.js";
script2.defer = true;
document.body.appendChild(script2);
window.botpressWebChat.onEvent(
function (ev) {
window.botpressWebChat.sendEvent({
type: "loadConversation",
});
},
["LIFECYCLE.LOADED"]
);
window.addEventListener("message", function (event) {
// console.log(event.data.type);
if (event.data.type == "LIFECYCLE.READY") {
window.botpressWebChat.sendEvent({
type: "trigger",
channel: "web",
payload: {
text: "",
},
});
}
});
}
</script>
freezing-elephant-85019
08/10/2023, 8:41 PMfreezing-elephant-85019
08/10/2023, 8:42 PMbrainy-byte-43078
08/11/2023, 5:02 AMfreezing-elephant-85019
08/11/2023, 8:38 PMfreezing-carpenter-9818
08/12/2023, 10:27 AMfreezing-elephant-85019
08/14/2023, 9:05 PM