# 💻developers


03/02/2024, 10:38 PM
This is one more requirement of client, if we click the open chatbot button then the chatbot window has to open, It is working fine when i tested it on vs code editor, but on live website the chatbot window is not opening. on console i am getting error as "cannot send data until webchat is ready". I used this script for button to chatbot window opening document.getElementById('openChatButton').addEventListener('click', function() { window.botpressWebChat.sendEvent({ type: 'show' }); // You can also send a welcome message or any other message when opening the chat window window.botpressWebChat.sendEvent({ type: 'message', text: 'Hello!' }); });