API Docs for:
Show:

thr0w Class

This object provides the base functionality.

Item Index

Methods

Methods

authenticated

() Boolean static

This function returns if authenticated.

Returns:

Boolean:

If authenticated.

connect

(
  • chn
  • connectCallback
  • messageCallback
)
static

This function is used to connect to a channel.

Parameters:

  • chn Integer

    The channel id.

  • connectCallback Function

    The callback function called when connected.

    function()
  • messageCallback Function

    The callback function called for messages.

    function(data)
    
    Parameters:
    
    data Object
    The message data.

disconnect

() static

This function disconnects the channel.

getChannel

() Integer static

This function returns the channel number.

Returns:

Integer:

The channel number.

login

(
  • username
  • password
  • callback
)
static

This function logs in a user.

Parameters:

  • username String

    The user's name.

  • password String

    The user's password.

  • callback Function

    The function callback.

    function(error)
    
    Parameters:
    
    error Integer
    The error code; null is success.

logout

() static

This function logs out a user.

setBase

(
  • name
)
static

This function is used to set the hostname for the thr0w service.

Parameters:

  • name String

    The hostname.

thr0w

(
  • channels
  • data
)
static

This function is used send messages to channels.

Parameters:

  • channels Array

    Array of Integers; channel ids.

  • data Object

    The message data.

thr0wChannel

(
  • channels
  • data
)
static

This function is used to send messages via the channel.

Parameters:

  • channels Array

    Array of Integers; channel ids.

  • data Object

    The message data.