This commit is contained in:
Erik 2022-07-07 18:49:15 +03:00
parent ced20a25f7
commit 208b8fb515
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB
3 changed files with 3 additions and 2 deletions

View File

@ -102,6 +102,7 @@ class ImportCommand extends SlashCommand {
log.case += highestOldId; log.case += highestOldId;
await this.client.mongodb.infractions.updateOne({ _id: log._id }, { case: log.case }); await this.client.mongodb.infractions.updateOne({ _id: log._id }, { case: log.case });
} }
await this.client.mongodb.infractions.insertMant(imported);
guild._data.caseId += highestOldId; guild._data.caseId += highestOldId;
} }

View File

@ -98,7 +98,7 @@ class StatsCommand extends SlashCommand {
memoryUsed: (memoryTotal - memoryFree).toFixed(1), memoryUsed: (memoryTotal - memoryFree).toFixed(1),
memoryTotal, memoryTotal,
osType: os.type(), osType: os.type(),
uptime: Util.humanise(Math.floor(Date.now()/1000) - os.uptime()), uptime: Util.humanise(Math.floor((Date.now() - os.uptime()) / 1000)),
hostname: os.hostname() hostname: os.hostname()
}; };

View File

@ -172,7 +172,7 @@ class MongodbTable {
_handleData(data) { //Convert data._id to Mongo ObjectIds _handleData(data) { //Convert data._id to Mongo ObjectIds
if (data._id && !(data._id instanceof ObjectId)) { if (data._id && !(data._id instanceof ObjectId)) {
if (typeof data._id === 'string') data._id = ObjectId(data._id); if (typeof data._id === 'string') data._id = ObjectId(data._id);
else if (typeof data._id === 'object') data._id = { else if (data._id instanceof Array) data._id = {
$in: Object.values(data._id)[0].map((id) => { $in: Object.values(data._id)[0].map((id) => {
return ObjectId(id); return ObjectId(id);
}) })