Tutorials

How To Make an Automatic Omegle Bot Using JavaScript

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.

Open Omegle Website on Your Computer

Omegle.com Website

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”.

Confirm Omegle Policies

It will open a new webpage where a chat box is given (Just like Facebook Messenger, or WhatsApp).


Omegle Text Chat Page

Omegle Chat Page

Now, follow the below mentioned steps to automatically send a message to random stranger using Omegle Bot.

Step 1:- Open Chrome DevTools

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.

Step 2:- Copy/Paste Omegle Bot Code in Browser

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)

Code Explanation

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.

Omegle Bot Screenshot

Omegle Bot

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.

Furqan

Well. I've been working for the past three years as a web designer and developer. I have successfully created websites for small to medium sized companies as part of my freelance career. During that time I've also completed my bachelor's in Information Technology.

Recent Posts

How can IT Professionals use ChatGPT?

If you're reading this, you must have heard the buzz about ChatGPT and its incredible…

September 2, 2023

ChatGPT in Cybersecurity: The Ultimate Guide

How to Use ChatGPT in Cybersecurity If you're a cybersecurity geek, you've probably heard about…

September 1, 2023

Add Cryptocurrency Price Widget in WordPress Website

Introduction In the dynamic world of cryptocurrencies, staying informed about the latest market trends is…

August 30, 2023

Best Addons for The Events Calendar Elementor Integration

The Events Calendar Widgets for Elementor has become easiest solution for managing events on WordPress…

August 30, 2023

Create Vertical Timeline in Elementor: A Step-by-step Guide

Introduction The "Story Timeline" is a versatile plugin that offers an innovative way to present…

August 30, 2023

TranslatePress Addon for Automate Page Translation in WordPress

Introduction In today's globalized world, catering to diverse audiences is very important. However, the process…

August 30, 2023