More work decoupling chatPreprocessor from src/app/channel.
This commit is contained in:
parent
23ad679473
commit
0ed1c0dd89
4 changed files with 24 additions and 50 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue