{"id":4641,"date":"2023-07-25T10:13:09","date_gmt":"2023-07-25T09:13:09","guid":{"rendered":"https:\/\/botnation.ai\/?p=4641"},"modified":"2026-01-02T16:34:00","modified_gmt":"2026-01-02T15:34:00","slug":"lancer-le-chatbot-apres-un-delai","status":"publish","type":"support","link":"https:\/\/botnation.ai\/fr\/support\/lancer-le-chatbot-apres-un-delai\/","title":{"rendered":"Lancer le Chatbot apr\u00e8s un d\u00e9lai"},"content":{"rendered":"<p>Vous allez apprendre comment ex\u00e9cuter le Chatbot apr\u00e8s un d\u00e9lai \u00e0 l\u2019aide du Javascript<\/p>\n\n\n\n<p>Commencez par r\u00e9cup\u00e9rer sur la plateforme le code permettant d\u2019afficher le Chatbot. Vous trouverez la d\u00e9marche dans la documentation suivante : <a href=\"https:\/\/botnation.ai\/comment-installer-mon-chatbot-sur-mon-site-web\/\">Comment installer mon chatbot sur mon site web<\/a><\/p>\n\n\n\n<p>Ensuite, retirez la premi\u00e8re ligne, \u00e0 savoir :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;script type=\"text\/javascript\"&gt;<\/pre>\n\n\n\n<p>Ainsi que la derni\u00e8re :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;\/script&gt;<\/pre>\n\n\n\n<p>Ins\u00e9rez le code obtenu dans une fonction Javascript :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">function launchChatbot() {<br>  (window as any).chatboxSettings = {<br>     appKey: 'xxxx',<br>     websiteId: 'xxx',<br>     language: 'fr',<br>     ...<br>  };<br><br>  (function (d, s, id) {<br>    let js: any, fjs = d.getElementsByTagName(s)[0];<br>    if (d.getElementById(id)) {<br>      return;<br>    }<br>    js = d.createElement(s);<br>    js.id = id;<br>    js.src = 'https:\/\/cbassets.botnation.ai\/js\/widget.js';<br>    js.async = true;<br>    fjs.parentNode.insertBefore(js, fjs);<br>  }(document, 'script', 'chatbox-jssdk'));<br>}<\/pre>\n\n\n\n<p>Cette fonction nouvellement cr\u00e9e lancera le bot d\u00e8s que vous l\u2019appellerez. Vous pouvez ainsi l\u2019ex\u00e9cuter au clic sur un bouton, apr\u00e8s un certain d\u00e9lai ou suite \u00e0 toute autre action Javascript.<\/p>\n\n\n\n<p>Exemple de l\u2019ex\u00e9cution du Chatbot (via la fonction launchChat que nous venons de cr\u00e9er) suite \u00e0 un d\u00e9lai de 10s (10000ms) :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">setTimeout(launchChatbot, 10000);<\/pre>\n\n\n\n<p><strong>En plus :<\/strong><br>\u2013 <a href=\"https:\/\/botnation.ai\/comment-installer-mon-chatbot-sur-mon-site-web\/\">Comment installer mon chatbot sur mon site web<\/a><\/p>\n\n\n","protected":false},"featured_media":0,"template":"","meta":{"_acf_changed":false},"categorie-support":[183,189],"class_list":["post-4641","support","type-support","status-publish","hentry","categorie-support-chatbot-web","categorie-support-tutoriels"],"acf":[],"_links":{"self":[{"href":"https:\/\/botnation.ai\/fr\/wp-json\/wp\/v2\/support\/4641","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/botnation.ai\/fr\/wp-json\/wp\/v2\/support"}],"about":[{"href":"https:\/\/botnation.ai\/fr\/wp-json\/wp\/v2\/types\/support"}],"wp:attachment":[{"href":"https:\/\/botnation.ai\/fr\/wp-json\/wp\/v2\/media?parent=4641"}],"wp:term":[{"taxonomy":"categorie-support","embeddable":true,"href":"https:\/\/botnation.ai\/fr\/wp-json\/wp\/v2\/categorie-support?post=4641"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}