diff --git a/dist/util/Config.js b/dist/util/Config.js index 6c19c436..e2aaa7be 100644 --- a/dist/util/Config.js +++ b/dist/util/Config.js @@ -33,7 +33,7 @@ exports.default = { return Config.data; }, setAll: function set(val) { - return Database_1.default.collection("config").updateOne({}, { $set: val }); + return Database_1.default.collection("config").updateOne({}, { $set: val }, { upsert: true }); }, }; exports.DefaultOptions = { diff --git a/dist/util/Config.js.map b/dist/util/Config.js.map index 5ba08276..71297a97 100644 --- a/dist/util/Config.js.map +++ b/dist/util/Config.js.map @@ -1 +1 @@ -{"version":3,"file":"Config.js","sourceRoot":"","sources":["../../src/util/Config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA0D;AAC1D,uCAAqC;AACrC,uDAA+C;AAE/C,IAAI,MAAM,GAAG,IAAI,wBAAa,CAAC,kBAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;AAEnF,kBAAe;IACd,IAAI,EAAE,KAAK,UAAU,IAAI,CAAC,cAAmB,sBAAc;QAC1D,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IACpD,CAAC;IACD,MAAM,EAAE,SAAS,GAAG;QACnB,OAAuB,MAAM,CAAC,IAAI,CAAC;IACpC,CAAC;IACD,MAAM,EAAE,SAAS,GAAG,CAAC,GAAQ;QAC5B,OAAO,kBAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;IAC7D,CAAC;CACD,CAAC;AAEW,QAAA,cAAc,GAAG;IAC7B,GAAG,EAAE,EAAE;IACP,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,EAAE;CACT,CAAC;AAQW,QAAA,YAAY,GAA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AAC,CAAC;AAEU,QAAA,WAAW,GAAG,gBAAK,CAAiB,QAAQ,EAAE,oBAAY,EAAE,QAAQ,CAAC,CAAC"} \ No newline at end of file diff --git a/src/util/Config.ts b/src/util/Config.ts index 83370df4..374fb0b3 100644 --- a/src/util/Config.ts +++ b/src/util/Config.ts @@ -13,7 +13,7 @@ export default { return Config.data; }, setAll: function set(val: any) { - return db.collection("config").updateOne({}, { $set: val }); + return db.collection("config").updateOne({}, { $set: val }, { upsert: true }); }, };