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.

  1. Add a button, set the needed appearance settings
  2. Edit Button > Advanced > set CSS ID = bot (can be different if needed)
  3. Add an HTML widget to the page (after the button will be fine)
  4. Paste the following code into the HTML Code field:
<script>
jQuery(function(event) {
  jQuery('#bot').click(function(){
      quriobot.start()
  });
});
</script>
  1. Update page, preview, test

Edit this page

Tags
See also