In this tutorial, we’ll use JavaScript to make an Omegle Bot. You don’t need to be a programmer to follow along with this article. I’ve already written the source code, you just need to copy/paste it inside your web browser.
Basically, an Omegle Bot allows us to automate some tasks. For example, today I’ll show you how to automatically send a message to a stranger using Omegle Chat Bot.
Visit the Omegle website on your computer and then click the “Text” button given under “Start chatting”.
A popup modal will appear, asking you to accept the Omegle’s Terms of Service, Privacy Policy, and Community Guidelines. As well as confirm that you are 18+ or 13+ to use Omegle.
Click the two checkboxes and then hit “Confirm & continue”.
It will open a new webpage where a chat box is given (Just like Facebook Messenger, or WhatsApp).
Now, follow the below mentioned steps to automatically send a message to random stranger using Omegle Bot.
There are different ways to open Chrome DevTools in your Google Chrome browser. The quickest one is to press Ctrl+Shift+J on Windows or ⌘+⌥Option+J on Mac.
Copy the below code-snippet and paste it inside the Chrome DevTools “Console” tab. Now, hit the “Enter” button on your keyboard and see how Omegle Chatbot automatically send the message to stranger.
function executeOmegle() { let btn = document.querySelector('.disconnectbtn') let messageBox = document.querySelector('.chatmsg') let sendBtn = document.querySelector('.sendbtn') btn.click() messageBox.innerHTML="Hello, how are you? I'm Furqan. This message is sent by my automatic chatbot." sendBtn.click() } setInterval(executeOmegle,4000)
Basically, at first, I have defined a new JavaScript function called executeOmegle()
. In this function, I’ve used document.querySelector()
to select the “Start/Stop chat” button, message textarea, and the “Send” button based on their HTML5 class attribute.
I then call the btn.click()
method to open a new chat with stranger.
The messageBox.innerHTML
is the main line of code where we need to specify the text message we want to send.
After that, I called the sendBtn.click()
method that enables us to click the “Send” button programmatically.
Finally, we’ll execute our function every 4 seconds using setInterval(executeOmegle,4000)
code.
As you can see that in the above screenshot our Omegle bot is working. Basically, our Omegle chatbot will continue to work as long as you are active on the Omegle chat page.
If you want to turn off the Omegle bot, simply clear the “Console” tab and close Chrome DevTools.
We evaluated the performance of Llama 3.1 vs GPT-4 models on over 150 benchmark datasets…
The manufacturing industry is undergoing a significant transformation with the advent of Industrial IoT Solutions.…
If you're reading this, you must have heard the buzz about ChatGPT and its incredible…
How to Use ChatGPT in Cybersecurity If you're a cybersecurity geek, you've probably heard about…
Introduction In the dynamic world of cryptocurrencies, staying informed about the latest market trends is…
The Events Calendar Widgets for Elementor has become easiest solution for managing events on WordPress…