Skip to content

TotallyMehis/destiny.gg-chat-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Destiny.gg Chat Client

Usage

const DestinyGGClient = require('destiny.gg-chat')

const client = new DestinyGGClient({
  url: 'wss://chat.destiny.gg/ws',
  reconnect: true,
  timeout: 20000,
  authtoken: 'PUT_AUTHTOKEN_HERE',
  sid: '' // Session id (alternative to authtoken)
})

client.on('open', function() {
  client.message('Hello world!')
})

client.on('message', function(nick, msg, features) {
  client.message(`${nick} you said ${msg}`)
})

client.on('error', function(reason) {
  if (reason === 'banned') {
    console.log('I was banned :(')
  } else if (reason === 'muted') {
    client.close()
  }
})

client.on('close', function() {
  console.log('This is false:', this.connected)
})

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages