Fixed database stop crash, made playing status use the current bot username

This commit is contained in:
TheEssem 2020-12-18 18:57:41 -06:00
parent 5fa5f21289
commit 9b4861ae4a
4 changed files with 12 additions and 11 deletions

View file

@ -23,7 +23,7 @@ const globalSchema = new mongoose.Schema({
});
const Global = mongoose.model("Global", globalSchema);
exports.connection = mongoose.connection;
const connection = mongoose.connection;
exports.getGuild = async (query) => {
return await Guild.findOne({ id: query });
@ -134,4 +134,8 @@ exports.setup = async () => {
}
await global.save();
}
};
exports.stop = async () => {
await connection.disconnect();
};

View file

@ -104,4 +104,8 @@ exports.setup = async () => {
}
}
}
};
exports.stop = async () => {
await connection.end();
};