@ketchupwater/node-omegle v0.2.12
node-omegle
This is a forked node library that contains an Omegle client. The original repository is not maintained anymore. It is based upon research by user nucular which is written down in a GitHub Gist.
Example
const Client = require('node-omegle');
let client = new Client();
client.on('message', message => console.log(message));
client.on('disconnected', () => console.log('Disconnected'));
client.on('ready', () => client.connect());
client.on('connected', () => {
console.log('Connected');
client.send('beep boop i am a bot');
setTimeout(() => client.disconnect(), 10000);
});API Documentation
class OmegleClient
The base class representing the client
new OmegleClient(opts)
Constructor for the class
Arguments:
opts.language: Language code to send to omegleopts.userAgent: User-Agent string to use for requests
connect(topics)
Connect to omegle
This method must be called after the ready event is fired
Arguments:
topics: List of interests to send to omegle
disconnect()
Disconnect from omegle, ending any chat that is ongoing
send(message)
Send a message to the chat
Arguments:
message: The message to send
startTyping()
Start "typing" on omegle
stopTyping()
Stop "typing" on omegle
stopLookingForCommonLikes()
Tells the omegle server to stop looking for a person with common interests. The web-based omegle client does this after a while.
sendCaptchaResponse(response)
Sends a response to the captcha requested by omegle. See the captcha section below for more information on how to handle captchas.
Arguments:
response: The text result to the captcha
transferSession(id, server)
Transfers a session by session id (with optional server argument).
Arguments:
id: Omegle session idserver: Optional server name to connect to
prepareTransferSession()
Stops fetching events and returns the session id so the session can be resumed elsewhere.
Returns the current session id
Events
ready: The instance has successfully fetched connection information from omegle, must be fired before connect is calledwaiting: Waiting for a connectionconnected: Connected to the other userstatusInfo: Status information from omeglecount: Doesn't really seem to ever be sent by omeglecommonLikes: Array of common interestspartnerCollege: College the user attends, if applicableserverMessage: A "server message" from omeglerecaptchaRequired: The omegle server gave you a captcha to solve, see captcha section belowrecaptchaRejected: Same as above, but the previous response was incorrectidentDigests: Identity stuff, seems to be used when submitting logserror: Request error, thrown locally by the clientomegleError: Omegle gave you an errorconnectionDied: The connection died abnormallyantinudeBanned: The client was banned to the unfiltered section for being badtyping: User is typingstoppedTyping: User has stopped typingmessage: The user sent a text messagestrangerDisconnected: The user ended the chatunhandledEvent: Omegle sent something that we don't know what to do withreadyToReconnect: The client is ready to reconnect after the stranger disconnected
Handling captchas
You can't, because Google shut down reCAPTCHA v1 and omegle hasn't done anything about it yet
License
ISC