stale-alligator-73884
03/20/2024, 10:51 AMquick-musician-29561
03/20/2024, 4:26 PMquick-musician-29561
03/20/2024, 4:27 PMquick-musician-29561
03/20/2024, 4:29 PMjs
workflow.payload = JSON.stringify({ "color": workflow.color })
quick-musician-29561
03/20/2024, 4:29 PMquick-musician-29561
03/20/2024, 4:30 PMhtml
<html>
<head>
<style>
body {
background-color: black;
color: white;
}
button {
background-color: blue;
color: white;
padding: 10px;
border: none;
cursor: pointer;
}
</style>
</head>
<body>
<h1>
Change the button color
</h1>
<h1>
with Chatbot
</h1>
<script src="https://cdn.botpress.cloud/webchat/v1/inject.js"></script>
<script>
window.botpressWebChat.init({
// ADD YOUR BOTPRESS CONFIGURABLE WEBCHAT CODE HERE
});
</script>
<button id="timeButton">BUTTON</button>
<script>
window.botpressWebChat.onEvent(
function(event) {
document.getElementById('timeButton').style.backgroundColor = event.value.color;
console.log(event)
},
['TRIGGER']
);
</script>
</body>
</html>
quick-musician-29561
03/20/2024, 4:31 PMquick-musician-29561
03/20/2024, 4:31 PMstale-alligator-73884
03/20/2024, 9:19 PM