atulbhatt-system32 / omegle.js

Interact with omegle using node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

omegle.js

Interact with omegle using node.js

GitHub GitHub package.json version (subfolder of monorepo) 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

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

About

Interact with omegle using node.js

License:MIT License


Languages

Language:JavaScript 100.0%