Module: chat

Broadcasts passed `text` field to the calling users channel
Version:
  • 1.0.0
Author:
  • Marzavec ( https://github.com/marzavec )
Source:

Members

(static, constant) ACTIVE_MESSAGES :Array

Stores active messages that can be edited.
Type:
  • Array
Source:

(static, constant) MAX_MESSAGE_ID_LENGTH :number

Maximum length of the customId property
Type:
  • number
Source:

(inner, constant) ACTIVE_TIMEOUT :number

The time in milliseconds before a message is considered stale, and thus no longer allowed to be edited.
Type:
  • number
Source:

(inner, constant) TIMEOUT_CHECK_INTERVAL :number

The time in milliseconds that a check for stale messages should be performed.
Type:
  • number
Source:

Methods

(static) addActiveMessage(id, userid) → {void}

Adds a message to the active messages map.
Parameters:
Name Type Description
id string
userid number
Source:
Returns:
Type
void

(static) cleanActiveMessages() → {void}

Cleans up stale messages.
Source:
Returns:
Type
void

(static) commandCheckIn(env) → {Object|boolean|string}

Executes every time an incoming chat command is invoked; checks for miscellaneous '/' based commands
Parameters:
Name Type Description
env Object Environment object with references to core, server, socket & payload
Source:
Returns:
Object = same/altered payload, false = suppress action, string = error
Type
Object | boolean | string

(static) finalCmdCheck(env) → {Object|boolean|string}

Executes every time an incoming chat command is invoked; assumes a failed chat command invocation and will reject with notice
Parameters:
Name Type Description
env Object Environment object with references to core, server, socket & payload
Source:
Returns:
Object = same/altered payload, false = suppress action, string = error
Type
Object | boolean | string

(static) initHooks(server) → {void}

Automatically executes once after server is ready to register this modules hooks
Parameters:
Name Type Description
server Object Reference to server environment object
Source:
Returns:
Type
void

(static) run(env) → {void}

Executes when invoked by a remote client
Parameters:
Name Type Description
env Object Environment object with references to core, server, socket & payload
Source:
Returns:
Type
void

Type Definitions

chat/info

Module meta information
Type:
  • Object
Properties:
Name Type Description
name string Module command name
category string Module category name
description string Information about module
usage string Information about module usage
Source:

chat/requiredData

The following payload properties are required to invoke this module: "text"
Type:
  • Array
Source: