Fixed database stop crash, made playing status use the current bot username
This commit is contained in:
parent
5fa5f21289
commit
9b4861ae4a
4 changed files with 12 additions and 11 deletions
|
@ -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();
|
||||
};
|
|
@ -104,4 +104,8 @@ exports.setup = async () => {
|
|||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
exports.stop = async () => {
|
||||
await connection.end();
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue