More work decoupling chatPreprocessor from src/app/channel.

This commit is contained in:
rainbow napkin 2025-10-02 03:38:40 -04:00
parent 23ad679473
commit 0ed1c0dd89
4 changed files with 24 additions and 50 deletions

View file

@ -27,19 +27,13 @@ class chatPreprocessor{
/**
* Instantiates a commandPreprocessor object
* @param {channelManager} server - Parent Server Object
* @param {chatHandler} chatHandler - Parent Chat Handler Object
*/
constructor(server, chatHandler, commandProcessor, tokebot){
constructor(server, commandProcessor, tokebot){
/**
* Parent Server Object
*/
this.server = server;
/**
* Parent Chat Handler Object
*/
this.chatHandler = chatHandler;
/**
* Child Command Processor Object. Contains functions named after commands.
*/
@ -82,8 +76,10 @@ class chatPreprocessor{
await this.prepMessage(commandObj);
//Send the chat
this.sendChat(commandObj);
return commandObj;
}
return false;
}
/**
@ -157,15 +153,6 @@ class chatPreprocessor{
//Validate links and mark them by embed type
await this.markLinks(commandObj);
}
/**
* Relays chat to channel via parent Chat Handler object
* @param {Object} commandObj - Object representing a single given command/chat request
*/
sendChat(commandObj){
//FUCKIN' SEND IT!
this.chatHandler.relayUserChat(commandObj.socket, commandObj.message, commandObj.chatType, commandObj.links);
}
}
module.exports = chatPreprocessor;