@opfr/services 1.1.5 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +344 -311
- package/dist/index.umd.js +1 -1
- package/dist/services/ban/helper.d.ts +2 -1
- package/dist/services/ban/helper.d.ts.map +1 -1
- package/dist/services/ban/process/updateOne.d.ts +1 -1
- package/dist/services/ban/process/updateOne.d.ts.map +1 -1
- package/dist/services/ban/service.d.ts +1 -1
- package/dist/services/ban/service.d.ts.map +1 -1
- package/dist/services/crew-meta/helper.d.ts +4 -1
- package/dist/services/crew-meta/helper.d.ts.map +1 -1
- package/dist/services/crew-meta/process/findOne.d.ts +1 -1
- package/dist/services/crew-meta/process/updateOne.d.ts +1 -1
- package/dist/services/reminder/helper.d.ts +2 -1
- package/dist/services/reminder/helper.d.ts.map +1 -1
- package/dist/services/user-crew/process/updateOne.d.ts.map +1 -1
- package/dist/services/user-meta/helper.d.ts +7 -2
- package/dist/services/user-meta/helper.d.ts.map +1 -1
- package/dist/services/user-meta/process/findMany.d.ts +5 -0
- package/dist/services/user-meta/process/findMany.d.ts.map +1 -0
- package/dist/services/user-meta/service.d.ts +2 -1
- package/dist/services/user-meta/service.d.ts.map +1 -1
- package/dist/services/user-settings/helper.d.ts +4 -4
- package/dist/services/user-settings/helper.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema as u, models as l, model as p, connect as ut, Types as ct } from "mongoose";
|
|
2
|
-
import { randomBetween as Y, hasExpire as L, sameDay as ye, yesterday as k, capitalizeAllWords as ot, filterNullAndUndefined as N, pickFrom as dt, shuffle as Te, recordToArray as
|
|
2
|
+
import { randomBetween as Y, hasExpire as L, sameDay as ye, yesterday as k, capitalizeAllWords as ot, filterNullAndUndefined as N, pickFrom as dt, shuffle as Te, recordToArray as R, arrayToRecord as ve, mergeObjects as F, exclude as q, groupBy as lt, sortBy as De, seededRandom as pt, range as yt } from "@opfr/utils-lang";
|
|
3
3
|
import ft from "node-cache";
|
|
4
4
|
import { CREW_DEFAULT_DISINTEGRATION as Ae, CREW_DEFAULT_MEMBER_LIMIT as mt, QuestStatus as D, CREW_DEFAULT_XP_PERCENT as ht, DEFAULT_FACTION as wt, RANK_IDS_WITHOUT_BASIC as Oe, EQUIPMENT_SLOT as Be, EQUIPMENT_FROM_SLOT_TO_TYPE as gt, EFFECT_KEYS as St, CHARACTERISTICS as bt, getComputedCharacteristicValue as $t, getCurrentLevel as Et, HP_PER_VITALITY as Ut, DEFAULT_MAX_HP as It, transformToDBBuff as Tt, SHOP_DEFAULT_AVAILABLE_ENTITY_AMOUNT as Dt } from "@opfr/definitions";
|
|
5
5
|
import * as fe from "events";
|
|
@@ -54,7 +54,7 @@ class b extends f {
|
|
|
54
54
|
}
|
|
55
55
|
const _e = new fe.EventEmitter(), m = (n, e, t) => {
|
|
56
56
|
_e.emit(n, e, t);
|
|
57
|
-
},
|
|
57
|
+
}, xs = (n) => {
|
|
58
58
|
for (const [e, t] of Object.entries(n))
|
|
59
59
|
_e.on(e, (a, r) => {
|
|
60
60
|
t(a, r);
|
|
@@ -81,7 +81,7 @@ const _e = new fe.EventEmitter(), m = (n, e, t) => {
|
|
|
81
81
|
USER_STATS_INVENTORY: "middleware/quest/USER_STATS_INVENTORY"
|
|
82
82
|
}, xe = new fe.EventEmitter(), me = (n, e, t) => {
|
|
83
83
|
xe.emit(n, e, t);
|
|
84
|
-
},
|
|
84
|
+
}, qs = (n) => {
|
|
85
85
|
for (const [e, t] of Object.entries(n))
|
|
86
86
|
xe.on(e, (a, r) => {
|
|
87
87
|
t(a, r);
|
|
@@ -194,7 +194,7 @@ const Ct = async (n) => {
|
|
|
194
194
|
}, Rt = (n, e) => W.findOneAndUpdate({ _id: n }, e, {
|
|
195
195
|
returnDocument: "after"
|
|
196
196
|
}).lean();
|
|
197
|
-
class
|
|
197
|
+
class Mt extends Ot {
|
|
198
198
|
constructor() {
|
|
199
199
|
super(3600);
|
|
200
200
|
}
|
|
@@ -211,17 +211,17 @@ class vt extends Ot {
|
|
|
211
211
|
return Rt(e, t);
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
const
|
|
214
|
+
const vt = new Mt();
|
|
215
215
|
class At extends f {
|
|
216
216
|
async hasXpBuff(e) {
|
|
217
217
|
const t = await this.get(e);
|
|
218
218
|
if (!L(t.buffs.xp.expireAt))
|
|
219
|
-
return t.buffs.xp
|
|
219
|
+
return t.buffs.xp;
|
|
220
220
|
}
|
|
221
221
|
async calcXp(e, t) {
|
|
222
|
-
const a = await
|
|
222
|
+
const a = await vt.get(e);
|
|
223
223
|
return a ? Math.ceil(
|
|
224
|
-
t * (a.disintegration / Ae) * (await this.hasXpBuff(e) ?? 1)
|
|
224
|
+
t * (a.disintegration / Ae) * ((await this.hasXpBuff(e))?.boost ?? 1)
|
|
225
225
|
) : 0;
|
|
226
226
|
}
|
|
227
227
|
async addXp(e, t) {
|
|
@@ -299,10 +299,10 @@ const we = l?.CrewMeta || p("CrewMeta", ke), Bt = async (n) => await we.create({
|
|
|
299
299
|
crew: n
|
|
300
300
|
});
|
|
301
301
|
async function _t(n) {
|
|
302
|
-
const e = await we.findOne({
|
|
302
|
+
const e = await we.findOne({ crew: n }).lean();
|
|
303
303
|
return e || y(await Bt(n));
|
|
304
304
|
}
|
|
305
|
-
const xt = (n, e) => we.findOneAndUpdate({
|
|
305
|
+
const xt = (n, e) => we.findOneAndUpdate({ crew: n }, e, {
|
|
306
306
|
returnDocument: "after",
|
|
307
307
|
upsert: !0
|
|
308
308
|
}).lean();
|
|
@@ -377,7 +377,7 @@ class zt extends kt {
|
|
|
377
377
|
return jt(e, t);
|
|
378
378
|
}
|
|
379
379
|
}
|
|
380
|
-
const
|
|
380
|
+
const ks = new zt();
|
|
381
381
|
class Pt extends b {
|
|
382
382
|
async getStatus(e, t) {
|
|
383
383
|
return (await this.get({ crew: e, questId: t })).status;
|
|
@@ -470,7 +470,7 @@ class Wt extends Pt {
|
|
|
470
470
|
return Qt(e, t, a);
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
|
-
const
|
|
473
|
+
const Ns = new Wt();
|
|
474
474
|
class Gt extends f {
|
|
475
475
|
async setActualVoiceMembers(e, t) {
|
|
476
476
|
await this.update(e, {
|
|
@@ -541,7 +541,7 @@ class Jt extends Gt {
|
|
|
541
541
|
return Vt(e, t);
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
|
-
const
|
|
544
|
+
const Fs = new Jt();
|
|
545
545
|
class Zt extends f {
|
|
546
546
|
}
|
|
547
547
|
const ze = new u({
|
|
@@ -591,7 +591,7 @@ class an extends Zt {
|
|
|
591
591
|
return nn(e, t);
|
|
592
592
|
}
|
|
593
593
|
}
|
|
594
|
-
const
|
|
594
|
+
const js = new an(), Pe = new u(
|
|
595
595
|
{
|
|
596
596
|
user: {
|
|
597
597
|
type: u.Types.ObjectId,
|
|
@@ -743,7 +743,7 @@ He.post("findOneAndUpdate", function(n) {
|
|
|
743
743
|
});
|
|
744
744
|
const te = l?.UserInventory || p("UserInventory", He), on = new fe.EventEmitter(), dn = (n, e) => {
|
|
745
745
|
on.emit(n, e);
|
|
746
|
-
},
|
|
746
|
+
}, C = {
|
|
747
747
|
multiplier: { type: Number, default: 0 },
|
|
748
748
|
origin: String,
|
|
749
749
|
expireAt: { type: Date, default: null },
|
|
@@ -771,33 +771,33 @@ const te = l?.UserInventory || p("UserInventory", He), on = new fe.EventEmitter(
|
|
|
771
771
|
buffs: {
|
|
772
772
|
cooldown: {
|
|
773
773
|
casino: {
|
|
774
|
-
type: [
|
|
774
|
+
type: [C],
|
|
775
775
|
default: []
|
|
776
776
|
},
|
|
777
777
|
work: {
|
|
778
|
-
type: [
|
|
778
|
+
type: [C],
|
|
779
779
|
default: []
|
|
780
780
|
}
|
|
781
781
|
},
|
|
782
782
|
berry: {
|
|
783
783
|
work: {
|
|
784
|
-
type: [
|
|
784
|
+
type: [C],
|
|
785
785
|
default: []
|
|
786
786
|
},
|
|
787
787
|
global: {
|
|
788
|
-
type: [
|
|
788
|
+
type: [C],
|
|
789
789
|
default: []
|
|
790
790
|
}
|
|
791
791
|
},
|
|
792
792
|
drop: {
|
|
793
793
|
work: {
|
|
794
|
-
type: [
|
|
794
|
+
type: [C],
|
|
795
795
|
default: []
|
|
796
796
|
}
|
|
797
797
|
},
|
|
798
798
|
xp: {
|
|
799
799
|
global: {
|
|
800
|
-
type: [
|
|
800
|
+
type: [C],
|
|
801
801
|
default: []
|
|
802
802
|
}
|
|
803
803
|
}
|
|
@@ -832,7 +832,7 @@ Le.post("findOneAndUpdate", async function(n) {
|
|
|
832
832
|
n
|
|
833
833
|
), n.hp <= 0 && dn("death", n.user._id);
|
|
834
834
|
});
|
|
835
|
-
const
|
|
835
|
+
const O = l?.UserMeta || p("UserMeta", Le), Qe = new u({
|
|
836
836
|
user: {
|
|
837
837
|
type: u.Types.ObjectId,
|
|
838
838
|
required: !0,
|
|
@@ -967,7 +967,7 @@ Ge.post("findOneAndUpdate", function(n) {
|
|
|
967
967
|
n
|
|
968
968
|
);
|
|
969
969
|
});
|
|
970
|
-
const
|
|
970
|
+
const M = l?.UserStatsCasino || p("UserStatsCasino", Ge), Ye = new u({
|
|
971
971
|
user: {
|
|
972
972
|
type: u.Types.ObjectId,
|
|
973
973
|
required: !0,
|
|
@@ -1071,7 +1071,7 @@ Ze.post("findOneAndUpdate", function(n) {
|
|
|
1071
1071
|
n
|
|
1072
1072
|
);
|
|
1073
1073
|
});
|
|
1074
|
-
const
|
|
1074
|
+
const v = l?.UserStatsFrequency || p(
|
|
1075
1075
|
"UserStatsFrequency",
|
|
1076
1076
|
Ze
|
|
1077
1077
|
), et = new u({
|
|
@@ -1123,7 +1123,7 @@ $e.post("findOneAndUpdate", function(n) {
|
|
|
1123
1123
|
});
|
|
1124
1124
|
$e.post("deleteOne", async function() {
|
|
1125
1125
|
const n = this.getQuery()._id;
|
|
1126
|
-
await V.deleteOne({ user: n }), await _.deleteOne({ user: n }), await J.deleteOne({ user: n }), await Z.deleteOne({ user: n }), await ee.deleteOne({ user: n }), await te.deleteOne({ user: n }), await
|
|
1126
|
+
await V.deleteOne({ user: n }), await _.deleteOne({ user: n }), await J.deleteOne({ user: n }), await Z.deleteOne({ user: n }), await ee.deleteOne({ user: n }), await te.deleteOne({ user: n }), await O.deleteOne({ user: n }), await ne.deleteOne({ user: n }), await B.deleteMany({ user: n }), await ae.deleteOne({ user: n }), await j.deleteOne({ user: n }), await re.deleteOne({ user: n }), await M.deleteOne({ user: n }), await se.deleteOne({ user: n }), await ie.deleteOne({ user: n }), await ue.deleteOne({ user: n }), await ce.deleteOne({ user: n }), await v.deleteOne({ user: n }), await A.deleteOne({ user: n });
|
|
1127
1127
|
});
|
|
1128
1128
|
const $ = l?.User || p("User", $e);
|
|
1129
1129
|
class yn extends b {
|
|
@@ -1383,7 +1383,7 @@ class gn extends yn {
|
|
|
1383
1383
|
return wn(e, t);
|
|
1384
1384
|
}
|
|
1385
1385
|
}
|
|
1386
|
-
const Sn = new gn(),
|
|
1386
|
+
const Sn = new gn(), zs = [
|
|
1387
1387
|
"work",
|
|
1388
1388
|
"rps",
|
|
1389
1389
|
"blackjack",
|
|
@@ -1558,8 +1558,8 @@ const Rn = new u(
|
|
|
1558
1558
|
strength: Number
|
|
1559
1559
|
},
|
|
1560
1560
|
{ minimize: !1 }
|
|
1561
|
-
), Ee = l?.Ornaments || p("Ornaments", Rn),
|
|
1562
|
-
async function
|
|
1561
|
+
), Ee = l?.Ornaments || p("Ornaments", Rn), Mn = async (n, e = {}) => Ee.find(n, e).lean();
|
|
1562
|
+
async function vn(n) {
|
|
1563
1563
|
const e = await Ee.findOne({ ornamentId: n }).lean();
|
|
1564
1564
|
return e || null;
|
|
1565
1565
|
}
|
|
@@ -1574,10 +1574,10 @@ class Bn extends Cn {
|
|
|
1574
1574
|
return An(e, t);
|
|
1575
1575
|
}
|
|
1576
1576
|
fetchFromDb(e) {
|
|
1577
|
-
return
|
|
1577
|
+
return vn(e);
|
|
1578
1578
|
}
|
|
1579
1579
|
fetchManyFromDb(e) {
|
|
1580
|
-
return
|
|
1580
|
+
return Mn(e);
|
|
1581
1581
|
}
|
|
1582
1582
|
getKey(e) {
|
|
1583
1583
|
return e.ornamentId;
|
|
@@ -1695,14 +1695,14 @@ class Pn extends b {
|
|
|
1695
1695
|
}
|
|
1696
1696
|
async recordToEntityTuple(e) {
|
|
1697
1697
|
const t = await this.getAll();
|
|
1698
|
-
return
|
|
1698
|
+
return R(e).reduce((a, [r, s]) => {
|
|
1699
1699
|
const i = t.find(({ entityId: o }) => o === r);
|
|
1700
1700
|
return i && a.push([i, s]), a;
|
|
1701
1701
|
}, []);
|
|
1702
1702
|
}
|
|
1703
1703
|
async getAllEntitiesLimit() {
|
|
1704
1704
|
const e = await this.getAll();
|
|
1705
|
-
return
|
|
1705
|
+
return ve(
|
|
1706
1706
|
e.map((t) => [t.entityId, t.shop?.limit ?? 0])
|
|
1707
1707
|
);
|
|
1708
1708
|
}
|
|
@@ -1816,7 +1816,7 @@ class Pn extends b {
|
|
|
1816
1816
|
}
|
|
1817
1817
|
seedEquipment(e, t) {
|
|
1818
1818
|
const a = pt(t), r = De(
|
|
1819
|
-
|
|
1819
|
+
R(e.characteristics),
|
|
1820
1820
|
([s]) => s
|
|
1821
1821
|
);
|
|
1822
1822
|
return {
|
|
@@ -2001,7 +2001,7 @@ class Jn extends b {
|
|
|
2001
2001
|
return this.cache.set(t, r), r.map(({ user: s }) => s);
|
|
2002
2002
|
}
|
|
2003
2003
|
}
|
|
2004
|
-
const Zn = (n) => _.find(n).lean(), ea = (n) => _.findOne({ user: n }).lean(), ta = (n, e) => _.findOneAndUpdate({ user: n }, e).lean();
|
|
2004
|
+
const Zn = (n) => _.find(n).lean(), ea = (n) => _.findOne({ user: n }).lean(), ta = (n, e) => _.findOneAndUpdate({ user: n }, e, { returnDocument: "after" }).lean();
|
|
2005
2005
|
class na extends Jn {
|
|
2006
2006
|
constructor() {
|
|
2007
2007
|
super(300);
|
|
@@ -2121,7 +2121,7 @@ class oa extends f {
|
|
|
2121
2121
|
return !0;
|
|
2122
2122
|
}
|
|
2123
2123
|
hasInventoryRequirements(e, t) {
|
|
2124
|
-
return
|
|
2124
|
+
return R(t).reduce(
|
|
2125
2125
|
(a, [r, s]) => a && (e.itemList[r] ?? 0) >= (s ?? 0),
|
|
2126
2126
|
!0
|
|
2127
2127
|
);
|
|
@@ -2179,7 +2179,7 @@ class oa extends f {
|
|
|
2179
2179
|
)
|
|
2180
2180
|
}), await pe.addEntities(
|
|
2181
2181
|
e,
|
|
2182
|
-
|
|
2182
|
+
R(t).filter(([, a]) => a > 0).map(([a]) => a)
|
|
2183
2183
|
);
|
|
2184
2184
|
}
|
|
2185
2185
|
async removeItem(e, t, a) {
|
|
@@ -2197,7 +2197,7 @@ class oa extends f {
|
|
|
2197
2197
|
await this.update(e, {
|
|
2198
2198
|
$pull: {
|
|
2199
2199
|
equipmentList: {
|
|
2200
|
-
|
|
2200
|
+
entityId: t,
|
|
2201
2201
|
seed: a
|
|
2202
2202
|
}
|
|
2203
2203
|
}
|
|
@@ -2229,7 +2229,7 @@ class oa extends f {
|
|
|
2229
2229
|
}
|
|
2230
2230
|
async equip(e, t) {
|
|
2231
2231
|
const a = await I.getMaxHp(e), r = Object.fromEntries(
|
|
2232
|
-
|
|
2232
|
+
R(t).map(([s, i]) => [
|
|
2233
2233
|
`equippedItems.${s}`,
|
|
2234
2234
|
i
|
|
2235
2235
|
])
|
|
@@ -2294,12 +2294,12 @@ class ya extends oa {
|
|
|
2294
2294
|
}
|
|
2295
2295
|
}
|
|
2296
2296
|
const S = new ya();
|
|
2297
|
-
class fa extends
|
|
2297
|
+
class fa extends b {
|
|
2298
2298
|
getTotalCharacteristics({
|
|
2299
2299
|
characteristics: e,
|
|
2300
2300
|
scrolls: t
|
|
2301
2301
|
}) {
|
|
2302
|
-
return
|
|
2302
|
+
return ve(
|
|
2303
2303
|
bt.map((a) => [
|
|
2304
2304
|
a,
|
|
2305
2305
|
$t(e[a]) + t[a]
|
|
@@ -2310,6 +2310,44 @@ class fa extends f {
|
|
|
2310
2310
|
const t = await this.get(e);
|
|
2311
2311
|
return Date.now() - t.xp.lastMessageWithXp.getTime() > 60 * 1e3;
|
|
2312
2312
|
}
|
|
2313
|
+
async getAllWithExpiredBuffs() {
|
|
2314
|
+
const e = /* @__PURE__ */ new Date();
|
|
2315
|
+
return this.getMany({
|
|
2316
|
+
$or: [
|
|
2317
|
+
{ "xp.boost": { $lt: e } },
|
|
2318
|
+
{
|
|
2319
|
+
"buffs.cooldown.casino": {
|
|
2320
|
+
$elemMatch: { expireAt: { $lt: e } }
|
|
2321
|
+
}
|
|
2322
|
+
},
|
|
2323
|
+
{
|
|
2324
|
+
"buffs.cooldown.work": {
|
|
2325
|
+
$elemMatch: { expireAt: { $lt: e } }
|
|
2326
|
+
}
|
|
2327
|
+
},
|
|
2328
|
+
{
|
|
2329
|
+
"buffs.berry.work": {
|
|
2330
|
+
$elemMatch: { expireAt: { $lt: e } }
|
|
2331
|
+
}
|
|
2332
|
+
},
|
|
2333
|
+
{
|
|
2334
|
+
"buffs.berry.global": {
|
|
2335
|
+
$elemMatch: { expireAt: { $lt: e } }
|
|
2336
|
+
}
|
|
2337
|
+
},
|
|
2338
|
+
{
|
|
2339
|
+
"buffs.drop.work": {
|
|
2340
|
+
$elemMatch: { expireAt: { $lt: e } }
|
|
2341
|
+
}
|
|
2342
|
+
},
|
|
2343
|
+
{
|
|
2344
|
+
"buffs.xp.global": {
|
|
2345
|
+
$elemMatch: { expireAt: { $lt: e } }
|
|
2346
|
+
}
|
|
2347
|
+
}
|
|
2348
|
+
]
|
|
2349
|
+
});
|
|
2350
|
+
}
|
|
2313
2351
|
async calcXpBoost(e) {
|
|
2314
2352
|
const t = await this.get(e), { boost: a } = t.xp, r = a !== null && Date.now() < a.getTime() ? 0.2 : 0, s = Math.max(
|
|
2315
2353
|
t.premium ? 0.5 : 0,
|
|
@@ -2375,7 +2413,7 @@ class fa extends f {
|
|
|
2375
2413
|
}
|
|
2376
2414
|
}
|
|
2377
2415
|
async getGlobalRank(e) {
|
|
2378
|
-
return (await
|
|
2416
|
+
return (await O.aggregate([
|
|
2379
2417
|
{
|
|
2380
2418
|
$setWindowFields: {
|
|
2381
2419
|
sortBy: { "xp.amount": -1 },
|
|
@@ -2384,12 +2422,12 @@ class fa extends f {
|
|
|
2384
2422
|
}
|
|
2385
2423
|
}
|
|
2386
2424
|
},
|
|
2387
|
-
{ $match: {
|
|
2425
|
+
{ $match: { user: e } },
|
|
2388
2426
|
{ $project: { rank: 1 } }
|
|
2389
2427
|
]))[0];
|
|
2390
2428
|
}
|
|
2391
2429
|
async getBerryRank(e) {
|
|
2392
|
-
return (await
|
|
2430
|
+
return (await O.aggregate([
|
|
2393
2431
|
{
|
|
2394
2432
|
$setWindowFields: {
|
|
2395
2433
|
sortBy: { berry: -1 },
|
|
@@ -2398,7 +2436,7 @@ class fa extends f {
|
|
|
2398
2436
|
}
|
|
2399
2437
|
}
|
|
2400
2438
|
},
|
|
2401
|
-
{ $match: {
|
|
2439
|
+
{ $match: { user: e } },
|
|
2402
2440
|
{ $project: { rank: 1 } }
|
|
2403
2441
|
]))[0];
|
|
2404
2442
|
}
|
|
@@ -2690,18 +2728,18 @@ class fa extends f {
|
|
|
2690
2728
|
return await this.addBerry(e, r), r;
|
|
2691
2729
|
}
|
|
2692
2730
|
}
|
|
2693
|
-
const ma = async (n) => await
|
|
2731
|
+
const ma = (n) => O.find(n).lean(), ha = async (n) => await O.create({
|
|
2694
2732
|
user: n
|
|
2695
2733
|
});
|
|
2696
|
-
async function
|
|
2697
|
-
const e = await
|
|
2698
|
-
return e || y(await
|
|
2734
|
+
async function wa(n) {
|
|
2735
|
+
const e = await O.findOne({ user: n }).lean();
|
|
2736
|
+
return e || y(await ha(n));
|
|
2699
2737
|
}
|
|
2700
|
-
const
|
|
2738
|
+
const ga = (n, e) => O.findOneAndUpdate({ user: n }, e, {
|
|
2701
2739
|
returnDocument: "after",
|
|
2702
2740
|
upsert: !0
|
|
2703
2741
|
}).lean();
|
|
2704
|
-
class
|
|
2742
|
+
class Sa extends fa {
|
|
2705
2743
|
constructor() {
|
|
2706
2744
|
super(300);
|
|
2707
2745
|
}
|
|
@@ -2712,54 +2750,47 @@ class ga extends fa {
|
|
|
2712
2750
|
return e;
|
|
2713
2751
|
}
|
|
2714
2752
|
fetchFromDb(e) {
|
|
2715
|
-
return
|
|
2753
|
+
return wa(e);
|
|
2754
|
+
}
|
|
2755
|
+
fetchManyFromDb(e) {
|
|
2756
|
+
return ma(e);
|
|
2716
2757
|
}
|
|
2717
2758
|
updateInDb(e, t) {
|
|
2718
|
-
return
|
|
2759
|
+
return ga(e, t);
|
|
2719
2760
|
}
|
|
2720
2761
|
}
|
|
2721
|
-
const I = new
|
|
2722
|
-
class
|
|
2762
|
+
const I = new Sa();
|
|
2763
|
+
class ba extends b {
|
|
2723
2764
|
async updateSendDailyQuest(e, t) {
|
|
2724
|
-
await this.update(
|
|
2725
|
-
{ discordId: e },
|
|
2726
|
-
{ $set: { sendDailyQuest: t } }
|
|
2727
|
-
);
|
|
2765
|
+
await this.update(e, { $set: { sendDailyQuest: t } });
|
|
2728
2766
|
}
|
|
2729
2767
|
async updateSendDailyReport(e, t) {
|
|
2730
|
-
await this.update(
|
|
2731
|
-
{ discordId: e },
|
|
2732
|
-
{ $set: { sendDailyReport: t } }
|
|
2733
|
-
);
|
|
2768
|
+
await this.update(e, { $set: { sendDailyReport: t } });
|
|
2734
2769
|
}
|
|
2735
2770
|
async updateInventorySort(e, t) {
|
|
2736
|
-
await this.update(
|
|
2771
|
+
await this.update(e, { $set: { "sort.inventory": t } });
|
|
2737
2772
|
}
|
|
2738
2773
|
async updateReminderSettings(e, t, a) {
|
|
2739
|
-
await this.update(
|
|
2740
|
-
{ discordId: e },
|
|
2741
|
-
{ $set: { [`reminder.${t}`]: a } }
|
|
2742
|
-
);
|
|
2774
|
+
await this.update(e, { $set: { [`reminder.${t}`]: a } });
|
|
2743
2775
|
}
|
|
2744
2776
|
getUsersWithDailyReportEnable() {
|
|
2745
2777
|
return this.getMany({
|
|
2746
|
-
|
|
2747
|
-
faction: { $ne: "citizen" }
|
|
2778
|
+
sendDailyReport: !0
|
|
2748
2779
|
});
|
|
2749
2780
|
}
|
|
2750
2781
|
}
|
|
2751
|
-
const
|
|
2782
|
+
const $a = (n) => j.find(n).lean(), Ea = async (n) => await j.create({
|
|
2752
2783
|
user: n
|
|
2753
2784
|
});
|
|
2754
|
-
async function
|
|
2785
|
+
async function Ua(n) {
|
|
2755
2786
|
const e = await j.findOne({ user: n }).lean();
|
|
2756
|
-
return e || y(await
|
|
2787
|
+
return e || y(await Ea(n));
|
|
2757
2788
|
}
|
|
2758
|
-
const
|
|
2789
|
+
const Ia = (n, e) => j.findOneAndUpdate({ user: n }, e, {
|
|
2759
2790
|
returnDocument: "after",
|
|
2760
2791
|
upsert: !0
|
|
2761
2792
|
}).lean();
|
|
2762
|
-
class
|
|
2793
|
+
class Ta extends ba {
|
|
2763
2794
|
constructor() {
|
|
2764
2795
|
super(3600);
|
|
2765
2796
|
}
|
|
@@ -2770,17 +2801,17 @@ class Ia extends Sa {
|
|
|
2770
2801
|
return e.user;
|
|
2771
2802
|
}
|
|
2772
2803
|
fetchFromDb(e) {
|
|
2773
|
-
return
|
|
2804
|
+
return Ua(e);
|
|
2774
2805
|
}
|
|
2775
2806
|
fetchManyFromDb(e) {
|
|
2776
|
-
return
|
|
2807
|
+
return $a(e);
|
|
2777
2808
|
}
|
|
2778
2809
|
updateInDb(e, t) {
|
|
2779
|
-
return
|
|
2810
|
+
return Ia(e, t);
|
|
2780
2811
|
}
|
|
2781
2812
|
}
|
|
2782
|
-
const Re = new
|
|
2783
|
-
class
|
|
2813
|
+
const Re = new Ta();
|
|
2814
|
+
class Da extends f {
|
|
2784
2815
|
async getCommandCooldown(e, t) {
|
|
2785
2816
|
return (await this.get(e)).commands[t];
|
|
2786
2817
|
}
|
|
@@ -2845,18 +2876,18 @@ class Ta extends f {
|
|
|
2845
2876
|
);
|
|
2846
2877
|
}
|
|
2847
2878
|
}
|
|
2848
|
-
const
|
|
2879
|
+
const Oa = async (n) => await V.create({
|
|
2849
2880
|
user: n
|
|
2850
2881
|
});
|
|
2851
|
-
async function
|
|
2882
|
+
async function Ca(n) {
|
|
2852
2883
|
const e = await V.findOne({ user: n }).lean();
|
|
2853
|
-
return e || y(await
|
|
2884
|
+
return e || y(await Oa(n));
|
|
2854
2885
|
}
|
|
2855
|
-
const
|
|
2886
|
+
const Ra = (n, e) => V.findOneAndUpdate({ user: n }, e, {
|
|
2856
2887
|
returnDocument: "after",
|
|
2857
2888
|
upsert: !0
|
|
2858
2889
|
}).lean();
|
|
2859
|
-
class
|
|
2890
|
+
class Ma extends Da {
|
|
2860
2891
|
constructor() {
|
|
2861
2892
|
super(300);
|
|
2862
2893
|
}
|
|
@@ -2867,14 +2898,14 @@ class Ra extends Ta {
|
|
|
2867
2898
|
return e.user;
|
|
2868
2899
|
}
|
|
2869
2900
|
fetchFromDb(e) {
|
|
2870
|
-
return
|
|
2901
|
+
return Ca(e);
|
|
2871
2902
|
}
|
|
2872
2903
|
updateInDb(e, t) {
|
|
2873
|
-
return
|
|
2904
|
+
return Ra(e, t);
|
|
2874
2905
|
}
|
|
2875
2906
|
}
|
|
2876
|
-
const va = new
|
|
2877
|
-
class
|
|
2907
|
+
const va = new Ma();
|
|
2908
|
+
class Aa extends f {
|
|
2878
2909
|
async unlockTitle(e, t) {
|
|
2879
2910
|
await g.isOrnamentIds([t], g.isTitle) && await this.update(e, { $addToSet: { unlockedTitles: t } });
|
|
2880
2911
|
}
|
|
@@ -2943,18 +2974,18 @@ class Ma extends f {
|
|
|
2943
2974
|
});
|
|
2944
2975
|
}
|
|
2945
2976
|
}
|
|
2946
|
-
const
|
|
2977
|
+
const Ba = async (n) => await ne.create({
|
|
2947
2978
|
user: n
|
|
2948
2979
|
});
|
|
2949
|
-
async function
|
|
2980
|
+
async function _a(n) {
|
|
2950
2981
|
const e = await ne.findOne({ user: n }).lean();
|
|
2951
|
-
return e || y(await
|
|
2982
|
+
return e || y(await Ba(n));
|
|
2952
2983
|
}
|
|
2953
|
-
const
|
|
2984
|
+
const xa = async (n, e) => ne.findOneAndUpdate({ user: n }, e, {
|
|
2954
2985
|
upsert: !0,
|
|
2955
2986
|
returnDocument: "after"
|
|
2956
2987
|
}).lean();
|
|
2957
|
-
class
|
|
2988
|
+
class qa extends Aa {
|
|
2958
2989
|
constructor() {
|
|
2959
2990
|
super(300);
|
|
2960
2991
|
}
|
|
@@ -2965,14 +2996,14 @@ class xa extends Ma {
|
|
|
2965
2996
|
return e;
|
|
2966
2997
|
}
|
|
2967
2998
|
fetchFromDb(e) {
|
|
2968
|
-
return
|
|
2999
|
+
return _a(e);
|
|
2969
3000
|
}
|
|
2970
3001
|
updateInDb(e, t) {
|
|
2971
|
-
return
|
|
3002
|
+
return xa(e, t);
|
|
2972
3003
|
}
|
|
2973
3004
|
}
|
|
2974
|
-
const G = new
|
|
2975
|
-
class
|
|
3005
|
+
const G = new qa();
|
|
3006
|
+
class ka extends b {
|
|
2976
3007
|
async getStatus(e, t) {
|
|
2977
3008
|
return (await this.get({ user: e, questId: t })).status;
|
|
2978
3009
|
}
|
|
@@ -3019,24 +3050,24 @@ class qa extends b {
|
|
|
3019
3050
|
);
|
|
3020
3051
|
}
|
|
3021
3052
|
}
|
|
3022
|
-
function
|
|
3053
|
+
function Na(n) {
|
|
3023
3054
|
return B.find(n).lean();
|
|
3024
3055
|
}
|
|
3025
|
-
const
|
|
3056
|
+
const Fa = async (n) => await B.create({
|
|
3026
3057
|
...n
|
|
3027
3058
|
});
|
|
3028
|
-
async function
|
|
3059
|
+
async function ja(n) {
|
|
3029
3060
|
const e = await B.findOne(n).lean();
|
|
3030
|
-
return e || y(await
|
|
3061
|
+
return e || y(await Fa(n));
|
|
3031
3062
|
}
|
|
3032
|
-
function
|
|
3063
|
+
function za(n, e, t) {
|
|
3033
3064
|
return B.findOneAndUpdate(n, e, {
|
|
3034
3065
|
upsert: !0,
|
|
3035
3066
|
...t,
|
|
3036
3067
|
returnDocument: "after"
|
|
3037
3068
|
}).lean();
|
|
3038
3069
|
}
|
|
3039
|
-
class
|
|
3070
|
+
class Pa extends ka {
|
|
3040
3071
|
constructor() {
|
|
3041
3072
|
super(3600);
|
|
3042
3073
|
}
|
|
@@ -3050,19 +3081,19 @@ class za extends qa {
|
|
|
3050
3081
|
return { user: e, questId: t };
|
|
3051
3082
|
}
|
|
3052
3083
|
fetchFromDb(e) {
|
|
3053
|
-
return
|
|
3084
|
+
return ja(e);
|
|
3054
3085
|
}
|
|
3055
3086
|
fetchManyFromDb(e) {
|
|
3056
|
-
return
|
|
3087
|
+
return Na(e);
|
|
3057
3088
|
}
|
|
3058
3089
|
updateInDb(e, t, a) {
|
|
3059
|
-
return
|
|
3090
|
+
return za(e, t, a);
|
|
3060
3091
|
}
|
|
3061
3092
|
}
|
|
3062
|
-
const
|
|
3063
|
-
class
|
|
3093
|
+
const Me = new Pa();
|
|
3094
|
+
class Ka extends f {
|
|
3064
3095
|
async updateDailyReport(e) {
|
|
3065
|
-
const t = await I.get(e), a = await G.get(e), r = await
|
|
3096
|
+
const t = await I.get(e), a = await G.get(e), r = await Me.getMany({
|
|
3066
3097
|
user: e,
|
|
3067
3098
|
status: D.COMPLETED
|
|
3068
3099
|
});
|
|
@@ -3090,7 +3121,7 @@ class Pa extends f {
|
|
|
3090
3121
|
} = t;
|
|
3091
3122
|
if (s <= 0)
|
|
3092
3123
|
return;
|
|
3093
|
-
const o = await I.get(e), c = await
|
|
3124
|
+
const o = await I.get(e), c = await Me.getMany({
|
|
3094
3125
|
user: e,
|
|
3095
3126
|
status: D.COMPLETED
|
|
3096
3127
|
}), w = await G.get(e), { berry: x, xp: T } = o, { voice: K, amount: nt } = T, { unlockedBadges: at, unlockedBackgrounds: rt, unlockedTitles: st } = w;
|
|
@@ -3126,18 +3157,18 @@ class Pa extends f {
|
|
|
3126
3157
|
);
|
|
3127
3158
|
}
|
|
3128
3159
|
}
|
|
3129
|
-
const
|
|
3160
|
+
const Ha = (n) => J.create({
|
|
3130
3161
|
user: n
|
|
3131
3162
|
});
|
|
3132
|
-
async function
|
|
3163
|
+
async function La(n) {
|
|
3133
3164
|
const e = await J.findOne({ user: n }).lean();
|
|
3134
|
-
return e || y(await
|
|
3165
|
+
return e || y(await Ha(n));
|
|
3135
3166
|
}
|
|
3136
|
-
const
|
|
3167
|
+
const Qa = (n, e) => J.findOneAndUpdate({ user: n }, e, {
|
|
3137
3168
|
upsert: !0,
|
|
3138
3169
|
returnDocument: "after"
|
|
3139
3170
|
}).lean();
|
|
3140
|
-
class
|
|
3171
|
+
class Wa extends Ka {
|
|
3141
3172
|
constructor() {
|
|
3142
3173
|
super(60);
|
|
3143
3174
|
}
|
|
@@ -3148,14 +3179,14 @@ class Qa extends Pa {
|
|
|
3148
3179
|
return e.user;
|
|
3149
3180
|
}
|
|
3150
3181
|
fetchFromDb(e) {
|
|
3151
|
-
return
|
|
3182
|
+
return La(e);
|
|
3152
3183
|
}
|
|
3153
3184
|
updateInDb(e, t) {
|
|
3154
|
-
return
|
|
3185
|
+
return Qa(e, t);
|
|
3155
3186
|
}
|
|
3156
3187
|
}
|
|
3157
|
-
const
|
|
3158
|
-
class
|
|
3188
|
+
const Ps = new Wa();
|
|
3189
|
+
class Ga extends f {
|
|
3159
3190
|
async setGuessGame(e, t, a, r) {
|
|
3160
3191
|
await this.update(e, {
|
|
3161
3192
|
$set: {
|
|
@@ -3186,18 +3217,18 @@ class Wa extends f {
|
|
|
3186
3217
|
});
|
|
3187
3218
|
}
|
|
3188
3219
|
}
|
|
3189
|
-
const
|
|
3220
|
+
const Ya = async (n) => await ee.create({
|
|
3190
3221
|
user: n
|
|
3191
3222
|
});
|
|
3192
|
-
async function
|
|
3223
|
+
async function Xa(n) {
|
|
3193
3224
|
const e = await ee.findOne({ user: n }).lean();
|
|
3194
|
-
return e || y(await
|
|
3225
|
+
return e || y(await Ya(n));
|
|
3195
3226
|
}
|
|
3196
|
-
const
|
|
3227
|
+
const Va = (n, e) => ee.findOneAndUpdate({ user: n }, e, {
|
|
3197
3228
|
upsert: !0,
|
|
3198
3229
|
returnDocument: "after"
|
|
3199
3230
|
}).lean();
|
|
3200
|
-
class
|
|
3231
|
+
class Ja extends Ga {
|
|
3201
3232
|
constructor() {
|
|
3202
3233
|
super(300);
|
|
3203
3234
|
}
|
|
@@ -3208,14 +3239,14 @@ class Va extends Wa {
|
|
|
3208
3239
|
return e;
|
|
3209
3240
|
}
|
|
3210
3241
|
fetchFromDb(e) {
|
|
3211
|
-
return
|
|
3242
|
+
return Xa(e);
|
|
3212
3243
|
}
|
|
3213
3244
|
updateInDb(e, t) {
|
|
3214
|
-
return
|
|
3245
|
+
return Va(e, t);
|
|
3215
3246
|
}
|
|
3216
3247
|
}
|
|
3217
|
-
const
|
|
3218
|
-
class
|
|
3248
|
+
const Ks = new Ja();
|
|
3249
|
+
class Za extends f {
|
|
3219
3250
|
async hasUnlockedRaid(e, t) {
|
|
3220
3251
|
return (await this.get(e)).unlocked?.[t];
|
|
3221
3252
|
}
|
|
@@ -3282,7 +3313,7 @@ class Ja extends f {
|
|
|
3282
3313
|
async addRewardsToRaid(e, t) {
|
|
3283
3314
|
await this.update(e, {
|
|
3284
3315
|
$inc: Object.fromEntries(
|
|
3285
|
-
|
|
3316
|
+
R(t).filter(([a]) => a !== "title" && a !== "condition").map(([a, r]) => [`currentRaid.rewards.${a}`, r])
|
|
3286
3317
|
),
|
|
3287
3318
|
...t.title ? { $set: { "currentRaid.rewards.title": t.title } } : {}
|
|
3288
3319
|
});
|
|
@@ -3295,16 +3326,16 @@ class Ja extends f {
|
|
|
3295
3326
|
});
|
|
3296
3327
|
}
|
|
3297
3328
|
}
|
|
3298
|
-
const
|
|
3329
|
+
const er = (n) => ae.create({
|
|
3299
3330
|
user: n
|
|
3300
|
-
}),
|
|
3331
|
+
}), tr = async (n) => {
|
|
3301
3332
|
const e = await ae.findOne({ user: n }).lean();
|
|
3302
|
-
return e || y(await
|
|
3303
|
-
},
|
|
3333
|
+
return e || y(await er(n));
|
|
3334
|
+
}, nr = (n, e) => ae.findOneAndUpdate({ user: n }, e, {
|
|
3304
3335
|
upsert: !0,
|
|
3305
3336
|
returnDocument: "after"
|
|
3306
3337
|
});
|
|
3307
|
-
class
|
|
3338
|
+
class ar extends Za {
|
|
3308
3339
|
constructor() {
|
|
3309
3340
|
super(3600);
|
|
3310
3341
|
}
|
|
@@ -3315,14 +3346,14 @@ class nr extends Ja {
|
|
|
3315
3346
|
return e;
|
|
3316
3347
|
}
|
|
3317
3348
|
fetchFromDb(e) {
|
|
3318
|
-
return
|
|
3349
|
+
return tr(e);
|
|
3319
3350
|
}
|
|
3320
3351
|
updateInDb(e, t) {
|
|
3321
|
-
return
|
|
3352
|
+
return nr(e, t);
|
|
3322
3353
|
}
|
|
3323
3354
|
}
|
|
3324
|
-
const
|
|
3325
|
-
class
|
|
3355
|
+
const Hs = new ar();
|
|
3356
|
+
class rr extends f {
|
|
3326
3357
|
async isBuyLimitReached(e, t, a) {
|
|
3327
3358
|
const r = await d.getAllEntitiesLimit();
|
|
3328
3359
|
if (await d.isEntityId(t, d.isEquipment))
|
|
@@ -3367,16 +3398,16 @@ class ar extends f {
|
|
|
3367
3398
|
]);
|
|
3368
3399
|
}
|
|
3369
3400
|
}
|
|
3370
|
-
const
|
|
3401
|
+
const sr = async (n) => await re.create({
|
|
3371
3402
|
user: n
|
|
3372
|
-
}),
|
|
3403
|
+
}), ir = async (n) => {
|
|
3373
3404
|
const e = await re.findOne({ user: n }).lean();
|
|
3374
|
-
return e || y(await
|
|
3375
|
-
},
|
|
3405
|
+
return e || y(await sr(n));
|
|
3406
|
+
}, ur = (n, e) => re.findOneAndUpdate({ user: n }, e, {
|
|
3376
3407
|
upsert: !0,
|
|
3377
3408
|
returnDocument: "after"
|
|
3378
3409
|
}).lean();
|
|
3379
|
-
class
|
|
3410
|
+
class cr extends rr {
|
|
3380
3411
|
constructor() {
|
|
3381
3412
|
super(300);
|
|
3382
3413
|
}
|
|
@@ -3387,14 +3418,14 @@ class ur extends ar {
|
|
|
3387
3418
|
return e;
|
|
3388
3419
|
}
|
|
3389
3420
|
fetchFromDb(e) {
|
|
3390
|
-
return
|
|
3421
|
+
return ir(e);
|
|
3391
3422
|
}
|
|
3392
3423
|
updateInDb(e, t) {
|
|
3393
|
-
return
|
|
3424
|
+
return ur(e, t);
|
|
3394
3425
|
}
|
|
3395
3426
|
}
|
|
3396
|
-
const
|
|
3397
|
-
class
|
|
3427
|
+
const Ls = new cr();
|
|
3428
|
+
class or extends f {
|
|
3398
3429
|
async didSevenDoubleAtDoQ(e) {
|
|
3399
3430
|
await this.update(e, {
|
|
3400
3431
|
$inc: { "doubleOrQuit.sevenDoubleInARowCount": 1 }
|
|
@@ -3421,7 +3452,7 @@ class cr extends f {
|
|
|
3421
3452
|
const t = k();
|
|
3422
3453
|
t.setHours(0, 0, 0, 0);
|
|
3423
3454
|
const a = /* @__PURE__ */ new Date();
|
|
3424
|
-
a.setHours(0, 0, 0, 0), await
|
|
3455
|
+
a.setHours(0, 0, 0, 0), await M.updateOne(
|
|
3425
3456
|
{
|
|
3426
3457
|
user: e,
|
|
3427
3458
|
"bet666.last": {
|
|
@@ -3430,7 +3461,7 @@ class cr extends f {
|
|
|
3430
3461
|
}
|
|
3431
3462
|
},
|
|
3432
3463
|
{ $inc: { "bet666.count": 1 }, $set: { "bet666.last": /* @__PURE__ */ new Date() } }
|
|
3433
|
-
), await
|
|
3464
|
+
), await M.updateOne(
|
|
3434
3465
|
{
|
|
3435
3466
|
user: e,
|
|
3436
3467
|
"bet666.last": {
|
|
@@ -3473,18 +3504,18 @@ class cr extends f {
|
|
|
3473
3504
|
await this.update(e, { $inc: { "dice.drawWithDoubleSixCount": 1 } });
|
|
3474
3505
|
}
|
|
3475
3506
|
}
|
|
3476
|
-
const
|
|
3507
|
+
const dr = async (n) => await M.create({
|
|
3477
3508
|
user: n
|
|
3478
3509
|
});
|
|
3479
|
-
async function
|
|
3480
|
-
const e = await
|
|
3481
|
-
return e || y(await
|
|
3510
|
+
async function lr(n) {
|
|
3511
|
+
const e = await M.findOne({ user: n }).lean();
|
|
3512
|
+
return e || y(await dr(n));
|
|
3482
3513
|
}
|
|
3483
|
-
const
|
|
3514
|
+
const pr = (n, e) => M.findOneAndUpdate({ user: n }, e, {
|
|
3484
3515
|
upsert: !0,
|
|
3485
3516
|
returnDocument: "after"
|
|
3486
3517
|
}).lean();
|
|
3487
|
-
class
|
|
3518
|
+
class yr extends or {
|
|
3488
3519
|
constructor() {
|
|
3489
3520
|
super(300);
|
|
3490
3521
|
}
|
|
@@ -3495,14 +3526,14 @@ class pr extends cr {
|
|
|
3495
3526
|
return e;
|
|
3496
3527
|
}
|
|
3497
3528
|
fetchFromDb(e) {
|
|
3498
|
-
return
|
|
3529
|
+
return lr(e);
|
|
3499
3530
|
}
|
|
3500
3531
|
updateInDb(e, t) {
|
|
3501
|
-
return
|
|
3532
|
+
return pr(e, t);
|
|
3502
3533
|
}
|
|
3503
3534
|
}
|
|
3504
|
-
const
|
|
3505
|
-
class
|
|
3535
|
+
const Qs = new yr();
|
|
3536
|
+
class fr extends f {
|
|
3506
3537
|
async increaseXpGiven(e, t) {
|
|
3507
3538
|
await this.update(e, {
|
|
3508
3539
|
$inc: {
|
|
@@ -3524,18 +3555,18 @@ class yr extends f {
|
|
|
3524
3555
|
t ? await this.update(e, { $set: { timeCrewAbove90PercentXp: 0 } }) : await this.update(e, { $inc: { timeCrewAbove90PercentXp: 1 } });
|
|
3525
3556
|
}
|
|
3526
3557
|
}
|
|
3527
|
-
const
|
|
3558
|
+
const mr = async (n) => await se.create({
|
|
3528
3559
|
user: n
|
|
3529
3560
|
});
|
|
3530
|
-
async function
|
|
3561
|
+
async function hr(n) {
|
|
3531
3562
|
const e = await se.findOne({ user: n }).lean();
|
|
3532
|
-
return e || y(await
|
|
3563
|
+
return e || y(await mr(n));
|
|
3533
3564
|
}
|
|
3534
|
-
const
|
|
3565
|
+
const wr = (n, e) => se.findOneAndUpdate({ user: n }, e, {
|
|
3535
3566
|
upsert: !0,
|
|
3536
3567
|
returnDocument: "after"
|
|
3537
3568
|
}).lean();
|
|
3538
|
-
class
|
|
3569
|
+
class gr extends fr {
|
|
3539
3570
|
constructor() {
|
|
3540
3571
|
super(300);
|
|
3541
3572
|
}
|
|
@@ -3546,14 +3577,14 @@ class wr extends yr {
|
|
|
3546
3577
|
return e;
|
|
3547
3578
|
}
|
|
3548
3579
|
fetchFromDb(e) {
|
|
3549
|
-
return
|
|
3580
|
+
return hr(e);
|
|
3550
3581
|
}
|
|
3551
3582
|
updateInDb(e, t) {
|
|
3552
|
-
return
|
|
3583
|
+
return wr(e, t);
|
|
3553
3584
|
}
|
|
3554
3585
|
}
|
|
3555
|
-
const
|
|
3556
|
-
class
|
|
3586
|
+
const Ws = new gr();
|
|
3587
|
+
class Sr extends f {
|
|
3557
3588
|
async workIncrement(e) {
|
|
3558
3589
|
await this.update(e, { $inc: { workCount: 1 } });
|
|
3559
3590
|
}
|
|
@@ -3565,18 +3596,18 @@ class gr extends f {
|
|
|
3565
3596
|
});
|
|
3566
3597
|
}
|
|
3567
3598
|
}
|
|
3568
|
-
const
|
|
3599
|
+
const br = (n) => ie.create({
|
|
3569
3600
|
user: n
|
|
3570
3601
|
});
|
|
3571
|
-
async function
|
|
3602
|
+
async function $r(n) {
|
|
3572
3603
|
const e = await ie.findOne({ user: n }).lean();
|
|
3573
|
-
return e || y(await
|
|
3604
|
+
return e || y(await br(n));
|
|
3574
3605
|
}
|
|
3575
|
-
const
|
|
3606
|
+
const Er = (n, e) => ie.findOneAndUpdate({ user: n }, e, {
|
|
3576
3607
|
upsert: !0,
|
|
3577
3608
|
returnDocument: "after"
|
|
3578
3609
|
}).lean();
|
|
3579
|
-
class
|
|
3610
|
+
class Ur extends Sr {
|
|
3580
3611
|
constructor() {
|
|
3581
3612
|
super(300);
|
|
3582
3613
|
}
|
|
@@ -3587,14 +3618,14 @@ class Er extends gr {
|
|
|
3587
3618
|
return e;
|
|
3588
3619
|
}
|
|
3589
3620
|
fetchFromDb(e) {
|
|
3590
|
-
return
|
|
3621
|
+
return $r(e);
|
|
3591
3622
|
}
|
|
3592
3623
|
updateInDb(e, t) {
|
|
3593
|
-
return
|
|
3624
|
+
return Er(e, t);
|
|
3594
3625
|
}
|
|
3595
3626
|
}
|
|
3596
|
-
const
|
|
3597
|
-
class
|
|
3627
|
+
const Ir = new Ur();
|
|
3628
|
+
class Tr extends f {
|
|
3598
3629
|
async randomMessageIncrement(e) {
|
|
3599
3630
|
await this.update(e, { $inc: { randomMessageClaimed: 1 } });
|
|
3600
3631
|
}
|
|
@@ -3612,18 +3643,18 @@ class Ir extends f {
|
|
|
3612
3643
|
await this.update(e, { $inc: { totalMinutesInVoice: t } });
|
|
3613
3644
|
}
|
|
3614
3645
|
}
|
|
3615
|
-
const
|
|
3646
|
+
const Dr = async (n) => await ue.create({
|
|
3616
3647
|
user: n
|
|
3617
3648
|
});
|
|
3618
|
-
async function
|
|
3649
|
+
async function Or(n) {
|
|
3619
3650
|
const e = await ue.findOne({ user: n }).lean();
|
|
3620
|
-
return e || y(await
|
|
3651
|
+
return e || y(await Dr(n));
|
|
3621
3652
|
}
|
|
3622
|
-
const
|
|
3653
|
+
const Cr = (n, e) => ue.findOneAndUpdate({ user: n }, e, {
|
|
3623
3654
|
upsert: !0,
|
|
3624
3655
|
returnDocument: "after"
|
|
3625
3656
|
}).lean();
|
|
3626
|
-
class
|
|
3657
|
+
class Rr extends Tr {
|
|
3627
3658
|
constructor() {
|
|
3628
3659
|
super(300);
|
|
3629
3660
|
}
|
|
@@ -3636,14 +3667,14 @@ class Cr extends Ir {
|
|
|
3636
3667
|
return e;
|
|
3637
3668
|
}
|
|
3638
3669
|
fetchFromDb(e) {
|
|
3639
|
-
return
|
|
3670
|
+
return Or(e);
|
|
3640
3671
|
}
|
|
3641
3672
|
updateInDb(e, t) {
|
|
3642
|
-
return
|
|
3673
|
+
return Cr(e, t);
|
|
3643
3674
|
}
|
|
3644
3675
|
}
|
|
3645
|
-
const
|
|
3646
|
-
class
|
|
3676
|
+
const Gs = new Rr();
|
|
3677
|
+
class Mr extends f {
|
|
3647
3678
|
async hasReportedSomeone(e) {
|
|
3648
3679
|
await this.update(e, { $set: { reportedSomeone: !0 } });
|
|
3649
3680
|
}
|
|
@@ -3677,15 +3708,15 @@ class Rr extends f {
|
|
|
3677
3708
|
const vr = async (n) => await ce.create({
|
|
3678
3709
|
user: n
|
|
3679
3710
|
});
|
|
3680
|
-
async function
|
|
3711
|
+
async function Ar(n) {
|
|
3681
3712
|
const e = await ce.findOne({ user: n }).lean();
|
|
3682
3713
|
return e || y(await vr(n));
|
|
3683
3714
|
}
|
|
3684
|
-
const
|
|
3715
|
+
const Br = (n, e) => ce.findOneAndUpdate({ user: n }, e, {
|
|
3685
3716
|
upsert: !0,
|
|
3686
3717
|
returnDocument: "after"
|
|
3687
3718
|
}).lean();
|
|
3688
|
-
class
|
|
3719
|
+
class _r extends Mr {
|
|
3689
3720
|
constructor() {
|
|
3690
3721
|
super(300);
|
|
3691
3722
|
}
|
|
@@ -3696,17 +3727,17 @@ class Br extends Rr {
|
|
|
3696
3727
|
return e;
|
|
3697
3728
|
}
|
|
3698
3729
|
fetchFromDb(e) {
|
|
3699
|
-
return
|
|
3730
|
+
return Ar(e);
|
|
3700
3731
|
}
|
|
3701
3732
|
updateInDb(e, t) {
|
|
3702
|
-
return
|
|
3733
|
+
return Br(e, t);
|
|
3703
3734
|
}
|
|
3704
3735
|
}
|
|
3705
|
-
const
|
|
3706
|
-
class
|
|
3736
|
+
const Ys = new _r();
|
|
3737
|
+
class xr extends f {
|
|
3707
3738
|
async readEdito(e) {
|
|
3708
3739
|
const t = /* @__PURE__ */ new Date();
|
|
3709
|
-
t.setHours(0, 0, 0, 0), await
|
|
3740
|
+
t.setHours(0, 0, 0, 0), await v.updateOne(
|
|
3710
3741
|
{
|
|
3711
3742
|
user: e,
|
|
3712
3743
|
"edito.lastTimeRead": {
|
|
@@ -3717,7 +3748,7 @@ class _r extends f {
|
|
|
3717
3748
|
$inc: { "edito.readToday": 1 },
|
|
3718
3749
|
$set: { "edito.lastTimeRead": /* @__PURE__ */ new Date() }
|
|
3719
3750
|
}
|
|
3720
|
-
), await
|
|
3751
|
+
), await v.updateOne(
|
|
3721
3752
|
{
|
|
3722
3753
|
user: e,
|
|
3723
3754
|
"edito.lastTimeRead": {
|
|
@@ -3730,18 +3761,18 @@ class _r extends f {
|
|
|
3730
3761
|
), this.invalidate(e);
|
|
3731
3762
|
}
|
|
3732
3763
|
}
|
|
3733
|
-
const
|
|
3764
|
+
const qr = async (n) => await v.create({
|
|
3734
3765
|
user: n
|
|
3735
3766
|
});
|
|
3736
|
-
async function
|
|
3737
|
-
const e = await
|
|
3738
|
-
return e || y(await
|
|
3767
|
+
async function kr(n) {
|
|
3768
|
+
const e = await v.findOne({ user: n }).lean();
|
|
3769
|
+
return e || y(await qr(n));
|
|
3739
3770
|
}
|
|
3740
|
-
const
|
|
3771
|
+
const Nr = (n, e) => v.findOneAndUpdate({ user: n }, e, {
|
|
3741
3772
|
upsert: !0,
|
|
3742
3773
|
returnDocument: "after"
|
|
3743
3774
|
}).lean();
|
|
3744
|
-
class
|
|
3775
|
+
class Fr extends xr {
|
|
3745
3776
|
constructor() {
|
|
3746
3777
|
super(300);
|
|
3747
3778
|
}
|
|
@@ -3752,14 +3783,14 @@ class Nr extends _r {
|
|
|
3752
3783
|
return e;
|
|
3753
3784
|
}
|
|
3754
3785
|
fetchFromDb(e) {
|
|
3755
|
-
return
|
|
3786
|
+
return kr(e);
|
|
3756
3787
|
}
|
|
3757
3788
|
updateInDb(e, t) {
|
|
3758
|
-
return
|
|
3789
|
+
return Nr(e, t);
|
|
3759
3790
|
}
|
|
3760
3791
|
}
|
|
3761
|
-
const
|
|
3762
|
-
class
|
|
3792
|
+
const Xs = new Fr();
|
|
3793
|
+
class jr extends f {
|
|
3763
3794
|
async updateCraftStats(e, t, a) {
|
|
3764
3795
|
const r = await d.get(a);
|
|
3765
3796
|
!r || !d.isItem(r) || await this.update(e, {
|
|
@@ -3819,18 +3850,18 @@ class Fr extends f {
|
|
|
3819
3850
|
});
|
|
3820
3851
|
}
|
|
3821
3852
|
}
|
|
3822
|
-
const
|
|
3853
|
+
const zr = async (n) => await A.create({
|
|
3823
3854
|
user: n
|
|
3824
3855
|
});
|
|
3825
|
-
async function
|
|
3856
|
+
async function Pr(n) {
|
|
3826
3857
|
const e = await A.findOne({ user: n }).lean();
|
|
3827
|
-
return e || y(await
|
|
3858
|
+
return e || y(await zr(n));
|
|
3828
3859
|
}
|
|
3829
|
-
const
|
|
3860
|
+
const Kr = (n, e) => A.findOneAndUpdate({ user: n }, e, {
|
|
3830
3861
|
upsert: !0,
|
|
3831
3862
|
returnDocument: "after"
|
|
3832
3863
|
}).lean();
|
|
3833
|
-
class
|
|
3864
|
+
class Hr extends jr {
|
|
3834
3865
|
constructor() {
|
|
3835
3866
|
super(300);
|
|
3836
3867
|
}
|
|
@@ -3841,39 +3872,41 @@ class Kr extends Fr {
|
|
|
3841
3872
|
return e;
|
|
3842
3873
|
}
|
|
3843
3874
|
fetchFromDb(e) {
|
|
3844
|
-
return
|
|
3875
|
+
return Pr(e);
|
|
3845
3876
|
}
|
|
3846
3877
|
updateInDb(e, t) {
|
|
3847
|
-
return
|
|
3878
|
+
return Kr(e, t);
|
|
3848
3879
|
}
|
|
3849
3880
|
}
|
|
3850
|
-
const
|
|
3881
|
+
const Vs = new Hr(), Lr = new u({
|
|
3851
3882
|
bannedUserId: { type: String, index: !0, required: !0 },
|
|
3852
3883
|
authorId: { type: String, required: !0 },
|
|
3853
3884
|
unbannedTimestamp: { type: Date, index: 1 },
|
|
3854
3885
|
reason: { type: String, required: !0 },
|
|
3855
3886
|
guildId: { type: String, required: !0 }
|
|
3856
|
-
}), de = l?.Bans || p("Bans",
|
|
3857
|
-
|
|
3858
|
-
});
|
|
3859
|
-
class Qr extends b {
|
|
3887
|
+
}), de = l?.Bans || p("Bans", Lr), Qr = (n, e) => de.deleteOne({ bannedUserId: n, guildId: e });
|
|
3888
|
+
class Wr extends b {
|
|
3860
3889
|
async getUnbanUsers() {
|
|
3861
3890
|
return this.getMany({
|
|
3862
3891
|
unbannedTimestamp: { $lte: /* @__PURE__ */ new Date(), $ne: null }
|
|
3863
3892
|
});
|
|
3864
3893
|
}
|
|
3865
|
-
async banUserFromGuild(e) {
|
|
3866
|
-
await
|
|
3894
|
+
async banUserFromGuild({ bannedUserId: e, guildId: t, ...a }) {
|
|
3895
|
+
await this.update({ bannedUserId: e, guildId: t }, { ...a });
|
|
3867
3896
|
}
|
|
3868
3897
|
async isBannedFromGuild(e, t) {
|
|
3869
3898
|
const a = await this.get({ bannedUserId: e, guildId: t });
|
|
3870
3899
|
return !!(a && (!a.unbannedTimestamp || a.unbannedTimestamp > /* @__PURE__ */ new Date()));
|
|
3871
3900
|
}
|
|
3901
|
+
async deleteBan(e, t) {
|
|
3902
|
+
await Qr(e, t), this.invalidate({ bannedUserId: e, guildId: t });
|
|
3903
|
+
}
|
|
3872
3904
|
}
|
|
3873
|
-
const
|
|
3874
|
-
returnDocument: "after"
|
|
3905
|
+
const Gr = (n) => de.find(n).lean(), Yr = (n) => de.findOne(n).lean(), Xr = (n, e) => de.findOneAndUpdate(n, e, {
|
|
3906
|
+
returnDocument: "after",
|
|
3907
|
+
upsert: !0
|
|
3875
3908
|
}).lean();
|
|
3876
|
-
class
|
|
3909
|
+
class Vr extends Wr {
|
|
3877
3910
|
constructor() {
|
|
3878
3911
|
super(3600 * 36);
|
|
3879
3912
|
}
|
|
@@ -3884,16 +3917,16 @@ class Xr extends Qr {
|
|
|
3884
3917
|
return { bannedUserId: e, guildId: t };
|
|
3885
3918
|
}
|
|
3886
3919
|
fetchFromDb(e) {
|
|
3887
|
-
return
|
|
3920
|
+
return Yr(e);
|
|
3888
3921
|
}
|
|
3889
3922
|
fetchManyFromDb(e) {
|
|
3890
|
-
return
|
|
3923
|
+
return Gr(e);
|
|
3891
3924
|
}
|
|
3892
3925
|
updateInDb(e, t) {
|
|
3893
|
-
return
|
|
3926
|
+
return Xr(e, t);
|
|
3894
3927
|
}
|
|
3895
3928
|
}
|
|
3896
|
-
const
|
|
3929
|
+
const Js = new Vr(), Jr = new u({
|
|
3897
3930
|
senderId: {
|
|
3898
3931
|
type: u.Types.ObjectId,
|
|
3899
3932
|
required: !0,
|
|
@@ -3910,35 +3943,35 @@ const Vs = new Xr(), Vr = new u({
|
|
|
3910
3943
|
meta: {
|
|
3911
3944
|
rps: { type: String, default: void 0 }
|
|
3912
3945
|
}
|
|
3913
|
-
}), le = l?.Invitation || p("Invitation",
|
|
3946
|
+
}), le = l?.Invitation || p("Invitation", Jr), Zr = (n) => le.create({
|
|
3914
3947
|
...n
|
|
3915
|
-
}),
|
|
3948
|
+
}), es = async (n) => {
|
|
3916
3949
|
await le.deleteMany({
|
|
3917
3950
|
...n
|
|
3918
3951
|
});
|
|
3919
3952
|
};
|
|
3920
|
-
class
|
|
3953
|
+
class ts extends f {
|
|
3921
3954
|
async sendInvitation({
|
|
3922
3955
|
senderId: e,
|
|
3923
3956
|
receiverId: t,
|
|
3924
3957
|
gameMode: a,
|
|
3925
3958
|
...r
|
|
3926
3959
|
}) {
|
|
3927
|
-
return await this.get({ senderId: e, gameMode: a, receiverId: t }) ? !1 : (await
|
|
3960
|
+
return await this.get({ senderId: e, gameMode: a, receiverId: t }) ? !1 : (await Zr({ ...r, senderId: e, gameMode: a, receiverId: t }), !0);
|
|
3928
3961
|
}
|
|
3929
3962
|
async receiveInvitation(e) {
|
|
3930
3963
|
return this.get(e);
|
|
3931
3964
|
}
|
|
3932
3965
|
async deleteInvitation(e) {
|
|
3933
|
-
await
|
|
3966
|
+
await es(e), this.invalidate(e);
|
|
3934
3967
|
}
|
|
3935
3968
|
}
|
|
3936
|
-
const
|
|
3969
|
+
const ns = (n) => le.findOne({
|
|
3937
3970
|
...n
|
|
3938
|
-
}).lean(),
|
|
3971
|
+
}).lean(), as = (n, e) => le.findOneAndUpdate(n, e, {
|
|
3939
3972
|
returnDocument: "after"
|
|
3940
3973
|
}).lean();
|
|
3941
|
-
class
|
|
3974
|
+
class rs extends ts {
|
|
3942
3975
|
constructor() {
|
|
3943
3976
|
super(3600);
|
|
3944
3977
|
}
|
|
@@ -3953,14 +3986,14 @@ class as extends es {
|
|
|
3953
3986
|
return { gameMode: t, receiverId: e, senderId: a };
|
|
3954
3987
|
}
|
|
3955
3988
|
fetchFromDb(e) {
|
|
3956
|
-
return
|
|
3989
|
+
return ns(e);
|
|
3957
3990
|
}
|
|
3958
3991
|
updateInDb(e, t) {
|
|
3959
|
-
return
|
|
3992
|
+
return as(e, t);
|
|
3960
3993
|
}
|
|
3961
3994
|
}
|
|
3962
|
-
const
|
|
3963
|
-
class
|
|
3995
|
+
const Zs = new rs();
|
|
3996
|
+
class ss extends f {
|
|
3964
3997
|
async setEditoChannel(e, t) {
|
|
3965
3998
|
await this.update({ guildId: e }, { $set: { "edito.channelId": t } });
|
|
3966
3999
|
}
|
|
@@ -4021,7 +4054,7 @@ class rs extends f {
|
|
|
4021
4054
|
);
|
|
4022
4055
|
}
|
|
4023
4056
|
}
|
|
4024
|
-
const
|
|
4057
|
+
const is = new u({
|
|
4025
4058
|
guildId: { type: String, required: !0, unique: !0 },
|
|
4026
4059
|
ranking: {
|
|
4027
4060
|
channelId: { type: String, default: null },
|
|
@@ -4063,16 +4096,16 @@ const ss = new u({
|
|
|
4063
4096
|
}
|
|
4064
4097
|
},
|
|
4065
4098
|
shopChannelId: { type: String, default: null }
|
|
4066
|
-
}), Ue = l?.Settings || p("Settings",
|
|
4099
|
+
}), Ue = l?.Settings || p("Settings", is), us = (n) => Ue.create({
|
|
4067
4100
|
guildId: n
|
|
4068
|
-
}),
|
|
4101
|
+
}), cs = async (n) => {
|
|
4069
4102
|
const e = await Ue.findOne({ guildId: n }).lean();
|
|
4070
|
-
return e || y(await
|
|
4071
|
-
},
|
|
4103
|
+
return e || y(await us(n));
|
|
4104
|
+
}, os = (n, e) => Ue.findOneAndUpdate(n, e, {
|
|
4072
4105
|
upsert: !0,
|
|
4073
4106
|
returnDocument: "after"
|
|
4074
4107
|
}).lean();
|
|
4075
|
-
class
|
|
4108
|
+
class ds extends ss {
|
|
4076
4109
|
constructor() {
|
|
4077
4110
|
super(3600 * 24 * 30);
|
|
4078
4111
|
}
|
|
@@ -4083,13 +4116,13 @@ class os extends rs {
|
|
|
4083
4116
|
return e;
|
|
4084
4117
|
}
|
|
4085
4118
|
fetchFromDb(e) {
|
|
4086
|
-
return
|
|
4119
|
+
return cs(e);
|
|
4087
4120
|
}
|
|
4088
4121
|
updateInDb(e, t) {
|
|
4089
|
-
return
|
|
4122
|
+
return os(e, t);
|
|
4090
4123
|
}
|
|
4091
4124
|
}
|
|
4092
|
-
const
|
|
4125
|
+
const ei = new ds(), ls = new u(
|
|
4093
4126
|
{
|
|
4094
4127
|
shopType: { type: String, required: !0, unique: !0 },
|
|
4095
4128
|
publishedAt: { type: Date, default: /* @__PURE__ */ new Date() },
|
|
@@ -4118,11 +4151,11 @@ const Zs = new os(), ds = new u(
|
|
|
4118
4151
|
}
|
|
4119
4152
|
},
|
|
4120
4153
|
{ minimize: !1 }
|
|
4121
|
-
), Ie = l?.Shop || p("Shop",
|
|
4154
|
+
), Ie = l?.Shop || p("Shop", ls), ps = (n) => Ie.create({
|
|
4122
4155
|
shopType: n
|
|
4123
|
-
}),
|
|
4156
|
+
}), ys = async (n) => {
|
|
4124
4157
|
const e = await Ie.findOne({ shopType: n }).lean();
|
|
4125
|
-
return e || y(await
|
|
4158
|
+
return e || y(await ps(n));
|
|
4126
4159
|
};
|
|
4127
4160
|
class E {
|
|
4128
4161
|
toDBShopItem() {
|
|
@@ -4138,7 +4171,7 @@ class E {
|
|
|
4138
4171
|
e,
|
|
4139
4172
|
-1 * this.price * t,
|
|
4140
4173
|
!1
|
|
4141
|
-
), await
|
|
4174
|
+
), await Ir.updateTotalSpentInShop(
|
|
4142
4175
|
e,
|
|
4143
4176
|
this.price * t
|
|
4144
4177
|
)) : await S.removeItem(
|
|
@@ -4175,7 +4208,7 @@ class E {
|
|
|
4175
4208
|
return !1;
|
|
4176
4209
|
}
|
|
4177
4210
|
}
|
|
4178
|
-
class
|
|
4211
|
+
class fs extends E {
|
|
4179
4212
|
price;
|
|
4180
4213
|
size;
|
|
4181
4214
|
currency;
|
|
@@ -4195,7 +4228,7 @@ class ys extends E {
|
|
|
4195
4228
|
return !0;
|
|
4196
4229
|
}
|
|
4197
4230
|
}
|
|
4198
|
-
class
|
|
4231
|
+
class ms extends E {
|
|
4199
4232
|
price;
|
|
4200
4233
|
size;
|
|
4201
4234
|
currency;
|
|
@@ -4215,7 +4248,7 @@ class fs extends E {
|
|
|
4215
4248
|
return !0;
|
|
4216
4249
|
}
|
|
4217
4250
|
}
|
|
4218
|
-
class
|
|
4251
|
+
class hs extends E {
|
|
4219
4252
|
price;
|
|
4220
4253
|
size;
|
|
4221
4254
|
currency;
|
|
@@ -4235,7 +4268,7 @@ class ms extends E {
|
|
|
4235
4268
|
return !0;
|
|
4236
4269
|
}
|
|
4237
4270
|
}
|
|
4238
|
-
class
|
|
4271
|
+
class ws extends E {
|
|
4239
4272
|
price;
|
|
4240
4273
|
size;
|
|
4241
4274
|
currency;
|
|
@@ -4255,7 +4288,7 @@ class hs extends E {
|
|
|
4255
4288
|
return !0;
|
|
4256
4289
|
}
|
|
4257
4290
|
}
|
|
4258
|
-
class
|
|
4291
|
+
class gs extends E {
|
|
4259
4292
|
price;
|
|
4260
4293
|
size;
|
|
4261
4294
|
currency;
|
|
@@ -4286,7 +4319,7 @@ class ws extends E {
|
|
|
4286
4319
|
return !0;
|
|
4287
4320
|
}
|
|
4288
4321
|
}
|
|
4289
|
-
class
|
|
4322
|
+
class Ss extends E {
|
|
4290
4323
|
price;
|
|
4291
4324
|
size;
|
|
4292
4325
|
currency;
|
|
@@ -4306,7 +4339,7 @@ class gs extends E {
|
|
|
4306
4339
|
return !0;
|
|
4307
4340
|
}
|
|
4308
4341
|
}
|
|
4309
|
-
class
|
|
4342
|
+
class bs extends E {
|
|
4310
4343
|
price;
|
|
4311
4344
|
size;
|
|
4312
4345
|
currency;
|
|
@@ -4326,7 +4359,7 @@ class Ss extends E {
|
|
|
4326
4359
|
return !0;
|
|
4327
4360
|
}
|
|
4328
4361
|
}
|
|
4329
|
-
class
|
|
4362
|
+
class $s extends E {
|
|
4330
4363
|
price;
|
|
4331
4364
|
size;
|
|
4332
4365
|
currency;
|
|
@@ -4346,7 +4379,7 @@ class bs extends E {
|
|
|
4346
4379
|
return !0;
|
|
4347
4380
|
}
|
|
4348
4381
|
}
|
|
4349
|
-
class
|
|
4382
|
+
class Es extends E {
|
|
4350
4383
|
price;
|
|
4351
4384
|
size;
|
|
4352
4385
|
currency;
|
|
@@ -4366,30 +4399,30 @@ class $s extends E {
|
|
|
4366
4399
|
return !0;
|
|
4367
4400
|
}
|
|
4368
4401
|
}
|
|
4369
|
-
class
|
|
4402
|
+
class Us extends f {
|
|
4370
4403
|
async getShopItem(e, t) {
|
|
4371
4404
|
const r = (await this.get(e)).items.find((w) => w.id === t);
|
|
4372
4405
|
if (!r)
|
|
4373
4406
|
return;
|
|
4374
4407
|
const { price: s, size: i, currency: o } = r, c = await d.get(r.id) ?? await g.get(r.id);
|
|
4375
4408
|
if (g.isOrnament(c) && g.isBackground(c))
|
|
4376
|
-
return new
|
|
4409
|
+
return new fs({ price: s, item: c, size: i, currency: o });
|
|
4377
4410
|
if (g.isOrnament(c) && g.isTitle(c))
|
|
4378
|
-
return new
|
|
4411
|
+
return new Es({ price: s, item: c, size: i, currency: o });
|
|
4379
4412
|
if (d.isEntity(c) && d.isChestItem(c))
|
|
4380
|
-
return new
|
|
4413
|
+
return new hs({ price: s, item: c, size: i, currency: o });
|
|
4381
4414
|
if (d.isEntity(c) && d.isBoostItem(c))
|
|
4382
|
-
return new
|
|
4415
|
+
return new ms({ price: s, item: c, size: i, currency: o });
|
|
4383
4416
|
if (d.isEntity(c) && d.isRepairItem(c))
|
|
4384
|
-
return new Ss({ price: s, item: c, size: i, currency: o });
|
|
4385
|
-
if (d.isEntity(c) && d.isStoreItem(c))
|
|
4386
4417
|
return new bs({ price: s, item: c, size: i, currency: o });
|
|
4418
|
+
if (d.isEntity(c) && d.isStoreItem(c))
|
|
4419
|
+
return new $s({ price: s, item: c, size: i, currency: o });
|
|
4387
4420
|
if (d.isEntity(c) && d.isObjectItem(c))
|
|
4388
|
-
return new hs({ price: s, item: c, size: i, currency: o });
|
|
4389
|
-
if (d.isEntity(c) && d.isEquipment(c))
|
|
4390
4421
|
return new ws({ price: s, item: c, size: i, currency: o });
|
|
4422
|
+
if (d.isEntity(c) && d.isEquipment(c))
|
|
4423
|
+
return new gs({ price: s, item: c, size: i, currency: o });
|
|
4391
4424
|
if (d.isEntity(c) && d.isBottleItem(c))
|
|
4392
|
-
return new
|
|
4425
|
+
return new Ss({ price: s, size: i, item: c, currency: o });
|
|
4393
4426
|
}
|
|
4394
4427
|
async getShopItemList(e) {
|
|
4395
4428
|
const t = await this.get(e), a = [];
|
|
@@ -4448,8 +4481,8 @@ class Es extends f {
|
|
|
4448
4481
|
);
|
|
4449
4482
|
}
|
|
4450
4483
|
}
|
|
4451
|
-
const
|
|
4452
|
-
class
|
|
4484
|
+
const Is = (n, e) => Ie.findOneAndUpdate(n, e, { upsert: !0, returnDocument: "after" }).lean();
|
|
4485
|
+
class Ts extends Us {
|
|
4453
4486
|
constructor() {
|
|
4454
4487
|
super(3600);
|
|
4455
4488
|
}
|
|
@@ -4460,28 +4493,28 @@ class Is extends Es {
|
|
|
4460
4493
|
return e;
|
|
4461
4494
|
}
|
|
4462
4495
|
fetchFromDb(e) {
|
|
4463
|
-
return
|
|
4496
|
+
return ys(e);
|
|
4464
4497
|
}
|
|
4465
4498
|
updateInDb(e, t) {
|
|
4466
|
-
return
|
|
4499
|
+
return Is(e, t);
|
|
4467
4500
|
}
|
|
4468
4501
|
}
|
|
4469
|
-
const
|
|
4502
|
+
const ti = new Ts(), Ds = new u({
|
|
4470
4503
|
warnedUserId: { type: String, required: !0, index: !0 },
|
|
4471
4504
|
authorId: String,
|
|
4472
4505
|
date: { type: Date, default: Date.now() },
|
|
4473
4506
|
reason: { type: String, default: null }
|
|
4474
|
-
}), tt = l?.Warn || p("Warn",
|
|
4475
|
-
class
|
|
4507
|
+
}), tt = l?.Warn || p("Warn", Ds), Os = (n) => tt.countDocuments(n);
|
|
4508
|
+
class Cs extends b {
|
|
4476
4509
|
getUserWarns(e) {
|
|
4477
4510
|
return this.getMany({ warnedUserId: e });
|
|
4478
4511
|
}
|
|
4479
4512
|
getUserWarnCount(e) {
|
|
4480
|
-
return
|
|
4513
|
+
return Os({ warnedUserId: e });
|
|
4481
4514
|
}
|
|
4482
4515
|
}
|
|
4483
|
-
const
|
|
4484
|
-
class
|
|
4516
|
+
const Rs = (n) => tt.find(n).lean();
|
|
4517
|
+
class Ms extends Cs {
|
|
4485
4518
|
constructor() {
|
|
4486
4519
|
super(300);
|
|
4487
4520
|
}
|
|
@@ -4495,62 +4528,62 @@ class Rs extends Os {
|
|
|
4495
4528
|
throw new Error("Method not implemented.");
|
|
4496
4529
|
}
|
|
4497
4530
|
fetchManyFromDb(e) {
|
|
4498
|
-
return
|
|
4531
|
+
return Rs(e);
|
|
4499
4532
|
}
|
|
4500
4533
|
updateInDb() {
|
|
4501
4534
|
throw new Error("Method not implemented.");
|
|
4502
4535
|
}
|
|
4503
4536
|
}
|
|
4504
|
-
const
|
|
4537
|
+
const ni = new Ms(), ai = (n) => {
|
|
4505
4538
|
ut(n);
|
|
4506
4539
|
};
|
|
4507
|
-
class
|
|
4540
|
+
class ri extends ct.ObjectId {
|
|
4508
4541
|
}
|
|
4509
4542
|
export {
|
|
4510
|
-
|
|
4511
|
-
|
|
4543
|
+
zs as COOLDOWN_COMMANDS,
|
|
4544
|
+
ri as ObjectId,
|
|
4512
4545
|
h as QUEST_MIDDLEWARE_EVENT_NAME,
|
|
4513
4546
|
he as RAID_MIDDLEWARE_EVENT_NAME,
|
|
4514
|
-
|
|
4515
|
-
|
|
4547
|
+
Js as banService,
|
|
4548
|
+
ai as connectToServices,
|
|
4516
4549
|
Ce as crewMetaService,
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4550
|
+
ks as crewOrnamentsService,
|
|
4551
|
+
Ns as crewQuestService,
|
|
4552
|
+
vt as crewService,
|
|
4553
|
+
Fs as crewStatsEngagementService,
|
|
4554
|
+
js as crewStatsFrequencyService,
|
|
4522
4555
|
m as emitQuestMiddlewareEvent,
|
|
4523
4556
|
me as emitRaidMiddlewareEvent,
|
|
4524
4557
|
d as entityService,
|
|
4525
|
-
|
|
4526
|
-
|
|
4558
|
+
ys as findShop,
|
|
4559
|
+
Zs as invitationService,
|
|
4527
4560
|
g as ornamentService,
|
|
4528
4561
|
U as panoplyService,
|
|
4529
|
-
|
|
4530
|
-
|
|
4562
|
+
xs as registerQuestMiddlewareEvents,
|
|
4563
|
+
qs as registerRaidMiddlewareEvents,
|
|
4531
4564
|
H as reminderService,
|
|
4532
|
-
|
|
4565
|
+
ei as settingsService,
|
|
4533
4566
|
Ie as shopModel,
|
|
4534
|
-
|
|
4567
|
+
ti as shopService,
|
|
4535
4568
|
va as userCooldownService,
|
|
4536
4569
|
aa as userCrewService,
|
|
4537
|
-
|
|
4570
|
+
Ps as userDailyReportService,
|
|
4538
4571
|
pe as userEncyclopediaService,
|
|
4539
|
-
|
|
4572
|
+
Ks as userGamesService,
|
|
4540
4573
|
S as userInventoryService,
|
|
4541
4574
|
I as userMetaService,
|
|
4542
4575
|
G as userOrnamentService,
|
|
4543
|
-
|
|
4544
|
-
|
|
4576
|
+
Me as userQuestService,
|
|
4577
|
+
Hs as userRaidService,
|
|
4545
4578
|
Sn as userService,
|
|
4546
4579
|
Re as userSettingsService,
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4580
|
+
Ls as userShopService,
|
|
4581
|
+
Qs as userStatsCasinoService,
|
|
4582
|
+
Ws as userStatsCrewService,
|
|
4583
|
+
Ir as userStatsEconomyService,
|
|
4584
|
+
Gs as userStatsEngagementService,
|
|
4585
|
+
Ys as userStatsFlagsService,
|
|
4586
|
+
Xs as userStatsFrequencyService,
|
|
4587
|
+
Vs as userStatsInventoryService,
|
|
4588
|
+
ni as warnService
|
|
4556
4589
|
};
|