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

@ -39,7 +39,7 @@ tokeCommandSchema.pre('save', async function (next){
//if the command was changed
if(this.isModified("command")){
//Get server tokebot object
const tokebot = server.channelManager.chatHandler.commandPreprocessor.tokebot;
const tokebot = server.channelManager.chatHandler.chatPreprocessor.tokebot;
//If tokebot is up and running
if(tokebot != null && tokebot.tokeCommands != null){
@ -58,7 +58,7 @@ tokeCommandSchema.pre('save', async function (next){
*/
tokeCommandSchema.pre('deleteOne', {document: true}, async function (next){
//Get server tokebot object (isn't this a fun dot crawler? Why hasn't anyone asked me to stop writing software yet?)
const tokebot = server.channelManager.chatHandler.commandPreprocessor.tokebot;
const tokebot = server.channelManager.chatHandler.chatPreprocessor.tokebot;
//Get the index of the command within tokeCommand and splice it out
tokebot.tokeCommands.splice(tokebot.tokeCommands.indexOf(this.command),1);