Welcome folks today in this blog post we will be building a omegle bot
in javascript and automate it in browser console. All the full source code of the application is shown below.
Get Started
In order to get started you need to go to omegle.com
and after that you need to go to inspect element and go to browser console
as shown below
And now you need to copy paste the below javascript code
to automate the omegle messages to users and build a bot
1 2 3 4 5 6 7 8 9 10 |
function executeOmegle() { let btn = document.querySelector('.disconnectbtn') let messageBox = document.querySelector('.chatmsg') let sendBtn = document.querySelector('.sendbtn') btn.click() messageBox.innerHTML="This is the message for the bot" sendBtn.click() } setInterval(executeOmegle,2000) |
As you can see in the above function we are targeting the dom elements
using their classes and then we are passing the default
message to be sent to the omegle users. And then automatically we are clicking the button to send that message. And also we are setting the delay
in between the messages. This delay is in milliseconds. And then we are clicking the button using the click()
method And also we are using the setInterval() method and here we are calling the executeOmegle() method and also passing the delay of the bot as well in the second argument.
And now if you run the omegle bot
inside the browser as shown below