Start bot by clicking a link (or a button) on your website
If you want to have full control of when your bot will start, you can use QB Javascript API
So, for example, say you have a link with which you want to start the bot. All you need is:
- Disable the bot autostart
- HTML example code with the link and the bot embed code;
<html>
<head>
<YOUR BOT EMBED CODE>
</head>
<body>
<a href="#" id="go" onclick="quriobot.start()">Start</a>
</body>
</html>
if you want to have a button instead of a link:
<html>
<head>
<YOUR BOT EMBED CODE>
</head>
<body>
<button id="go" onclick="quriobot.start()">Start</button>
</body>
</html>
If your website is built using Elementor, the approach is different.
- Add a button, set the needed appearance settings
- Edit Button > Advanced > set CSS ID = bot (can be different if needed)
- Add an HTML widget to the page (after the button will be fine)
- Paste the following code into the HTML Code field:
<script>
jQuery(function(event) {
jQuery('#bot').click(function(){
quriobot.start()
});
});
</script>
- Update page, preview, test