@opfr/services 0.30.0 → 0.30.1

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.
Files changed (2) hide show
  1. package/dist/index.es.js +128 -128
  2. package/package.json +8 -8
package/dist/index.es.js CHANGED
@@ -331,10 +331,10 @@ function Ni() {
331
331
  return this._invalidDate;
332
332
  }
333
333
  var Pi = "%d", ji = /\d{1,2}/;
334
- function Li(t) {
334
+ function Qi(t) {
335
335
  return this._ordinal.replace("%d", t);
336
336
  }
337
- var Qi = {
337
+ var Li = {
338
338
  future: "in %s",
339
339
  past: "%s ago",
340
340
  s: "a few seconds",
@@ -979,7 +979,7 @@ C("Hmmss", function(t, a, s) {
979
979
  function jl(t) {
980
980
  return (t + "").toLowerCase().charAt(0) === "p";
981
981
  }
982
- var Ll = /[ap]\.?m?\.?/i, Ql = qe("Hours", !0);
982
+ var Ql = /[ap]\.?m?\.?/i, Ll = qe("Hours", !0);
983
983
  function Hl(t, a, s) {
984
984
  return t > 11 ? s ? "pm" : "PM" : s ? "am" : "AM";
985
985
  }
@@ -989,14 +989,14 @@ var bn = {
989
989
  invalidDate: Ii,
990
990
  ordinal: Pi,
991
991
  dayOfMonthOrdinalParse: ji,
992
- relativeTime: Qi,
992
+ relativeTime: Li,
993
993
  months: rl,
994
994
  monthsShort: un,
995
995
  week: _l,
996
996
  weekdays: xl,
997
997
  weekdaysMin: Ul,
998
998
  weekdaysShort: _n,
999
- meridiemParse: Ll
999
+ meridiemParse: Ql
1000
1000
  }, R = {}, Xe = {}, at;
1001
1001
  function Gl(t, a) {
1002
1002
  var s, n = Math.min(t.length, a.length);
@@ -1565,9 +1565,9 @@ function Bn(t) {
1565
1565
  return typeof t == "string" || t instanceof String;
1566
1566
  }
1567
1567
  function jo(t) {
1568
- return ee(t) || lt(t) || Bn(t) || me(t) || Qo(t) || Lo(t) || t === null || t === void 0;
1568
+ return ee(t) || lt(t) || Bn(t) || me(t) || Lo(t) || Qo(t) || t === null || t === void 0;
1569
1569
  }
1570
- function Lo(t) {
1570
+ function Qo(t) {
1571
1571
  var a = Re(t) && !ba(t), s = !1, n = [
1572
1572
  "years",
1573
1573
  "year",
@@ -1598,7 +1598,7 @@ function Lo(t) {
1598
1598
  i = n[r], s = s || x(t, i);
1599
1599
  return a && s;
1600
1600
  }
1601
- function Qo(t) {
1601
+ function Lo(t) {
1602
1602
  var a = K(t), s = !1;
1603
1603
  return a && (s = t.filter(function(n) {
1604
1604
  return !me(n) && Bn(t);
@@ -1748,8 +1748,8 @@ var $n = V(
1748
1748
  function Tn() {
1749
1749
  return this._locale;
1750
1750
  }
1751
- var Ut = 1e3, Le = 60 * Ut, St = 60 * Le, Fn = (365 * 400 + 97) * 24 * St;
1752
- function Qe(t, a) {
1751
+ var Ut = 1e3, Qe = 60 * Ut, St = 60 * Qe, Fn = (365 * 400 + 97) * 24 * St;
1752
+ function Le(t, a) {
1753
1753
  return (t % a + a) % a;
1754
1754
  }
1755
1755
  function En(t, a, s) {
@@ -1795,16 +1795,16 @@ function dd(t) {
1795
1795
  a = s(this.year(), this.month(), this.date());
1796
1796
  break;
1797
1797
  case "hour":
1798
- a = this._d.valueOf(), a -= Qe(
1799
- a + (this._isUTC ? 0 : this.utcOffset() * Le),
1798
+ a = this._d.valueOf(), a -= Le(
1799
+ a + (this._isUTC ? 0 : this.utcOffset() * Qe),
1800
1800
  St
1801
1801
  );
1802
1802
  break;
1803
1803
  case "minute":
1804
- a = this._d.valueOf(), a -= Qe(a, Le);
1804
+ a = this._d.valueOf(), a -= Le(a, Qe);
1805
1805
  break;
1806
1806
  case "second":
1807
- a = this._d.valueOf(), a -= Qe(a, Ut);
1807
+ a = this._d.valueOf(), a -= Le(a, Ut);
1808
1808
  break;
1809
1809
  }
1810
1810
  return this._d.setTime(a), p.updateOffset(this, !0), this;
@@ -1846,16 +1846,16 @@ function cd(t) {
1846
1846
  a = s(this.year(), this.month(), this.date() + 1) - 1;
1847
1847
  break;
1848
1848
  case "hour":
1849
- a = this._d.valueOf(), a += St - Qe(
1850
- a + (this._isUTC ? 0 : this.utcOffset() * Le),
1849
+ a = this._d.valueOf(), a += St - Le(
1850
+ a + (this._isUTC ? 0 : this.utcOffset() * Qe),
1851
1851
  St
1852
1852
  ) - 1;
1853
1853
  break;
1854
1854
  case "minute":
1855
- a = this._d.valueOf(), a += Le - Qe(a, Le) - 1;
1855
+ a = this._d.valueOf(), a += Qe - Le(a, Qe) - 1;
1856
1856
  break;
1857
1857
  case "second":
1858
- a = this._d.valueOf(), a += Ut - Qe(a, Ut) - 1;
1858
+ a = this._d.valueOf(), a += Ut - Le(a, Ut) - 1;
1859
1859
  break;
1860
1860
  }
1861
1861
  return this._d.setTime(a), p.updateOffset(this, !0), this;
@@ -2146,7 +2146,7 @@ h("DDDD", rn);
2146
2146
  C(["DDD", "DDDD"], function(t, a, s) {
2147
2147
  s._dayOfYear = v(t);
2148
2148
  });
2149
- function Ld(t) {
2149
+ function Qd(t) {
2150
2150
  var a = Math.round(
2151
2151
  (this.clone().startOf("day") - this.clone().startOf("year")) / 864e5
2152
2152
  ) + 1;
@@ -2156,7 +2156,7 @@ _("m", ["mm", 2], 0, "minute");
2156
2156
  h("m", B, Ca);
2157
2157
  h("mm", B, q);
2158
2158
  C(["m", "mm"], J);
2159
- var Qd = qe("Minutes", !1);
2159
+ var Ld = qe("Minutes", !1);
2160
2160
  _("s", ["ss", 2], 0, "second");
2161
2161
  h("s", B, Ca);
2162
2162
  h("ss", B, q);
@@ -2270,9 +2270,9 @@ u.date = In;
2270
2270
  u.day = u.days = Fl;
2271
2271
  u.weekday = El;
2272
2272
  u.isoWeekday = Al;
2273
- u.dayOfYear = Ld;
2274
- u.hour = u.hours = Ql;
2275
- u.minute = u.minutes = Qd;
2273
+ u.dayOfYear = Qd;
2274
+ u.hour = u.hours = Ll;
2275
+ u.minute = u.minutes = Ld;
2276
2276
  u.second = u.seconds = Hd;
2277
2277
  u.millisecond = u.milliseconds = Nn;
2278
2278
  u.utcOffset = So;
@@ -2320,7 +2320,7 @@ var U = ka.prototype;
2320
2320
  U.calendar = Ti;
2321
2321
  U.longDateFormat = Yi;
2322
2322
  U.invalidDate = Ni;
2323
- U.ordinal = Li;
2323
+ U.ordinal = Qi;
2324
2324
  U.preparse = Pn;
2325
2325
  U.postformat = Pn;
2326
2326
  U.relativeTime = Hi;
@@ -2423,24 +2423,24 @@ function tc() {
2423
2423
  var t = this._data;
2424
2424
  return this._milliseconds = oe(this._milliseconds), this._days = oe(this._days), this._months = oe(this._months), t.milliseconds = oe(t.milliseconds), t.seconds = oe(t.seconds), t.minutes = oe(t.minutes), t.hours = oe(t.hours), t.months = oe(t.months), t.years = oe(t.years), this;
2425
2425
  }
2426
- function Ln(t, a, s, n) {
2426
+ function Qn(t, a, s, n) {
2427
2427
  var r = te(a, s);
2428
2428
  return t._milliseconds += n * r._milliseconds, t._days += n * r._days, t._months += n * r._months, t._bubble();
2429
2429
  }
2430
2430
  function ac(t, a) {
2431
- return Ln(this, t, a, 1);
2431
+ return Qn(this, t, a, 1);
2432
2432
  }
2433
2433
  function sc(t, a) {
2434
- return Ln(this, t, a, -1);
2434
+ return Qn(this, t, a, -1);
2435
2435
  }
2436
2436
  function ws(t) {
2437
2437
  return t < 0 ? Math.floor(t) : Math.ceil(t);
2438
2438
  }
2439
2439
  function nc() {
2440
2440
  var t = this._milliseconds, a = this._days, s = this._months, n = this._data, r, i, d, c, m;
2441
- return t >= 0 && a >= 0 && s >= 0 || t <= 0 && a <= 0 && s <= 0 || (t += ws(ca(s) + a) * 864e5, a = 0, s = 0), n.milliseconds = t % 1e3, r = W(t / 1e3), n.seconds = r % 60, i = W(r / 60), n.minutes = i % 60, d = W(i / 60), n.hours = d % 24, a += W(d / 24), m = W(Qn(a)), s += m, a -= ws(ca(m)), c = W(s / 12), s %= 12, n.days = a, n.months = s, n.years = c, this;
2441
+ return t >= 0 && a >= 0 && s >= 0 || t <= 0 && a <= 0 && s <= 0 || (t += ws(ca(s) + a) * 864e5, a = 0, s = 0), n.milliseconds = t % 1e3, r = W(t / 1e3), n.seconds = r % 60, i = W(r / 60), n.minutes = i % 60, d = W(i / 60), n.hours = d % 24, a += W(d / 24), m = W(Ln(a)), s += m, a -= ws(ca(m)), c = W(s / 12), s %= 12, n.days = a, n.months = s, n.years = c, this;
2442
2442
  }
2443
- function Qn(t) {
2443
+ function Ln(t) {
2444
2444
  return t * 4800 / 146097;
2445
2445
  }
2446
2446
  function ca(t) {
@@ -2451,7 +2451,7 @@ function rc(t) {
2451
2451
  return NaN;
2452
2452
  var a, s, n = this._milliseconds;
2453
2453
  if (t = z(t), t === "month" || t === "quarter" || t === "year")
2454
- switch (a = this._days + n / 864e5, s = this._months + Qn(a), t) {
2454
+ switch (a = this._days + n / 864e5, s = this._months + Ln(a), t) {
2455
2455
  case "month":
2456
2456
  return s;
2457
2457
  case "quarter":
@@ -2726,7 +2726,7 @@ const Bc = /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octob
2726
2726
  }
2727
2727
  };
2728
2728
  p.locale("fr", $c);
2729
- const he = (t, a, s = !0) => (s ? t.getFullYear() === a.getFullYear() : !0) && t.getMonth() === a.getMonth() && t.getDate() === a.getDate(), La = () => p().locale("fr").subtract(1, "days").toDate(), Fe = (t) => /* @__PURE__ */ new Date() > t, vs = (t) => typeof t == "function", ua = (t, a, s) => {
2729
+ const he = (t, a, s = !0) => (s ? t.getFullYear() === a.getFullYear() : !0) && t.getMonth() === a.getMonth() && t.getDate() === a.getDate(), Qa = () => p().locale("fr").subtract(1, "days").toDate(), Fe = (t) => /* @__PURE__ */ new Date() > t, vs = (t) => typeof t == "function", ua = (t, a, s) => {
2730
2730
  const n = { ...t }, r = Object.entries(t);
2731
2731
  for (const [i, d] of r) {
2732
2732
  const c = a[i];
@@ -2770,71 +2770,71 @@ const he = (t, a, s = !0) => (s ? t.getFullYear() === a.getFullYear() : !0) && t
2770
2770
  });
2771
2771
  qn.index({ "meta.xp": -1 });
2772
2772
  var Ds;
2773
- const Qa = ((Ds = T) == null ? void 0 : Ds.Settings) || F("Settings", qn), L = async (t, a, s = !1) => {
2774
- await Qa.updateOne({ guildId: t }, a, { upsert: s });
2773
+ const La = ((Ds = T) == null ? void 0 : Ds.Settings) || F("Settings", qn), Q = async (t, a, s = !1) => {
2774
+ await La.updateOne({ guildId: t }, a, { upsert: s });
2775
2775
  }, Tc = async (t, a) => {
2776
- await L(t, {
2776
+ await Q(t, {
2777
2777
  $set: { suggestionChannelId: a }
2778
2778
  });
2779
2779
  }, Fc = async (t, a) => {
2780
- await L(t, {
2780
+ await Q(t, {
2781
2781
  $set: { reportChannelId: a }
2782
2782
  });
2783
2783
  }, Ec = async (t, a) => {
2784
- await L(t, {
2784
+ await Q(t, {
2785
2785
  $set: { reportModeratorChannelId: a }
2786
2786
  });
2787
2787
  }, Ac = async (t, a) => {
2788
- await L(t, {
2788
+ await Q(t, {
2789
2789
  $set: { factionChannelId: a }
2790
2790
  });
2791
2791
  }, Yc = async (t, a) => {
2792
- await L(t, {
2792
+ await Q(t, {
2793
2793
  $set: { "edito.channelId": a }
2794
2794
  });
2795
2795
  }, Ic = async (t) => {
2796
2796
  const a = Zs(100, 1001);
2797
- return await L(t, {
2797
+ return await Q(t, {
2798
2798
  $set: { "edito.price": a }
2799
2799
  }), a;
2800
2800
  }, Nc = async (t, a) => {
2801
- await L(t, {
2801
+ await Q(t, {
2802
2802
  $set: { "edito.sentAtMidnight ": a }
2803
2803
  });
2804
2804
  }, Pc = async (t, a) => {
2805
- await L(t, {
2805
+ await Q(t, {
2806
2806
  $set: { "edito.messageId ": a }
2807
2807
  });
2808
2808
  }, jc = async (t, a) => {
2809
- await L(t, {
2809
+ await Q(t, {
2810
2810
  $set: { discussionChannelId: a }
2811
2811
  });
2812
- }, Lc = async (t, a) => {
2813
- await L(t, {
2812
+ }, Qc = async (t, a) => {
2813
+ await Q(t, {
2814
2814
  $set: { questFallbackChannelId: a }
2815
2815
  });
2816
- }, Qc = async (t, a) => {
2817
- await L(t, {
2816
+ }, Lc = async (t, a) => {
2817
+ await Q(t, {
2818
2818
  $set: { "ranking.channelId": a }
2819
2819
  });
2820
2820
  }, Hc = async (t, a) => {
2821
- await L(t, {
2821
+ await Q(t, {
2822
2822
  $set: { "ranking.messageId": a }
2823
2823
  });
2824
2824
  }, Gc = async (t, a, s) => {
2825
- await L(t, {
2825
+ await Q(t, {
2826
2826
  $set: { shopChannelId: a, blackMarketChannelId: s }
2827
2827
  });
2828
2828
  }, qc = async (t, a) => {
2829
- await L(t, {
2829
+ await Q(t, {
2830
2830
  $set: { reportBugChannelId: a }
2831
2831
  });
2832
2832
  }, Wc = async (t, a) => {
2833
- await L(t, {
2833
+ await Q(t, {
2834
2834
  $set: { "crew.infoChannelId": a }
2835
2835
  });
2836
2836
  }, Vc = async (t, a, s) => {
2837
- await L(t, {
2837
+ await Q(t, {
2838
2838
  $push: { "crew.crewChannelIds": { channelId: s, crewId: a } }
2839
2839
  });
2840
2840
  }, D_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
@@ -2847,18 +2847,18 @@ const Qa = ((Ds = T) == null ? void 0 : Ds.Settings) || F("Settings", qn), L = a
2847
2847
  setEditoChannel: Yc,
2848
2848
  setEditoMessageId: Pc,
2849
2849
  setFactionChannel: Ac,
2850
- setQuestChannelId: Lc,
2851
- setRankingChannel: Qc,
2850
+ setQuestChannelId: Qc,
2851
+ setRankingChannel: Lc,
2852
2852
  setRankingMessage: Hc,
2853
2853
  setReportBugChannelId: qc,
2854
2854
  setReportChannel: Fc,
2855
2855
  setReportModeratorChannel: Ec,
2856
2856
  setShopChannelId: Gc,
2857
2857
  setSuggestionChannel: Tc
2858
- }, Symbol.toStringTag, { value: "Module" })), zc = async (t) => await Qa.create({
2858
+ }, Symbol.toStringTag, { value: "Module" })), zc = async (t) => await La.create({
2859
2859
  guildId: t
2860
2860
  }), C_ = async (t, a = {}) => {
2861
- const s = await Qa.findOne({ guildId: t }, a);
2861
+ const s = await La.findOne({ guildId: t }, a);
2862
2862
  return s || zc(t);
2863
2863
  };
2864
2864
  class be {
@@ -3205,12 +3205,12 @@ const We = ((Os = T) == null ? void 0 : Os.Reminder) || F("Reminder", qa), pu =
3205
3205
  });
3206
3206
  Zn.index({ user: 1 });
3207
3207
  var Bs;
3208
- const Lt = ((Bs = T) == null ? void 0 : Bs.UserCooldown) || F("UserCooldown", Zn), Qt = async (t, a) => {
3209
- await Lt.updateOne({ user: t }, a, {
3208
+ const Qt = ((Bs = T) == null ? void 0 : Bs.UserCooldown) || F("UserCooldown", Zn), Lt = async (t, a) => {
3209
+ await Qt.updateOne({ user: t }, a, {
3210
3210
  upsert: !0
3211
3211
  });
3212
3212
  }, _u = async (t, a) => {
3213
- await Qt(t, [
3213
+ await Lt(t, [
3214
3214
  {
3215
3215
  $set: {
3216
3216
  "raid.special": {
@@ -3237,7 +3237,7 @@ const Lt = ((Bs = T) == null ? void 0 : Bs.UserCooldown) || F("UserCooldown", Zn
3237
3237
  -1 * a * 3600 * 1e3
3238
3238
  );
3239
3239
  }, Jn = async (t, a, s) => {
3240
- await Qt(t, {
3240
+ await Lt(t, {
3241
3241
  $set: {
3242
3242
  ...a ? {
3243
3243
  "raid.special": new Date(Date.now() + 7 * 24 * 60 * 60 * 1e3)
@@ -3251,13 +3251,13 @@ const Lt = ((Bs = T) == null ? void 0 : Bs.UserCooldown) || F("UserCooldown", Zn
3251
3251
  new Date(Date.now() + 7 * 24 * 60 * 60 * 1e3)
3252
3252
  );
3253
3253
  }, Kn = async (t) => {
3254
- await Qt(t, {
3254
+ await Lt(t, {
3255
3255
  $set: {
3256
3256
  lockUserCommand: /* @__PURE__ */ new Date()
3257
3257
  }
3258
3258
  });
3259
3259
  }, gu = async (t, a, s, n) => {
3260
- await Qt(t, {
3260
+ await Lt(t, {
3261
3261
  $set: {
3262
3262
  [`commands.${a}`]: new Date(Date.now() + s)
3263
3263
  }
@@ -3279,10 +3279,10 @@ const Lt = ((Bs = T) == null ? void 0 : Bs.UserCooldown) || F("UserCooldown", Zn
3279
3279
  "guess",
3280
3280
  "qod",
3281
3281
  "dice"
3282
- ], er = async (t) => await Lt.create({
3282
+ ], er = async (t) => await Qt.create({
3283
3283
  user: t
3284
3284
  }), N_ = async (t, a = {}) => {
3285
- const s = await Lt.findOne({ user: t }, a);
3285
+ const s = await Qt.findOne({ user: t }, a);
3286
3286
  return s || await er(t);
3287
3287
  }, Va = new b(
3288
3288
  {
@@ -3337,7 +3337,7 @@ const ut = ((Rs = T) == null ? void 0 : Rs.UserCrew) || F("UserCrew", Va), tr =
3337
3337
  crew: a,
3338
3338
  percent: n,
3339
3339
  permission: s
3340
- }), L_ = (t) => ut.exists({ user: t }), sr = new b({
3340
+ }), Q_ = (t) => ut.exists({ user: t }), sr = new b({
3341
3341
  user: {
3342
3342
  type: b.Types.ObjectId,
3343
3343
  required: !0,
@@ -3372,7 +3372,7 @@ const za = (($s = T) == null ? void 0 : $s.UserDailyReport) || F("UserDailyRepor
3372
3372
  previousMessageSent: a.questMeta.messageSent
3373
3373
  }
3374
3374
  });
3375
- }, Q_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3375
+ }, L_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3376
3376
  __proto__: null,
3377
3377
  updateDailyReport: Mu
3378
3378
  }, Symbol.toStringTag, { value: "Module" })), nr = new b({
@@ -3638,7 +3638,7 @@ class o {
3638
3638
  );
3639
3639
  }
3640
3640
  }
3641
- class Lu extends o {
3641
+ class Qu extends o {
3642
3642
  constructor() {
3643
3643
  super(...arguments);
3644
3644
  e(this, "name", "Bienvenue à bord !");
@@ -3656,7 +3656,7 @@ class Lu extends o {
3656
3656
  e(this, "crew", !1);
3657
3657
  }
3658
3658
  }
3659
- class Qu extends o {
3659
+ class Lu extends o {
3660
3660
  constructor() {
3661
3661
  super(...arguments);
3662
3662
  e(this, "name", "Prêt à naviguer !");
@@ -3676,8 +3676,8 @@ class Qu extends o {
3676
3676
  }
3677
3677
  const Hu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3678
3678
  __proto__: null,
3679
- CrewCreateOrJoin: Lu,
3680
- CrewValidateDaily: Qu
3679
+ CrewCreateOrJoin: Qu,
3680
+ CrewValidateDaily: Lu
3681
3681
  }, Symbol.toStringTag, { value: "Module" }));
3682
3682
  class Gu extends o {
3683
3683
  constructor() {
@@ -4686,7 +4686,7 @@ class jf extends o {
4686
4686
  e(this, "onUserMetaUpdate", (s) => S(s.characteristics.strength) >= 100);
4687
4687
  }
4688
4688
  }
4689
- class Lf extends o {
4689
+ class Qf extends o {
4690
4690
  constructor() {
4691
4691
  super(...arguments);
4692
4692
  e(this, "name", "Hercules");
@@ -4705,7 +4705,7 @@ class Lf extends o {
4705
4705
  e(this, "onUserMetaUpdate", (s) => S(s.characteristics.strength) >= 250);
4706
4706
  }
4707
4707
  }
4708
- class Qf extends o {
4708
+ class Lf extends o {
4709
4709
  constructor() {
4710
4710
  super(...arguments);
4711
4711
  e(this, "name", "Titan");
@@ -5430,7 +5430,7 @@ const pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5430
5430
  Have250Agility: Wf,
5431
5431
  Have250Chance: sp,
5432
5432
  Have250Intelligence: Jf,
5433
- Have250Strength: Lf,
5433
+ Have250Strength: Qf,
5434
5434
  Have250Vitality: op,
5435
5435
  Have250Wisdom: pp,
5436
5436
  Have25Agility: Hf,
@@ -5442,7 +5442,7 @@ const pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5442
5442
  Have500Agility: Vf,
5443
5443
  Have500Chance: np,
5444
5444
  Have500Intelligence: Kf,
5445
- Have500Strength: Qf,
5445
+ Have500Strength: Lf,
5446
5446
  Have500Vitality: dp,
5447
5447
  Have500Wisdom: mp,
5448
5448
  Have500kBerry: Ff,
@@ -5770,7 +5770,7 @@ class jp extends o {
5770
5770
  e(this, "onUserQuestMetaUpdate", (s) => s.items.bottle.today >= 100);
5771
5771
  }
5772
5772
  }
5773
- class Lp extends o {
5773
+ class Qp extends o {
5774
5774
  constructor() {
5775
5775
  super(...arguments);
5776
5776
  e(this, "name", "Un ptit goût amer non ?");
@@ -5789,7 +5789,7 @@ class Lp extends o {
5789
5789
  e(this, "onUserQuestMetaUpdate", (s) => s.items.bottle.total >= 200);
5790
5790
  }
5791
5791
  }
5792
- class Qp extends o {
5792
+ class Lp extends o {
5793
5793
  constructor() {
5794
5794
  super(...arguments);
5795
5795
  e(this, "name", "Ça se boit bien finalement");
@@ -6809,7 +6809,7 @@ class j0 extends o {
6809
6809
  e(this, "onUserQuestMetaUpdate", (s) => s.randomMessage >= 100);
6810
6810
  }
6811
6811
  }
6812
- class L0 extends o {
6812
+ class Q0 extends o {
6813
6813
  constructor() {
6814
6814
  super(...arguments);
6815
6815
  e(this, "name", "Et Furieux");
@@ -6828,7 +6828,7 @@ class L0 extends o {
6828
6828
  e(this, "onUserQuestMetaUpdate", (s) => s.randomMessage >= 200);
6829
6829
  }
6830
6830
  }
6831
- class Q0 extends o {
6831
+ class L0 extends o {
6832
6832
  constructor() {
6833
6833
  super(...arguments);
6834
6834
  e(this, "name", "Ka-Chow");
@@ -8111,7 +8111,7 @@ const hr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8111
8111
  Drink10Wine: Fm,
8112
8112
  Drink2000Alcohols: km,
8113
8113
  Drink2000Quest: Gp,
8114
- Drink200Quest: Lp,
8114
+ Drink200Quest: Qp,
8115
8115
  Drink250Alcohols: bm,
8116
8116
  Drink250Beer: Rm,
8117
8117
  Drink250Rhum: Sm,
@@ -8119,7 +8119,7 @@ const hr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8119
8119
  Drink5000Quest: qp,
8120
8120
  Drink500Alcohols: vm,
8121
8121
  Drink500Beer: $m,
8122
- Drink500Quest: Qp,
8122
+ Drink500Quest: Lp,
8123
8123
  Drink500Rhum: Dm,
8124
8124
  Drink500Wine: Ym,
8125
8125
  Drink50Alcohols: wm,
@@ -8136,9 +8136,9 @@ const hr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8136
8136
  LoseEverything: Tp,
8137
8137
  Paper100: C0,
8138
8138
  RandomMessage100Quest: j0,
8139
- RandomMessage200Quest: L0,
8139
+ RandomMessage200Quest: Q0,
8140
8140
  RandomMessage20Quest: N0,
8141
- RandomMessage500Quest: Q0,
8141
+ RandomMessage500Quest: L0,
8142
8142
  RandomMessage50Quest: P0,
8143
8143
  Report: H0,
8144
8144
  Rock100: B0,
@@ -8236,19 +8236,19 @@ const yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8236
8236
  }
8237
8237
  }
8238
8238
  a.length > 0 && ve("userQuestMetaUpdate", t.user._id, a);
8239
- }, Lm = ["raidUnlock"], _r = new Ui.EventEmitter(), Ct = (t, a, s) => {
8239
+ }, Qm = ["raidUnlock"], _r = new Ui.EventEmitter(), Ct = (t, a, s) => {
8240
8240
  _r.emit(t, a, s);
8241
8241
  }, lg = (t) => {
8242
- for (const a of Lm)
8242
+ for (const a of Qm)
8243
8243
  _r.on(a, (s, n) => {
8244
8244
  t(a, s, n);
8245
8245
  });
8246
- }, Qm = async (t) => {
8246
+ }, Lm = async (t) => {
8247
8247
  var s, n;
8248
- const a = await Qr(t.user._id);
8248
+ const a = await Lr(t.user._id);
8249
8249
  $(t.xp.amount) >= 30 && !st(a, "training") && (await nt(a.user._id, "training"), Ct("raidUnlock", t.user._id, "training")), (((n = (s = a.obtainedRewards.training) == null ? void 0 : s.filter((r) => r.startsWith("end_"))) == null ? void 0 : n.length) ?? 0) >= 4 && !st(a, "resources") && (await nt(a.user._id, "resources"), Ct("raidUnlock", t.user._id, "resources"));
8250
8250
  }, Hm = async (t) => {
8251
- const a = await Qr(t.user._id);
8251
+ const a = await Lr(t.user._id);
8252
8252
  wa(t.equipmentList, (s) => s.id).map((s) => hi(s)).filter((s) => s.panoply === "adventurer").length === 6 && !st(a, "pirate_cave") && (await nt(a.user._id, "pirate_cave"), Ct("raidUnlock", t.user._id, "pirate_cave")), (t.itemList.get("map_fragment") ?? 0) >= 5 && !st(a, "mysterious_island") && (await nt(a.user._id, "mysterious_island"), await $e(
8253
8253
  t.user._id,
8254
8254
  "map_fragment",
@@ -8641,7 +8641,7 @@ ft.index({ user: 1 });
8641
8641
  ft.index({ "xp.amount": -1 });
8642
8642
  ft.index({ berry: -1 });
8643
8643
  ft.post("findOneAndUpdate", async function(t) {
8644
- await Qm(t), await Pm(t), t.berry === 0 && await wr(t.user._id), t.hp <= 0 && await Kn(t.user._id);
8644
+ await Lm(t), await Pm(t), t.berry === 0 && await wr(t.user._id), t.hp <= 0 && await Kn(t.user._id);
8645
8645
  });
8646
8646
  var As;
8647
8647
  const Ee = ((As = T) == null ? void 0 : As.UserMeta) || F("UserMeta", ft), br = async (t) => await Ee.create({
@@ -8908,7 +8908,7 @@ const Ee = ((As = T) == null ? void 0 : As.UserMeta) || F("UserMeta", ft), br =
8908
8908
  await I(t, {
8909
8909
  $set: { hp: r.hp + Math.floor(Math.min(a, c)) }
8910
8910
  });
8911
- }, Lh = async (t, a) => {
8911
+ }, Qh = async (t, a) => {
8912
8912
  await I(t, [
8913
8913
  {
8914
8914
  $set: { hp: { $max: [{ $add: ["$hp", -a] }, 0] } }
@@ -8930,7 +8930,7 @@ const Ee = ((As = T) == null ? void 0 : As.UserMeta) || F("UserMeta", ft), br =
8930
8930
  }
8931
8931
  }
8932
8932
  ]);
8933
- }, Qh = async (t, a) => {
8933
+ }, Lh = async (t, a) => {
8934
8934
  const s = await De(t), n = Object.fromEntries(
8935
8935
  Object.entries(a).filter(([, r]) => r !== 0).map(([r, i]) => [`characteristics.${r}`, i])
8936
8936
  );
@@ -8990,13 +8990,13 @@ const Ee = ((As = T) == null ? void 0 : As.UserMeta) || F("UserMeta", ft), br =
8990
8990
  }, cg = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8991
8991
  __proto__: null,
8992
8992
  addBerry: Mr,
8993
- addCharacteristics: Qh,
8993
+ addCharacteristics: Lh,
8994
8994
  addMinutesInVoiceToday: Wh,
8995
8995
  addScrollCharacteristic: Hh,
8996
8996
  addXp: Yh,
8997
8997
  gainHp: jh,
8998
8998
  incrementWorkUnluckyStreak: zh,
8999
- loseHp: Lh,
8999
+ loseHp: Qh,
9000
9000
  removeBuff: pa,
9001
9001
  resetCharacteristics: Gh,
9002
9002
  resetMinutesInVoiceToday: qh,
@@ -9231,7 +9231,7 @@ const Vt = ((Is = T) == null ? void 0 : Is.UserOrnaments) || F("UserOrnaments",
9231
9231
  }, $r = (t, a) => t.completed.includes(a), Tr = (t, a) => {
9232
9232
  const s = t.daily[a];
9233
9233
  return s && he(s, /* @__PURE__ */ new Date());
9234
- }, ls = (t) => he(La(), t.lastFullComplete), os = (t) => ls(t) ? 1 + Math.min(2, t.streak / 10) : 1, Fr = (t) => t.completed.reduce(
9234
+ }, ls = (t) => he(Qa(), t.lastFullComplete), os = (t) => ls(t) ? 1 + Math.min(2, t.streak / 10) : 1, Fr = (t) => t.completed.reduce(
9235
9235
  (a, s) => a + (s.startsWith("be_level_") ? 1 : 0),
9236
9236
  0
9237
9237
  ), Er = (t, a) => {
@@ -9292,7 +9292,7 @@ const zt = ((Ns = T) == null ? void 0 : Ns.UserQuest) || F("UserQuest", ds), Ot
9292
9292
  { $addFields: { [`daily.${a}`]: /* @__PURE__ */ new Date() } }
9293
9293
  ]);
9294
9294
  }, Ir = async (t, a) => {
9295
- he(La(), a) ? await Ot(t, {
9295
+ he(Qa(), a) ? await Ot(t, {
9296
9296
  $inc: { streak: 1 },
9297
9297
  $set: { lastFullComplete: /* @__PURE__ */ new Date() }
9298
9298
  }) : await Ot(t, {
@@ -9402,11 +9402,11 @@ const Xt = ((Ps = T) == null ? void 0 : Ps.UserRaid) || F("UserRaid", jr), Ae =
9402
9402
  resetRaidProgression: yy,
9403
9403
  startRaid: my,
9404
9404
  unlockRaid: nt
9405
- }, Symbol.toStringTag, { value: "Module" })), Lr = async (t) => await Xt.create({
9405
+ }, Symbol.toStringTag, { value: "Module" })), Qr = async (t) => await Xt.create({
9406
9406
  user: t
9407
- }), Qr = async (t) => {
9407
+ }), Lr = async (t) => {
9408
9408
  const a = await Xt.findOne({ user: t });
9409
- return a || await Lr(t);
9409
+ return a || await Qr(t);
9410
9410
  }, by = (t, a, s, n) => {
9411
9411
  var d;
9412
9412
  let r = Vs()[a];
@@ -9463,7 +9463,7 @@ const cs = ((js = T) == null ? void 0 : js.UserShop) || F("UserShop", Hr), My =
9463
9463
  localField: "_id",
9464
9464
  foreignField: "user",
9465
9465
  justOne: !0
9466
- }, Q = new b({
9466
+ }, L = new b({
9467
9467
  userId: { type: String, required: !0, unique: !0 },
9468
9468
  birthday: { type: Date, default: null },
9469
9469
  faction: { type: String, default: ki },
@@ -9491,48 +9491,48 @@ const cs = ((js = T) == null ? void 0 : js.UserShop) || F("UserShop", Hr), My =
9491
9491
  }
9492
9492
  }
9493
9493
  });
9494
- Q.virtual("inventory", {
9494
+ L.virtual("inventory", {
9495
9495
  ref: "UserInventory",
9496
9496
  ...X
9497
9497
  });
9498
- Q.virtual("raid", { ref: "UserRaid", ...X });
9499
- Q.virtual("games", { ref: "UserGames", ...X });
9500
- Q.virtual("ornaments", {
9498
+ L.virtual("raid", { ref: "UserRaid", ...X });
9499
+ L.virtual("games", { ref: "UserGames", ...X });
9500
+ L.virtual("ornaments", {
9501
9501
  ref: "UserOrnaments",
9502
9502
  ...X
9503
9503
  });
9504
- Q.virtual("crew", { ref: "UserCrew", ...X });
9505
- Q.virtual("dailyReport", {
9504
+ L.virtual("crew", { ref: "UserCrew", ...X });
9505
+ L.virtual("dailyReport", {
9506
9506
  ref: "UserDailyReport",
9507
9507
  ...X
9508
9508
  });
9509
- Q.virtual("shop", { ref: "UserShop", ...X });
9510
- Q.virtual("meta", { ref: "UserMeta", ...X });
9511
- Q.virtual("quest", { ref: "UserQuest", ...X });
9512
- Q.virtual("questMeta", {
9509
+ L.virtual("shop", { ref: "UserShop", ...X });
9510
+ L.virtual("meta", { ref: "UserMeta", ...X });
9511
+ L.virtual("quest", { ref: "UserQuest", ...X });
9512
+ L.virtual("questMeta", {
9513
9513
  ref: "UserQuestMeta",
9514
9514
  ...X
9515
9515
  });
9516
- Q.virtual("cooldown", {
9516
+ L.virtual("cooldown", {
9517
9517
  ref: "UserCooldown",
9518
9518
  ...X
9519
9519
  });
9520
- Q.virtual("reminder", {
9520
+ L.virtual("reminder", {
9521
9521
  ref: "Reminder",
9522
9522
  localField: "_id",
9523
9523
  foreignField: "user"
9524
9524
  });
9525
- Q.virtual("encyclopedia", {
9525
+ L.virtual("encyclopedia", {
9526
9526
  ref: "UserEncyclopedia",
9527
9527
  ...X
9528
9528
  });
9529
- Q.index({ userId: 1 });
9530
- Q.post("deleteOne", async function() {
9529
+ L.index({ userId: 1 });
9530
+ L.post("deleteOne", async function() {
9531
9531
  const t = this.getQuery()._id;
9532
- await Wt.deleteOne({ user: t }), await Ht.deleteOne({ user: t }), await Vt.deleteOne({ user: t }), await Xt.deleteOne({ user: t }), await ut.deleteOne({ user: t }), await za.deleteOne({ user: t }), await cs.deleteOne({ user: t }), await Ee.deleteOne({ user: t }), await zt.deleteOne({ user: t }), await ye.deleteOne({ user: t }), await Lt.deleteOne({ user: t });
9532
+ await Wt.deleteOne({ user: t }), await Ht.deleteOne({ user: t }), await Vt.deleteOne({ user: t }), await Xt.deleteOne({ user: t }), await ut.deleteOne({ user: t }), await za.deleteOne({ user: t }), await cs.deleteOne({ user: t }), await Ee.deleteOne({ user: t }), await zt.deleteOne({ user: t }), await ye.deleteOne({ user: t }), await Qt.deleteOne({ user: t });
9533
9533
  });
9534
- var Ls;
9535
- const Z = ((Ls = T) == null ? void 0 : Ls.User) || F("User", Q), xy = (t) => Z.create({
9534
+ var Qs;
9535
+ const Z = ((Qs = T) == null ? void 0 : Qs.User) || F("User", L), xy = (t) => Z.create({
9536
9536
  userId: t
9537
9537
  }), us = async (t, a = {}) => {
9538
9538
  const s = await Uy({ userId: t }, a);
@@ -9711,7 +9711,7 @@ const Z = ((Ls = T) == null ? void 0 : Ls.User) || F("User", Q), xy = (t) => Z.c
9711
9711
  berry: a - N,
9712
9712
  xp: r - D,
9713
9713
  message: t.questMeta.messageSent - H,
9714
- voice: he(n.lastConnection, La()) ? n.minutesInVoiceToday : 0,
9714
+ voice: he(n.lastConnection, Qa()) ? n.minutesInVoiceToday : 0,
9715
9715
  quest: _t(t.quest.completed, g),
9716
9716
  badge: _t(i, m.unlockedBadges),
9717
9717
  title: _t(c, m.unlockedTitles),
@@ -9826,16 +9826,16 @@ const Z = ((Ls = T) == null ? void 0 : Ls.User) || F("User", Q), xy = (t) => Z.c
9826
9826
  updateSendDailyReport: Ny
9827
9827
  }, Symbol.toStringTag, { value: "Module" })), Mg = async (t) => {
9828
9828
  await Z.deleteOne({ userId: t });
9829
- }, Ly = async (t) => await za.create({
9829
+ }, Qy = async (t) => await za.create({
9830
9830
  user: t
9831
- }), Qy = async (t) => await ye.create({
9831
+ }), Ly = async (t) => await ye.create({
9832
9832
  user: t
9833
9833
  }), Hy = async (t) => await cs.create({
9834
9834
  user: t
9835
9835
  }), Ms = (t, a) => {
9836
9836
  switch (t) {
9837
9837
  case "dailyReport":
9838
- return Ly(a);
9838
+ return Qy(a);
9839
9839
  case "games":
9840
9840
  return rr(a);
9841
9841
  case "inventory":
@@ -9843,13 +9843,13 @@ const Z = ((Ls = T) == null ? void 0 : Ls.User) || F("User", Q), xy = (t) => Z.c
9843
9843
  case "meta":
9844
9844
  return br(a);
9845
9845
  case "raid":
9846
- return Lr(a);
9846
+ return Qr(a);
9847
9847
  case "ornaments":
9848
9848
  return Rr(a);
9849
9849
  case "quest":
9850
9850
  return Nr(a);
9851
9851
  case "questMeta":
9852
- return Qy(a);
9852
+ return Ly(a);
9853
9853
  case "shop":
9854
9854
  return Hy(a);
9855
9855
  case "cooldown":
@@ -9887,8 +9887,8 @@ const Z = ((Ls = T) == null ? void 0 : Ls.User) || F("User", Q), xy = (t) => Z.c
9887
9887
  reason: { type: String, default: null }
9888
9888
  });
9889
9889
  Wr.index({ warnedUserId: 1 });
9890
- var Qs;
9891
- const pt = ((Qs = T) == null ? void 0 : Qs.Warns) || F("Warns", Wr), qy = async (t) => await pt.find({ warnedUserId: t }), Wy = async (t) => await pt.countDocuments({ warnedUserId: t }), kg = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9890
+ var Ls;
9891
+ const pt = ((Ls = T) == null ? void 0 : Ls.Warns) || F("Warns", Wr), qy = async (t) => await pt.find({ warnedUserId: t }), Wy = async (t) => await pt.countDocuments({ warnedUserId: t }), kg = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9892
9892
  __proto__: null,
9893
9893
  getUserWarnCount: Wy,
9894
9894
  getUserWarns: qy
@@ -10289,7 +10289,7 @@ export {
10289
10289
  qt as findUserMeta,
10290
10290
  pg as findUserOrnaments,
10291
10291
  Pr as findUserQuest,
10292
- Qr as findUserRaid,
10292
+ Lr as findUserRaid,
10293
10293
  sg as getBadgeEmojisFromId,
10294
10294
  ag as getQuestBadgeEmojis,
10295
10295
  ga as invitationsModel,
@@ -10301,19 +10301,19 @@ export {
10301
10301
  T_ as reminderGetters,
10302
10302
  We as reminderModel,
10303
10303
  F_ as reminderUpdates,
10304
- Qa as settingsModel,
10304
+ La as settingsModel,
10305
10305
  D_ as settingsUpdates,
10306
10306
  O_ as shopGetters,
10307
10307
  Ha as shopModel,
10308
10308
  B_ as shopUpdates,
10309
10309
  $_ as userCooldownGetters,
10310
- Lt as userCooldownModel,
10310
+ Qt as userCooldownModel,
10311
10311
  Y_ as userCooldownUpdates,
10312
- L_ as userCrewExists,
10312
+ Q_ as userCrewExists,
10313
10313
  ut as userCrewModel,
10314
10314
  P_ as userCrewUpdates,
10315
10315
  za as userDailyReportModel,
10316
- Q_ as userDailyReportUpdates,
10316
+ L_ as userDailyReportUpdates,
10317
10317
  W_ as userEncyclopediaGetters,
10318
10318
  Ja as userEncyclopediaModel,
10319
10319
  V_ as userEncyclopediaUpdates,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opfr/services",
3
- "version": "0.30.0",
3
+ "version": "0.30.1",
4
4
  "private": false,
5
5
  "description": "OPFR services",
6
6
  "author": "Matthieu VEIGA",
@@ -9,13 +9,13 @@
9
9
  "build": "vite build && tsc"
10
10
  },
11
11
  "dependencies": {
12
- "@opfr/canvas": "^0.7.0",
13
- "@opfr/items": "^0.28.1",
14
- "@opfr/ornaments": "^0.11.4",
15
- "@opfr/raids": "^0.8.12",
12
+ "@opfr/canvas": "^0.7.1",
13
+ "@opfr/items": "^0.28.2",
14
+ "@opfr/ornaments": "^0.11.5",
15
+ "@opfr/raids": "^0.8.13",
16
16
  "@opfr/translate": "^0.1.0",
17
- "@opfr/utils-lang": "^0.12.0",
18
- "@opfr/utils-type": "^0.15.2",
17
+ "@opfr/utils-lang": "^0.12.1",
18
+ "@opfr/utils-type": "^0.15.3",
19
19
  "mongoose": "8.7.3"
20
20
  },
21
21
  "main": "dist/index.umd.js",
@@ -37,5 +37,5 @@
37
37
  "node_modules",
38
38
  "dist"
39
39
  ],
40
- "gitHead": "42275824961825a8795280012e41fe7c239a0ec6"
40
+ "gitHead": "ead678cf07853d7daa9ab9ec370b6a93d84a2a5c"
41
41
  }