Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

qxb3/omegle.js

Repository files navigation

omegle.js

Create omegle bots using node.js

GitHub GitHub package.json version (subfolder of monorepo) npm Github Github

NOTE

Please dont use this to abuse omegle. There is too much scam bots in omegle already, we dont need another one

Installation

Must have node v14.0.0 or later

npm install omegle.js
# Or
yarn add omegle.js

Example

import OmegleClient from 'omegle.js'
// or const OmegleClient = require('omegle.js')

const client = new OmegleClient()

client.on('connected', () => {
  console.log('Connected')
})

client.on('message', (message) => {
  client.sendMessage(`[BOT] ${message}`)
})

client.connect({
  topics: ['friend', 'gaming']
})

Docs

OmegleClient

options

  • debug (boolean)
    - Will print out the events if set to true
    Default: false

  • server (string)
    - Sets the server api the client will be using
    Default: https://front10.omegle.com

properties

  • connected
    - Connection state will set to true if connected
    Returns: boolean

  • messages
    - The messages of the current session
    Returns: Array<string>

  • typing
    - If the client is currently typing
    Returns: boolean

methods

  • connect(options)
    - Connect the client
    Options:

    • lang (string)
      Default: en

    • topics (Array<String>)
      Default: []

  • disconnect()
    - Disconnect the client

  • sendMessage(message: string)
    - Send a message

  • startTyping()
    - Send a typing indicator

  • stopTyping()
    - Stop a typing indicator

  • on(event: string, callback: function)
    - Listen to a event

events

  • connected
    - Fires when the client is connected

    • Params: (commonLikes?: Array<string>)
  • disconnected
    - Fires when the client is disconnected

  • message
    - Fires when the stranger send a message

    • Params: (message: string)
  • typing
    - Fires when the stranger is typing

  • stoppedTyping
    - Fires when the stranger stopped typing

Contributing

Feel free to make the library better by forking and making a pull request :>

LICENSE

MIT