Constructor
new commandPreprocessor(server, chatHandler)
Instantiates a commandPreprocessor object
Parameters:
| Name | Type | Description |
|---|---|---|
server |
channelManager | Parent Server Object |
chatHandler |
chatHandler | Parent Chat Handler Object |
Members
chatHandler
Parent Chat Handler Object
commandProcessor
Child Command Processor Object
server
Parent Server Object
tokebot
Child Tokebot Object
Methods
(async) markLinks(commandObj)
Iterates through links in message and marks them by link type for later use by client-side post-processing
Parameters:
| Name | Type | Description |
|---|---|---|
commandObj |
Object | Object representing a single given command/chat request |
(async) prepMessage(commandObj)
Re-creates message string from processed Command Array
Parameters:
| Name | Type | Description |
|---|---|---|
commandObj |
Object | Object representing a single given command/chat request |
(async) preprocess(socket, data)
Ingests a command/chat request from Chat Handler and pre-processes and processes it accordingly
Parameters:
| Name | Type | Description |
|---|---|---|
socket |
Socket | Socket we're receiving the request from |
data |
Object | Event payload |
(async) processServerCommand(commandObj)
Uses the server's Command Processor object to process the chat/command request.
Parameters:
| Name | Type | Description |
|---|---|---|
commandObj |
Object | Object representing a single given command/chat request |
sanatizeCommand(commandObj) → {Boolean}
Sanatizes and Validates a single user chat message/command
Parameters:
| Name | Type | Description |
|---|---|---|
commandObj |
Object | Object representing a single given command/chat request |
Returns:
false if Command/Message is too long to send
- Type
- Boolean
sendChat(commandObj)
Relays chat to channel via parent Chat Handler object
Parameters:
| Name | Type | Description |
|---|---|---|
commandObj |
Object | Object representing a single given command/chat request |
splitCommand(commandObj)
Splits raw chat/command data into seperate arrays, one by word-borders and words surrounded by word-borders
These arrays are used to handle further command/chat processing
Parameters:
| Name | Type | Description |
|---|---|---|
commandObj |
Object | Object representing a single given command/chat request |