chilly-church-46005
09/09/2023, 1:11 PMchilly-church-46005
09/09/2023, 1:13 PMmicroscopic-shampoo-2255
09/09/2023, 2:26 PMquiet-raincoat-89190
09/09/2023, 3:55 PMbrief-accountant-68119
09/10/2023, 2:16 AMbillowy-morning-42410
09/10/2023, 9:47 PMwindow.botpressWebChat.sendPayload({
type: 'trigger',
payload: {
myCustomProperty: 'hello',
},
})
billowy-morning-42410
09/10/2023, 9:59 PMbillowy-morning-42410
09/10/2023, 10:02 PMbillowy-morning-42410
09/10/2023, 10:13 PMbillowy-morning-42410
09/10/2023, 10:13 PMchilly-church-46005
09/13/2023, 4:38 PMchilly-church-46005
09/13/2023, 5:03 PMchilly-church-46005
09/13/2023, 5:04 PMchilly-church-46005
09/13/2023, 5:06 PMchilly-church-46005
09/14/2023, 1:55 PMquiet-raincoat-89190
09/14/2023, 6:28 PMchilly-church-46005
09/15/2023, 10:58 AMchilly-church-46005
09/15/2023, 11:15 AMquiet-raincoat-89190
09/15/2023, 1:02 PMchilly-church-46005
09/15/2023, 1:39 PMchilly-church-46005
09/15/2023, 1:41 PMcool-summer-17043
09/15/2023, 2:18 PMchilly-church-46005
09/15/2023, 2:19 PMcool-summer-17043
09/15/2023, 2:27 PMchilly-church-46005
09/15/2023, 4:28 PMchilly-church-46005
09/16/2023, 9:38 PMquiet-raincoat-89190
09/16/2023, 9:42 PMquiet-raincoat-89190
09/16/2023, 9:53 PMquiet-raincoat-89190
09/16/2023, 9:54 PMquiet-raincoat-89190
09/16/2023, 9:54 PMchilly-church-46005
09/17/2023, 2:42 PMchilly-church-46005
09/17/2023, 2:42 PMstraight-musician-77995
09/17/2023, 7:14 PMquiet-raincoat-89190
09/18/2023, 3:13 AMcrooked-van-25152
09/18/2023, 3:43 PMfamous-jewelry-85388
09/18/2023, 5:39 PMfamous-jewelry-85388
09/18/2023, 5:39 PMcrooked-van-25152
09/18/2023, 5:54 PMfamous-jewelry-85388
09/18/2023, 6:34 PMfamous-jewelry-85388
09/18/2023, 6:34 PMfamous-jewelry-85388
09/18/2023, 6:35 PMfamous-jewelry-85388
09/18/2023, 6:35 PMfamous-jewelry-85388
09/18/2023, 6:35 PMchilly-church-46005
09/19/2023, 12:43 PMchilly-church-46005
09/19/2023, 12:43 PMfamous-jewelry-85388
09/19/2023, 3:33 PMmysterious-cricket-72777
09/19/2023, 4:51 PMcool-summer-17043
09/19/2023, 6:01 PM<script>
function handleClick() {
console.log('Button clicked!')
window.botpressWebChat.sendPayload({
type: 'trigger',
payload: {
id: 21323123,
},
})
}
const button = document.getElementById('myButton')
button.addEventListener('click', handleClick)
window.botpressWebChat.onEvent(
function (event) {
if (event.type === 'LIFECYCLE.LOADED') {
window.botpressWebChat.sendEvent({ type: 'hide' })
}
},
['LIFECYCLE.LOADED']
)
</script>
The code above assumes you are using a button to trigger sending a payload to the bot and using that to trigger the bot. If you want to use some other mechanism to trigger the bot, you would need to make corresponding changes. Hope this is clear.cool-summer-17043
09/19/2023, 6:03 PMmysterious-cricket-72777
09/19/2023, 6:07 PMcool-summer-17043
09/19/2023, 6:18 PMcrooked-van-25152
09/19/2023, 6:29 PMfamous-jewelry-85388
09/19/2023, 6:34 PMcool-summer-17043
09/19/2023, 6:42 PMmysterious-cricket-72777
09/20/2023, 5:02 AMchilly-church-46005
09/20/2023, 2:03 PMchilly-church-46005
09/20/2023, 2:03 PMchilly-church-46005
09/20/2023, 2:03 PMcool-summer-17043
09/20/2023, 2:04 PMcool-summer-17043
09/20/2023, 2:05 PMwindow.botpressWebChat.onEvent(event => {
if (event.type === 'TRIGGER' && event.value && event.value.url) {
window.location.href = event.value.url
}
if (event.type === 'LIFECYCLE.LOADED') {
window.botpressWebChat.sendEvent({ type: 'show' })
}
console.log(event)
},
['TRIGGER', 'LIFECYCLE.LOADED']
)
chilly-church-46005
09/20/2023, 2:10 PMchilly-church-46005
09/20/2023, 2:11 PMcool-summer-17043
09/20/2023, 2:12 PMcool-summer-17043
09/20/2023, 2:17 PMwindow.botpressWebChat.onEvent(
function (event) {
if (event.type === 'LIFECYCLE.LOADED') {
window.botpressWebChat.sendEvent({ type: 'hide' })
}
if (event.type === 'LIFECYCLE.READY') {
setTimeout(() => {
window.botpressWebChat.sendPayload({
type: 'trigger',
payload: {
id: 21323123,
},
})
console.log('Payload triggered 3 seconds after page fully loaded')
}, 3000);
}
},
['LIFECYCLE.LOADED', 'LIFECYCLE.READY']
)
cool-summer-17043
09/20/2023, 2:20 PMchilly-church-46005
09/20/2023, 2:20 PMchilly-church-46005
09/20/2023, 2:24 PMcool-summer-17043
09/20/2023, 2:33 PMchilly-church-46005
09/20/2023, 2:44 PMchilly-church-46005
09/20/2023, 3:11 PMfamous-jewelry-85388
09/20/2023, 3:53 PMchilly-church-46005
09/20/2023, 4:12 PMchilly-church-46005
09/20/2023, 4:12 PMfamous-jewelry-85388
09/20/2023, 4:13 PMfamous-jewelry-85388
09/20/2023, 4:13 PMchilly-church-46005
09/20/2023, 4:40 PMfamous-jewelry-85388
09/20/2023, 4:43 PMfamous-jewelry-85388
09/20/2023, 4:43 PMfamous-jewelry-85388
09/20/2023, 4:53 PMfamous-jewelry-85388
09/20/2023, 4:55 PMfamous-jewelry-85388
09/20/2023, 4:55 PMfamous-jewelry-85388
09/20/2023, 5:07 PMfamous-jewelry-85388
09/20/2023, 5:08 PMfamous-jewelry-85388
09/20/2023, 5:14 PMchilly-church-46005
09/20/2023, 5:22 PMchilly-church-46005
09/20/2023, 5:23 PMfamous-jewelry-85388
09/20/2023, 5:24 PMfamous-jewelry-85388
09/20/2023, 5:24 PMfamous-jewelry-85388
09/20/2023, 5:24 PMfamous-jewelry-85388
09/20/2023, 5:24 PMwindow.botpressWebChat.onEvent(event => {
if(event.type === 'TRIGGER' && event.value.action == "hideHelloWorld!")
{
console.log('hideHelloWorld')
console.log(event)
document.getElementById('helloDiv').style = "display:none";
}
if(event.type === 'TRIGGER' && event.value.action == "showHelloWorld!")
{
console.log('showHelloWorld')
console.log(event)
document.getElementById('helloDiv').style = "border: 1px solid";
document.getElementById('helloDiv').innerText = 'Hello Bassam!';
}
if (event.type === 'LIFECYCLE.LOADED') {
window.botpressWebChat.sendEvent({ type: 'trigger',payload: {
myCustomProperty: 'Hello World!',
}, })
}
}, ['TRIGGER','LIFECYCLE.LOADED'])
</script>
famous-jewelry-85388
09/20/2023, 5:25 PMchilly-church-46005
09/20/2023, 5:25 PMchilly-church-46005
09/20/2023, 5:26 PMfamous-jewelry-85388
09/20/2023, 5:26 PMcool-summer-17043
09/20/2023, 6:12 PMchilly-church-46005
09/21/2023, 1:32 PMfamous-jewelry-85388
09/21/2023, 1:45 PMchilly-church-46005
09/21/2023, 1:58 PMfamous-jewelry-85388
09/21/2023, 2:03 PMbillowy-morning-42410
09/21/2023, 2:32 PM.bpw-floating-button i {
transition: opacity 0.3s ease;
opacity: 1;
fill: inherit;
stroke: inherit;
width: 100%;
padding: 0;
line-height: 0;
}
billowy-morning-42410
09/21/2023, 2:32 PMcrooked-van-25152
09/21/2023, 4:13 PMfamous-jewelry-85388
09/21/2023, 4:50 PMbillowy-morning-42410
09/21/2023, 5:52 PMdisplay:none
to that css class.billowy-morning-42410
09/21/2023, 5:56 PMcool-summer-17043
09/21/2023, 9:16 PMchilly-church-46005
09/22/2023, 9:29 AMchilly-church-46005
09/22/2023, 9:29 AMchilly-church-46005
09/22/2023, 9:30 AMcrooked-van-25152
09/22/2023, 1:31 PMfamous-jewelry-85388
09/22/2023, 3:21 PMfamous-jewelry-85388
09/22/2023, 3:21 PMfamous-jewelry-85388
09/22/2023, 3:21 PMcool-summer-17043
09/22/2023, 3:42 PMstrong-iron-51380
10/16/2023, 1:18 PMbright-magazine-792
11/08/2023, 11:01 AMstrong-iron-51380
11/08/2023, 1:36 PMbright-magazine-792
11/08/2023, 1:37 PMstrong-iron-51380
11/08/2023, 1:37 PMbright-magazine-792
11/08/2023, 1:55 PMstrong-iron-51380
11/08/2023, 4:32 PMagreeable-elephant-30510
12/21/2023, 6:33 PMfamous-jewelry-85388
01/08/2024, 6:52 PM