Fixed errors loading default items
This commit is contained in:
parent
eb5475ec9d
commit
affdd98572
|
|
@ -9,7 +9,7 @@ Canopy
|
|||
<a href="https://git.ourfore.st/rainbownapkin/canopy/issues" target="_blank"><img src="https://git.ourfore.st/rainbownapkin/canopy/badges/issues/closed.svg"></a>
|
||||
<a href="https://www.gnu.org/licenses/agpl-3.0.en.html" target="_blank"><img src="https://img.shields.io/badge/License-AGPL_v3-663366.svg"></a>
|
||||
|
||||
0.4-INDEV
|
||||
0.4-INDEV Hotfix 1
|
||||
=========
|
||||
|
||||
Canopy - /ˈkæ.nə.pi/:
|
||||
|
|
|
|||
|
|
@ -51,8 +51,11 @@ const emoteSchema = new mongoose.Schema({
|
|||
* Post-Save function, ensures all new emotes are broadcastes to actively connected clients
|
||||
*/
|
||||
emoteSchema.post('save', async function (next){
|
||||
//broadcast updated emotes
|
||||
server.channelManager.broadcastSiteEmotes();
|
||||
//Ensure the channel manager is actually up
|
||||
if(server.channelManager != null){
|
||||
//broadcast updated emotes
|
||||
server.channelManager.broadcastSiteEmotes();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -36,15 +36,20 @@ const tokeCommandSchema = new mongoose.Schema({
|
|||
* Pre-Save middleware, ensures tokebot receives all new toke commands
|
||||
*/
|
||||
tokeCommandSchema.pre('save', async function (next){
|
||||
//if the command was changed
|
||||
//if the channel manager, chat handler, and chat post-processor are all loaded up...
|
||||
if(this.isModified("command")){
|
||||
//Get server tokebot object
|
||||
const tokebot = server.channelManager.chatHandler.chatPreprocessor.tokebot;
|
||||
if(server.channelManager != null &&
|
||||
server.channelManager.chatHandler != null &&
|
||||
server.channelManager.chatHandler.chatPreprocessor == null){
|
||||
|
||||
//If tokebot is up and running
|
||||
if(tokebot != null && tokebot.tokeCommands != null){
|
||||
//Pop the command on to the end
|
||||
tokebot.tokeCommands.push(this.command);
|
||||
//Get server tokebot object
|
||||
const tokebot = server.channelManager.chatHandler.chatPreprocessor.tokebot;
|
||||
|
||||
//If tokebot is up and running
|
||||
if(tokebot != null && tokebot.tokeCommands != null){
|
||||
//Pop the command on to the end
|
||||
tokebot.tokeCommands.push(this.command);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue