@duque.edits/sdk 1.1.0 → 1.1.3

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 (161) hide show
  1. package/dist/{index-C87LbIta.d.ts → index-BPxglVSk.d.ts} +83 -31
  2. package/dist/{index-BHHXH2xN.d.mts → index-DjHimKUy.d.mts} +83 -31
  3. package/dist/index.d.mts +2 -1
  4. package/dist/index.d.ts +2 -1
  5. package/dist/index.js +481 -292
  6. package/dist/index.mjs +481 -292
  7. package/dist/managers/automaticmessage/AutomaticMessageManager.d.mts +2 -1
  8. package/dist/managers/automaticmessage/AutomaticMessageManager.d.ts +2 -1
  9. package/dist/managers/automaticmessage/AutomaticMessageManager.js +41 -35
  10. package/dist/managers/automaticmessage/AutomaticMessageManager.mjs +41 -35
  11. package/dist/managers/base.d.mts +2 -1
  12. package/dist/managers/base.d.ts +2 -1
  13. package/dist/managers/base.js +3 -0
  14. package/dist/managers/base.mjs +3 -0
  15. package/dist/managers/bet/GuildBetManager.d.mts +2 -1
  16. package/dist/managers/bet/GuildBetManager.d.ts +2 -1
  17. package/dist/managers/bet/GuildBetManager.js +42 -30
  18. package/dist/managers/bet/GuildBetManager.mjs +42 -30
  19. package/dist/managers/betuser/GuildBetUserManager.d.mts +2 -1
  20. package/dist/managers/betuser/GuildBetUserManager.d.ts +2 -1
  21. package/dist/managers/betuser/GuildBetUserManager.js +32 -19
  22. package/dist/managers/betuser/GuildBetUserManager.mjs +32 -19
  23. package/dist/managers/buffer/BufferManager.d.mts +2 -1
  24. package/dist/managers/buffer/BufferManager.d.ts +2 -1
  25. package/dist/managers/buffer/BufferManager.js +1 -1
  26. package/dist/managers/buffer/BufferManager.mjs +1 -1
  27. package/dist/managers/guild/GuildManager.d.mts +2 -1
  28. package/dist/managers/guild/GuildManager.d.ts +2 -1
  29. package/dist/managers/guild/GuildManager.js +465 -279
  30. package/dist/managers/guild/GuildManager.mjs +465 -279
  31. package/dist/managers/index.d.mts +2 -1
  32. package/dist/managers/index.d.ts +2 -1
  33. package/dist/managers/index.js +480 -291
  34. package/dist/managers/index.mjs +480 -291
  35. package/dist/managers/logs/LogManager.d.mts +2 -1
  36. package/dist/managers/logs/LogManager.d.ts +2 -1
  37. package/dist/managers/logs/LogManager.js +24 -12
  38. package/dist/managers/logs/LogManager.mjs +24 -12
  39. package/dist/managers/match/GuildMatchManager.d.mts +2 -1
  40. package/dist/managers/match/GuildMatchManager.d.ts +2 -1
  41. package/dist/managers/match/GuildMatchManager.js +77 -61
  42. package/dist/managers/match/GuildMatchManager.mjs +77 -61
  43. package/dist/managers/mediator/GuildMediatorManager.d.mts +2 -1
  44. package/dist/managers/mediator/GuildMediatorManager.d.ts +2 -1
  45. package/dist/managers/mediator/GuildMediatorManager.js +30 -17
  46. package/dist/managers/mediator/GuildMediatorManager.mjs +30 -17
  47. package/dist/managers/message/MessagesManager.d.mts +2 -1
  48. package/dist/managers/message/MessagesManager.d.ts +2 -1
  49. package/dist/managers/minesgame/MinesGameManager.d.mts +2 -1
  50. package/dist/managers/minesgame/MinesGameManager.d.ts +2 -1
  51. package/dist/managers/minesgame/MinesGameManager.js +22 -13
  52. package/dist/managers/minesgame/MinesGameManager.mjs +22 -13
  53. package/dist/managers/permission/GuildPermissionManager.d.mts +2 -1
  54. package/dist/managers/permission/GuildPermissionManager.d.ts +2 -1
  55. package/dist/managers/permission/GuildPermissionManager.js +4 -1
  56. package/dist/managers/permission/GuildPermissionManager.mjs +4 -1
  57. package/dist/managers/player/PlayerManager.d.mts +2 -1
  58. package/dist/managers/player/PlayerManager.d.ts +2 -1
  59. package/dist/managers/ticket/TicketManager.d.mts +2 -1
  60. package/dist/managers/ticket/TicketManager.d.ts +2 -1
  61. package/dist/managers/ticket/TicketManager.js +42 -28
  62. package/dist/managers/ticket/TicketManager.mjs +42 -28
  63. package/dist/managers/tournament/TournamentManager.d.mts +21 -0
  64. package/dist/managers/tournament/TournamentManager.d.ts +21 -0
  65. package/dist/managers/tournament/TournamentManager.js +753 -0
  66. package/dist/managers/tournament/TournamentManager.mjs +745 -0
  67. package/dist/managers/user/GuildUserManager.d.mts +2 -1
  68. package/dist/managers/user/GuildUserManager.d.ts +2 -1
  69. package/dist/managers/user/GuildUserManager.js +49 -36
  70. package/dist/managers/user/GuildUserManager.mjs +49 -36
  71. package/dist/managers/vipmember/VipMemberManager.d.mts +2 -1
  72. package/dist/managers/vipmember/VipMemberManager.d.ts +2 -1
  73. package/dist/managers/vipmember/VipMemberManager.js +4 -1
  74. package/dist/managers/vipmember/VipMemberManager.mjs +4 -1
  75. package/dist/rest/REST.d.mts +2 -1
  76. package/dist/rest/REST.d.ts +2 -1
  77. package/dist/rest/REST.js +482 -293
  78. package/dist/rest/REST.mjs +482 -293
  79. package/dist/rest/Routes.js +1 -1
  80. package/dist/rest/Routes.mjs +1 -1
  81. package/dist/rest/index.d.mts +2 -1
  82. package/dist/rest/index.d.ts +2 -1
  83. package/dist/rest/index.js +482 -293
  84. package/dist/rest/index.mjs +482 -293
  85. package/dist/structures/automaticmessage/AutomaticMessage.d.mts +2 -1
  86. package/dist/structures/automaticmessage/AutomaticMessage.d.ts +2 -1
  87. package/dist/structures/automaticmessage/AutomaticMessage.js +30 -26
  88. package/dist/structures/automaticmessage/AutomaticMessage.mjs +30 -26
  89. package/dist/structures/bet/GuildBet.d.mts +2 -1
  90. package/dist/structures/bet/GuildBet.d.ts +2 -1
  91. package/dist/structures/bet/GuildBet.js +39 -30
  92. package/dist/structures/bet/GuildBet.mjs +39 -30
  93. package/dist/structures/betuser/GuildBetUser.d.mts +2 -1
  94. package/dist/structures/betuser/GuildBetUser.d.ts +2 -1
  95. package/dist/structures/betuser/GuildBetUser.js +29 -19
  96. package/dist/structures/betuser/GuildBetUser.mjs +29 -19
  97. package/dist/structures/guild/Guild.d.mts +2 -1
  98. package/dist/structures/guild/Guild.d.ts +2 -1
  99. package/dist/structures/guild/Guild.js +451 -274
  100. package/dist/structures/guild/Guild.mjs +451 -274
  101. package/dist/structures/index.d.mts +2 -1
  102. package/dist/structures/index.d.ts +2 -1
  103. package/dist/structures/index.js +468 -288
  104. package/dist/structures/index.mjs +468 -288
  105. package/dist/structures/logentry/LogEntry.d.mts +2 -1
  106. package/dist/structures/logentry/LogEntry.d.ts +2 -1
  107. package/dist/structures/logentry/LogEntry.js +21 -12
  108. package/dist/structures/logentry/LogEntry.mjs +21 -12
  109. package/dist/structures/match/GuildMatch.d.mts +2 -1
  110. package/dist/structures/match/GuildMatch.d.ts +2 -1
  111. package/dist/structures/match/GuildMatch.js +74 -61
  112. package/dist/structures/match/GuildMatch.mjs +74 -61
  113. package/dist/structures/mediator/GuildMediator.d.mts +2 -1
  114. package/dist/structures/mediator/GuildMediator.d.ts +2 -1
  115. package/dist/structures/mediator/GuildMediator.js +27 -17
  116. package/dist/structures/mediator/GuildMediator.mjs +27 -17
  117. package/dist/structures/minesgame/MinesGame.d.mts +2 -1
  118. package/dist/structures/minesgame/MinesGame.d.ts +2 -1
  119. package/dist/structures/minesgame/MinesGame.js +22 -13
  120. package/dist/structures/minesgame/MinesGame.mjs +22 -13
  121. package/dist/structures/ticket/Ticket.d.mts +2 -1
  122. package/dist/structures/ticket/Ticket.d.ts +2 -1
  123. package/dist/structures/ticket/Ticket.js +27 -18
  124. package/dist/structures/ticket/Ticket.mjs +27 -18
  125. package/dist/structures/tournament/Tournament.d.mts +21 -0
  126. package/dist/structures/tournament/Tournament.d.ts +21 -0
  127. package/dist/structures/tournament/Tournament.js +593 -0
  128. package/dist/structures/tournament/Tournament.mjs +585 -0
  129. package/dist/structures/user/GuildUser.d.mts +2 -1
  130. package/dist/structures/user/GuildUser.d.ts +2 -1
  131. package/dist/structures/user/GuildUser.js +46 -36
  132. package/dist/structures/user/GuildUser.mjs +46 -36
  133. package/dist/structures/vipmember/VipMember.d.mts +2 -1
  134. package/dist/structures/vipmember/VipMember.d.ts +2 -1
  135. package/dist/structures/vipmember/VipMember.js +1 -1
  136. package/dist/structures/vipmember/VipMember.mjs +1 -1
  137. package/dist/types/RestTypes.d.mts +2 -1
  138. package/dist/types/RestTypes.d.ts +2 -1
  139. package/dist/types/api/APIAutomaticMessage.d.mts +2 -1
  140. package/dist/types/api/APIAutomaticMessage.d.ts +2 -1
  141. package/dist/types/api/APIGuild.d.mts +2 -1
  142. package/dist/types/api/APIGuild.d.ts +2 -1
  143. package/dist/types/api/APIGuildBet.d.mts +2 -1
  144. package/dist/types/api/APIGuildBet.d.ts +2 -1
  145. package/dist/types/api/APIGuildBetUser.d.mts +2 -1
  146. package/dist/types/api/APIGuildBetUser.d.ts +2 -1
  147. package/dist/types/api/APIGuildGroupedChannel.d.mts +2 -1
  148. package/dist/types/api/APIGuildGroupedChannel.d.ts +2 -1
  149. package/dist/types/api/APIGuildMatch.d.mts +2 -1
  150. package/dist/types/api/APIGuildMatch.d.ts +2 -1
  151. package/dist/types/api/APIGuildUser.d.mts +2 -1
  152. package/dist/types/api/APIGuildUser.d.ts +2 -1
  153. package/dist/types/api/APITournament.d.mts +16 -0
  154. package/dist/types/api/APITournament.d.ts +16 -0
  155. package/dist/types/api/APITournament.js +18 -0
  156. package/dist/types/api/APITournament.mjs +0 -0
  157. package/dist/types/api/index.d.mts +2 -1
  158. package/dist/types/api/index.d.ts +2 -1
  159. package/dist/types/index.d.mts +2 -1
  160. package/dist/types/index.d.ts +2 -1
  161. package/package.json +1 -1
@@ -401,7 +401,7 @@ var require_main = __commonJS({
401
401
  var rest_exports = {};
402
402
  __export(rest_exports, {
403
403
  APIEndpoints: () => APIEndpoints,
404
- REST: () => REST8,
404
+ REST: () => REST9,
405
405
  Routes: () => Routes
406
406
  });
407
407
  module.exports = __toCommonJS(rest_exports);
@@ -422,7 +422,7 @@ var APIEndpoints = {
422
422
  // src/rest/Routes.ts
423
423
  var Routes = {
424
424
  //base: "http://localhost:80/api/v1",
425
- base: "https://duque-api.up.railway.app/api/v1",
425
+ base: "https://duqueapi.shardweb.app/api/v1",
426
426
  field: (field) => `/${field}`,
427
427
  fields: (...fields) => `${fields.join("/")}`,
428
428
  guilds: {
@@ -674,6 +674,9 @@ var BaseManager = class {
674
674
  this.rest = guild.rest;
675
675
  this.cache = new Collection();
676
676
  }
677
+ toJSON() {
678
+ return [...this.cache.values()].map((m) => m && "toJSON" in m && typeof m.toJSON === "function" ? m.toJSON() : m);
679
+ }
677
680
  };
678
681
 
679
682
  // src/managers/player/PlayerManager.ts
@@ -745,8 +748,10 @@ var PlayerManager = class extends Collection {
745
748
  };
746
749
 
747
750
  // src/structures/bet/GuildBet.ts
751
+ var _GuildBet_instances, updateInternals_fn;
748
752
  var GuildBet = class {
749
753
  constructor(data, manager) {
754
+ __privateAdd(this, _GuildBet_instances);
750
755
  /** The bet's type */
751
756
  __publicField(this, "type");
752
757
  /** The bet's mode */
@@ -825,7 +830,7 @@ var GuildBet = class {
825
830
  async fetch() {
826
831
  const route = Routes.guilds.bets.get(this.guild.id, this._id);
827
832
  const response = await this.rest.request({ url: route, method: "GET" });
828
- return this._updateInternals(response);
833
+ return __privateMethod(this, _GuildBet_instances, updateInternals_fn).call(this, response);
829
834
  }
830
835
  async addPlayer(player, queue_type) {
831
836
  if (this.players.length === 2) return this;
@@ -862,7 +867,7 @@ var GuildBet = class {
862
867
  const payload = data;
863
868
  const route = Routes.guilds.bets.update(this.guild.id, this._id);
864
869
  const response = await this.rest.request({ method: "patch", url: route, payload });
865
- return this._updateInternals(response);
870
+ return __privateMethod(this, _GuildBet_instances, updateInternals_fn).call(this, response);
866
871
  }
867
872
  async delete() {
868
873
  const route = Routes.guilds.bets.delete(this.manager.guild.id, this._id);
@@ -874,33 +879,6 @@ var GuildBet = class {
874
879
  this.manager.cache.delete(this._id);
875
880
  return response;
876
881
  }
877
- _updateInternals(data) {
878
- for (let key in data) {
879
- if (key === "_id" || key === "createdAt") continue;
880
- if (key === "messages") {
881
- this.messages.set(data[key]);
882
- continue;
883
- }
884
- if (key === "players") {
885
- this.players._set(data[key]);
886
- continue;
887
- }
888
- if (key in this) {
889
- this[key] = data[key];
890
- }
891
- }
892
- if (data?.messages?.length !== 0) {
893
- if (this?.messages instanceof MessagesManager) this.messages.set(data.messages);
894
- else {
895
- this.messages = new MessagesManager(this, Routes.guilds.matches.resource(this.guild_id, this._id, "messages"));
896
- this.messages.set(data.messages);
897
- }
898
- }
899
- this.updatedAt = /* @__PURE__ */ new Date();
900
- this.createdAt = new Date(data.createdAt);
901
- this.manager.set(this);
902
- return this;
903
- }
904
882
  toJSON() {
905
883
  let json = {};
906
884
  for (const [key, value] of Object.entries(this)) {
@@ -917,9 +895,38 @@ var GuildBet = class {
917
895
  };
918
896
  }
919
897
  };
898
+ _GuildBet_instances = new WeakSet();
899
+ updateInternals_fn = function(data) {
900
+ for (let key in data) {
901
+ if (key === "_id" || key === "createdAt") continue;
902
+ if (key === "messages") {
903
+ this.messages.set(data[key]);
904
+ continue;
905
+ }
906
+ if (key === "players") {
907
+ this.players._set(data[key]);
908
+ continue;
909
+ }
910
+ if (key in this) {
911
+ this[key] = data[key];
912
+ }
913
+ }
914
+ if (data?.messages?.length !== 0) {
915
+ if (this?.messages instanceof MessagesManager) this.messages.set(data.messages);
916
+ else {
917
+ this.messages = new MessagesManager(this, Routes.guilds.matches.resource(this.guild_id, this._id, "messages"));
918
+ this.messages.set(data.messages);
919
+ }
920
+ }
921
+ this.updatedAt = /* @__PURE__ */ new Date();
922
+ this.createdAt = new Date(data.createdAt);
923
+ this.manager.set(this);
924
+ return this;
925
+ };
920
926
 
921
927
  // src/structures/betuser/GuildBetUser.ts
922
- var GuildBetUser = class _GuildBetUser {
928
+ var _GuildBetUser_instances, updateInternals_fn2;
929
+ var _GuildBetUser = class _GuildBetUser {
923
930
  /**
924
931
  * Bet user
925
932
  * @param data The user's data
@@ -927,6 +934,7 @@ var GuildBetUser = class _GuildBetUser {
927
934
  * @param rest The rest client
928
935
  */
929
936
  constructor(data, manager) {
937
+ __privateAdd(this, _GuildBetUser_instances);
930
938
  /** User daily */
931
939
  __publicField(this, "daily");
932
940
  __publicField(this, "profile");
@@ -1021,7 +1029,7 @@ var GuildBetUser = class _GuildBetUser {
1021
1029
  url: route,
1022
1030
  payload
1023
1031
  });
1024
- return this._updateInternals(response);
1032
+ return __privateMethod(this, _GuildBetUser_instances, updateInternals_fn2).call(this, response);
1025
1033
  }
1026
1034
  async updateProfile(data) {
1027
1035
  const _data = {
@@ -1041,20 +1049,7 @@ var GuildBetUser = class _GuildBetUser {
1041
1049
  url: route,
1042
1050
  payload: _data
1043
1051
  });
1044
- return this._updateInternals(response);
1045
- }
1046
- _updateInternals(data) {
1047
- for (let key in data) {
1048
- if (key === "id" || key === "createdAt") continue;
1049
- if (key in this) {
1050
- this[key] = data[key];
1051
- }
1052
- }
1053
- this.updatedAt = /* @__PURE__ */ new Date();
1054
- this.createdAt = new Date(data.createdAt);
1055
- this.manager.set(this);
1056
- this.rest.emit("betuserUpdate", this);
1057
- return this;
1052
+ return __privateMethod(this, _GuildBetUser_instances, updateInternals_fn2).call(this, response);
1058
1053
  }
1059
1054
  /**
1060
1055
  * Update certain property
@@ -1091,7 +1086,7 @@ var GuildBetUser = class _GuildBetUser {
1091
1086
  url: route,
1092
1087
  payload
1093
1088
  });
1094
- return this._updateInternals(response);
1089
+ return __privateMethod(this, _GuildBetUser_instances, updateInternals_fn2).call(this, response);
1095
1090
  }
1096
1091
  async _update(data) {
1097
1092
  const route = Routes.guilds.betusers.get(this.manager.guild.id, this.id);
@@ -1101,7 +1096,7 @@ var GuildBetUser = class _GuildBetUser {
1101
1096
  url: route,
1102
1097
  payload
1103
1098
  });
1104
- return this._updateInternals(response);
1099
+ return __privateMethod(this, _GuildBetUser_instances, updateInternals_fn2).call(this, response);
1105
1100
  }
1106
1101
  async delete() {
1107
1102
  const route = Routes.guilds.betusers.delete(this.manager.guild.id, this.id);
@@ -1125,10 +1120,27 @@ var GuildBetUser = class _GuildBetUser {
1125
1120
  return json;
1126
1121
  }
1127
1122
  };
1123
+ _GuildBetUser_instances = new WeakSet();
1124
+ updateInternals_fn2 = function(data) {
1125
+ for (let key in data) {
1126
+ if (key === "id" || key === "createdAt") continue;
1127
+ if (key in this) {
1128
+ this[key] = data[key];
1129
+ }
1130
+ }
1131
+ this.updatedAt = /* @__PURE__ */ new Date();
1132
+ this.createdAt = new Date(data.createdAt);
1133
+ this.manager.set(this);
1134
+ this.rest.emit("betuserUpdate", this);
1135
+ return this;
1136
+ };
1137
+ var GuildBetUser = _GuildBetUser;
1128
1138
 
1129
1139
  // src/structures/logentry/LogEntry.ts
1140
+ var _LogEntry_instances, updateInternals_fn3;
1130
1141
  var LogEntry = class {
1131
1142
  constructor(data, manager) {
1143
+ __privateAdd(this, _LogEntry_instances);
1132
1144
  __publicField(this, "_id");
1133
1145
  __publicField(this, "guild_id");
1134
1146
  __publicField(this, "user_id");
@@ -1164,9 +1176,9 @@ var LogEntry = class {
1164
1176
  this.updatedAt = data?.updatedAt ? new Date(data?.updatedAt) : /* @__PURE__ */ new Date();
1165
1177
  }
1166
1178
  async fetch() {
1167
- const route = Routes.guilds.resources(this.guild.id, "logs", this._id);
1179
+ const route = Routes.fields("guilds", this.guild.id, "logentries", this._id);
1168
1180
  const response = await this.rest.request({ url: route, method: "GET" });
1169
- return this._updateInternals(response);
1181
+ return __privateMethod(this, _LogEntry_instances, updateInternals_fn3).call(this, response);
1170
1182
  }
1171
1183
  toJSON() {
1172
1184
  const json = {};
@@ -1177,21 +1189,23 @@ var LogEntry = class {
1177
1189
  }
1178
1190
  return json;
1179
1191
  }
1180
- _updateInternals(data) {
1181
- for (let key in data) {
1182
- if (key === "id" || key === "createdAt") continue;
1183
- if (key in this) {
1184
- this[key] = data[key];
1185
- }
1192
+ };
1193
+ _LogEntry_instances = new WeakSet();
1194
+ updateInternals_fn3 = function(data) {
1195
+ for (let key in data) {
1196
+ if (key === "id" || key === "createdAt") continue;
1197
+ if (key in this) {
1198
+ this[key] = data[key];
1186
1199
  }
1187
- this.updatedAt = /* @__PURE__ */ new Date();
1188
- this.manager.set(this);
1189
- return this;
1190
1200
  }
1201
+ this.updatedAt = /* @__PURE__ */ new Date();
1202
+ this.manager.set(this);
1203
+ return this;
1191
1204
  };
1192
1205
 
1193
1206
  // src/structures/match/GuildMatch.ts
1194
- var GuildMatch = class _GuildMatch {
1207
+ var _GuildMatch_instances, updateInternals_fn4;
1208
+ var _GuildMatch = class _GuildMatch {
1195
1209
  /**
1196
1210
  * GuildMatch match
1197
1211
  * @param data The match's data
@@ -1199,6 +1213,7 @@ var GuildMatch = class _GuildMatch {
1199
1213
  * @param rest The rest client
1200
1214
  */
1201
1215
  constructor(data, manager) {
1216
+ __privateAdd(this, _GuildMatch_instances);
1202
1217
  __publicField(this, "_id");
1203
1218
  __publicField(this, "selections");
1204
1219
  /** Match's type */
@@ -1282,7 +1297,7 @@ var GuildMatch = class _GuildMatch {
1282
1297
  method: "get",
1283
1298
  url: route
1284
1299
  });
1285
- return await this._updateInternals(response);
1300
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn4).call(this, response);
1286
1301
  }
1287
1302
  async addConfirmed(type, id) {
1288
1303
  const confirmed = this.confirmed.find((c) => c.type === type);
@@ -1304,7 +1319,7 @@ var GuildMatch = class _GuildMatch {
1304
1319
  url: route,
1305
1320
  payload: set
1306
1321
  });
1307
- return await this._updateInternals(response);
1322
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn4).call(this, response);
1308
1323
  }
1309
1324
  async setStatus(status) {
1310
1325
  Assertion.assertString(status);
@@ -1315,7 +1330,7 @@ var GuildMatch = class _GuildMatch {
1315
1330
  url: route,
1316
1331
  payload
1317
1332
  });
1318
- return await this._updateInternals(response);
1333
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn4).call(this, response);
1319
1334
  }
1320
1335
  async setWinners(players) {
1321
1336
  if (!Array.isArray(players)) players = [players];
@@ -1326,7 +1341,7 @@ var GuildMatch = class _GuildMatch {
1326
1341
  url: route,
1327
1342
  payload
1328
1343
  });
1329
- return await this._updateInternals(response);
1344
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn4).call(this, response);
1330
1345
  }
1331
1346
  async setLoser(players) {
1332
1347
  if (!Array.isArray(players)) players = [players];
@@ -1337,7 +1352,7 @@ var GuildMatch = class _GuildMatch {
1337
1352
  url: route,
1338
1353
  payload
1339
1354
  });
1340
- return await this._updateInternals(response);
1355
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn4).call(this, response);
1341
1356
  }
1342
1357
  async setMvps(...usersId) {
1343
1358
  const payload = { set: usersId };
@@ -1347,7 +1362,7 @@ var GuildMatch = class _GuildMatch {
1347
1362
  url: route,
1348
1363
  payload
1349
1364
  });
1350
- return await this._updateInternals(response);
1365
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn4).call(this, response);
1351
1366
  }
1352
1367
  async setRoomCreatorId(userId) {
1353
1368
  Assertion.assertString(userId);
@@ -1358,7 +1373,7 @@ var GuildMatch = class _GuildMatch {
1358
1373
  url: route,
1359
1374
  payload
1360
1375
  });
1361
- return await this._updateInternals(response);
1376
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn4).call(this, response);
1362
1377
  }
1363
1378
  async setRoomAdminId(userId) {
1364
1379
  Assertion.assertString(userId);
@@ -1369,7 +1384,7 @@ var GuildMatch = class _GuildMatch {
1369
1384
  url: route,
1370
1385
  payload
1371
1386
  });
1372
- return await this._updateInternals(response);
1387
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn4).call(this, response);
1373
1388
  }
1374
1389
  async kick(player) {
1375
1390
  this.players = this.players.filter((p) => p.id !== player.id);
@@ -1393,7 +1408,7 @@ var GuildMatch = class _GuildMatch {
1393
1408
  payload: data
1394
1409
  });
1395
1410
  this.rest.emit("matchUpdate", this, new _GuildMatch(response, this.manager));
1396
- return await this._updateInternals(response);
1411
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn4).call(this, response);
1397
1412
  }
1398
1413
  async delete() {
1399
1414
  const route = Routes.guilds.matches.resource(this.guild.id, this._id);
@@ -1419,35 +1434,38 @@ var GuildMatch = class _GuildMatch {
1419
1434
  messages: this?.messages instanceof MessagesManager ? this.messages?.cache?.toArray() : []
1420
1435
  };
1421
1436
  }
1422
- async _updateInternals(data) {
1423
- if (!data) return;
1424
- for (let key in data) {
1425
- if (key === "id" || key === "createdAt" || key === "messages") continue;
1426
- if (key in this) {
1427
- this[key] = data[key];
1428
- }
1429
- if (key === "bet") {
1430
- this.bet = this.guild.bets.set(data.bet);
1431
- }
1437
+ };
1438
+ _GuildMatch_instances = new WeakSet();
1439
+ updateInternals_fn4 = async function(data) {
1440
+ if (!data) return;
1441
+ for (let key in data) {
1442
+ if (key === "id" || key === "createdAt" || key === "messages") continue;
1443
+ if (key in this) {
1444
+ this[key] = data[key];
1432
1445
  }
1433
- if (data?.messages?.length !== 0) {
1434
- if (this?.messages instanceof MessagesManager) this.messages.set(data.messages);
1435
- else {
1436
- this.messages = new MessagesManager(this, Routes.guilds.matches.resource(this.guild_id, this._id, "messages"));
1437
- this.messages.set(data.messages);
1438
- }
1446
+ if (key === "bet") {
1447
+ this.bet = this.guild.bets.set(data.bet);
1439
1448
  }
1440
- if (!(this.bet instanceof GuildBet) && data?.bet) {
1441
- this.bet = this.guild.bets.cache.get(data._id) ?? await this.guild.bets.fetch({ betId: data?.bet?._id });
1449
+ }
1450
+ if (data?.messages?.length !== 0) {
1451
+ if (this?.messages instanceof MessagesManager) this.messages.set(data.messages);
1452
+ else {
1453
+ this.messages = new MessagesManager(this, Routes.guilds.matches.resource(this.guild_id, this._id, "messages"));
1454
+ this.messages.set(data.messages);
1442
1455
  }
1443
- this.updatedAt = /* @__PURE__ */ new Date();
1444
- this.manager.set(this);
1445
- return this;
1446
1456
  }
1457
+ if (!(this.bet instanceof GuildBet) && data?.bet) {
1458
+ this.bet = this.guild.bets.cache.get(data._id) ?? await this.guild.bets.fetch({ betId: data?.bet?._id });
1459
+ }
1460
+ this.updatedAt = /* @__PURE__ */ new Date();
1461
+ this.manager.set(this);
1462
+ return this;
1447
1463
  };
1464
+ var GuildMatch = _GuildMatch;
1448
1465
 
1449
1466
  // src/structures/mediator/GuildMediator.ts
1450
- var GuildMediator = class _GuildMediator {
1467
+ var _GuildMediator_instances, updateInternals_fn5;
1468
+ var _GuildMediator = class _GuildMediator {
1451
1469
  /**
1452
1470
  * Bet user
1453
1471
  * @param data The user's data
@@ -1455,6 +1473,7 @@ var GuildMediator = class _GuildMediator {
1455
1473
  * @param rest The rest client
1456
1474
  */
1457
1475
  constructor(data, manager) {
1476
+ __privateAdd(this, _GuildMediator_instances);
1458
1477
  /** User's name */
1459
1478
  __publicField(this, "id");
1460
1479
  __publicField(this, "guild_id");
@@ -1513,19 +1532,7 @@ var GuildMediator = class _GuildMediator {
1513
1532
  url: route,
1514
1533
  payload
1515
1534
  });
1516
- return this._updateInternals(response);
1517
- }
1518
- _updateInternals(data) {
1519
- for (let key in data) {
1520
- if (key === "id" || key === "createdAt") continue;
1521
- if (key in this) {
1522
- this[key] = data[key];
1523
- }
1524
- }
1525
- this.updatedAt = /* @__PURE__ */ new Date();
1526
- this.createdAt = new Date(data.createdAt);
1527
- this.manager.set(this);
1528
- return this;
1535
+ return __privateMethod(this, _GuildMediator_instances, updateInternals_fn5).call(this, response);
1529
1536
  }
1530
1537
  /**
1531
1538
  * Update certain property
@@ -1540,7 +1547,7 @@ var GuildMediator = class _GuildMediator {
1540
1547
  url: route,
1541
1548
  payload
1542
1549
  });
1543
- return this._updateInternals(response);
1550
+ return __privateMethod(this, _GuildMediator_instances, updateInternals_fn5).call(this, response);
1544
1551
  }
1545
1552
  async setPaymentlink(type, link) {
1546
1553
  const route = Routes.guilds.mediators.get(this.manager.guild.id, this.id);
@@ -1550,7 +1557,7 @@ var GuildMediator = class _GuildMediator {
1550
1557
  url: route,
1551
1558
  payload
1552
1559
  });
1553
- return this._updateInternals(response);
1560
+ return __privateMethod(this, _GuildMediator_instances, updateInternals_fn5).call(this, response);
1554
1561
  }
1555
1562
  async delete() {
1556
1563
  const route = Routes.guilds.mediators.delete(this.manager.guild.id, this.id);
@@ -1573,9 +1580,24 @@ var GuildMediator = class _GuildMediator {
1573
1580
  return json;
1574
1581
  }
1575
1582
  };
1583
+ _GuildMediator_instances = new WeakSet();
1584
+ updateInternals_fn5 = function(data) {
1585
+ for (let key in data) {
1586
+ if (key === "id" || key === "createdAt") continue;
1587
+ if (key in this) {
1588
+ this[key] = data[key];
1589
+ }
1590
+ }
1591
+ this.updatedAt = /* @__PURE__ */ new Date();
1592
+ this.createdAt = new Date(data.createdAt);
1593
+ this.manager.set(this);
1594
+ return this;
1595
+ };
1596
+ var GuildMediator = _GuildMediator;
1576
1597
 
1577
1598
  // src/structures/user/GuildUser.ts
1578
- var GuildUser = class _GuildUser {
1599
+ var _GuildUser_instances, updateInternals_fn6;
1600
+ var _GuildUser = class _GuildUser {
1579
1601
  /**
1580
1602
  * Bet user
1581
1603
  * @param data The user's data
@@ -1583,6 +1605,7 @@ var GuildUser = class _GuildUser {
1583
1605
  * @param rest The rest client
1584
1606
  */
1585
1607
  constructor(data, manager) {
1608
+ __privateAdd(this, _GuildUser_instances);
1586
1609
  /** User's id */
1587
1610
  __publicField(this, "id");
1588
1611
  __publicField(this, "guild_id");
@@ -1695,7 +1718,7 @@ var GuildUser = class _GuildUser {
1695
1718
  url: route,
1696
1719
  payload
1697
1720
  });
1698
- this._updateInternals(response);
1721
+ __privateMethod(this, _GuildUser_instances, updateInternals_fn6).call(this, response);
1699
1722
  return this;
1700
1723
  }
1701
1724
  async updateProfile(data) {
@@ -1716,43 +1739,14 @@ var GuildUser = class _GuildUser {
1716
1739
  url: route,
1717
1740
  payload: _data
1718
1741
  });
1719
- this._updateInternals(response);
1720
- return this;
1721
- }
1722
- _updateInternals(data) {
1723
- for (let key in data) {
1724
- if (key === "id" || key === "createdAt") continue;
1725
- if (key in this) {
1726
- this[key] = data[key];
1727
- }
1728
- if (key === "adverts") {
1729
- this.adverts = [];
1730
- for (let _adv of data.adverts) {
1731
- this.adverts.push({
1732
- _id: _adv._id,
1733
- admin_id: _adv.admin_id,
1734
- role_id: _adv.role_id,
1735
- reason: _adv.reason,
1736
- points_removed: _adv.points_removed,
1737
- proof: _adv.proof,
1738
- proof_ext: _adv.proof_ext,
1739
- createdAt: _adv.createdAt ? new Date(_adv.createdAt) : /* @__PURE__ */ new Date(),
1740
- updatedAt: _adv.updatedAt ? new Date(_adv.updatedAt) : /* @__PURE__ */ new Date()
1741
- });
1742
- }
1743
- }
1744
- }
1745
- this.updatedAt = /* @__PURE__ */ new Date();
1746
- this.createdAt = new Date(data.createdAt);
1747
- this.manager.set(this);
1748
- this.rest.emit("userUpdate", this);
1742
+ __privateMethod(this, _GuildUser_instances, updateInternals_fn6).call(this, response);
1749
1743
  return this;
1750
1744
  }
1751
1745
  async addAdvert(data) {
1752
1746
  const route = Routes.guilds.users.resource(this.manager.guild.id, this.id, "adverts");
1753
1747
  const payload = data;
1754
1748
  const response = await this.rest.request({ method: "POST", url: route, payload });
1755
- return this._updateInternals(response);
1749
+ return __privateMethod(this, _GuildUser_instances, updateInternals_fn6).call(this, response);
1756
1750
  }
1757
1751
  async removeAdvert(advertId) {
1758
1752
  let advs = this.adverts;
@@ -1761,7 +1755,7 @@ var GuildUser = class _GuildUser {
1761
1755
  const payload = { adverts: advs };
1762
1756
  const route = Routes.guilds.users.update(this.manager.guild.id, this.id);
1763
1757
  const response = await this.rest.request({ method: "PATCH", url: route, payload });
1764
- return this._updateInternals(response);
1758
+ return __privateMethod(this, _GuildUser_instances, updateInternals_fn6).call(this, response);
1765
1759
  }
1766
1760
  /**
1767
1761
  * Update certain property
@@ -1812,7 +1806,7 @@ var GuildUser = class _GuildUser {
1812
1806
  url: route,
1813
1807
  payload
1814
1808
  });
1815
- this._updateInternals(response);
1809
+ __privateMethod(this, _GuildUser_instances, updateInternals_fn6).call(this, response);
1816
1810
  return this;
1817
1811
  }
1818
1812
  async delete() {
@@ -1837,6 +1831,37 @@ var GuildUser = class _GuildUser {
1837
1831
  return json;
1838
1832
  }
1839
1833
  };
1834
+ _GuildUser_instances = new WeakSet();
1835
+ updateInternals_fn6 = function(data) {
1836
+ for (let key in data) {
1837
+ if (key === "id" || key === "createdAt") continue;
1838
+ if (key in this) {
1839
+ this[key] = data[key];
1840
+ }
1841
+ if (key === "adverts") {
1842
+ this.adverts = [];
1843
+ for (let _adv of data.adverts) {
1844
+ this.adverts.push({
1845
+ _id: _adv._id,
1846
+ admin_id: _adv.admin_id,
1847
+ role_id: _adv.role_id,
1848
+ reason: _adv.reason,
1849
+ points_removed: _adv.points_removed,
1850
+ proof: _adv.proof,
1851
+ proof_ext: _adv.proof_ext,
1852
+ createdAt: _adv.createdAt ? new Date(_adv.createdAt) : /* @__PURE__ */ new Date(),
1853
+ updatedAt: _adv.updatedAt ? new Date(_adv.updatedAt) : /* @__PURE__ */ new Date()
1854
+ });
1855
+ }
1856
+ }
1857
+ }
1858
+ this.updatedAt = /* @__PURE__ */ new Date();
1859
+ this.createdAt = new Date(data.createdAt);
1860
+ this.manager.set(this);
1861
+ this.rest.emit("userUpdate", this);
1862
+ return this;
1863
+ };
1864
+ var GuildUser = _GuildUser;
1840
1865
 
1841
1866
  // src/structures/vipmember/VipMember.ts
1842
1867
  var _VipMember_instances, updateData_fn;
@@ -1975,8 +2000,10 @@ updateData_fn = function(data) {
1975
2000
  var VipMember = _VipMember;
1976
2001
 
1977
2002
  // src/structures/ticket/Ticket.ts
2003
+ var _GuildTicket_instances, updateInternals_fn7;
1978
2004
  var GuildTicket = class {
1979
2005
  constructor(data, manager) {
2006
+ __privateAdd(this, _GuildTicket_instances);
1980
2007
  __publicField(this, "_id");
1981
2008
  __publicField(this, "guild_id");
1982
2009
  __publicField(this, "type");
@@ -2013,7 +2040,7 @@ var GuildTicket = class {
2013
2040
  method: "GET",
2014
2041
  url: route
2015
2042
  });
2016
- return this._updateInternals(response);
2043
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn7).call(this, response);
2017
2044
  }
2018
2045
  async setCustomerRating(rating) {
2019
2046
  const route = Routes.guilds.tickets.resource(this.guild.id, this._id, "customer_rating");
@@ -2023,7 +2050,7 @@ var GuildTicket = class {
2023
2050
  url: route,
2024
2051
  payload
2025
2052
  });
2026
- return this._updateInternals(response);
2053
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn7).call(this, response);
2027
2054
  }
2028
2055
  async setAdminId(id) {
2029
2056
  const route = Routes.guilds.tickets.resource(this.guild.id, this._id, "admin_id");
@@ -2033,7 +2060,7 @@ var GuildTicket = class {
2033
2060
  url: route,
2034
2061
  payload
2035
2062
  });
2036
- return this._updateInternals(response);
2063
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn7).call(this, response);
2037
2064
  }
2038
2065
  async setChannelId(id) {
2039
2066
  const route = Routes.guilds.tickets.resource(this.guild.id, this._id, "channel_id");
@@ -2043,7 +2070,7 @@ var GuildTicket = class {
2043
2070
  url: route,
2044
2071
  payload
2045
2072
  });
2046
- return this._updateInternals(response);
2073
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn7).call(this, response);
2047
2074
  }
2048
2075
  async setClosedById(id) {
2049
2076
  const route = Routes.guilds.tickets.resource(this.guild.id, this._id, "closed_by_id");
@@ -2053,7 +2080,7 @@ var GuildTicket = class {
2053
2080
  url: route,
2054
2081
  payload
2055
2082
  });
2056
- return this._updateInternals(response);
2083
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn7).call(this, response);
2057
2084
  }
2058
2085
  async setStatus(status) {
2059
2086
  const route = Routes.guilds.tickets.resource(this.guild.id, this._id, "status");
@@ -2063,7 +2090,7 @@ var GuildTicket = class {
2063
2090
  url: route,
2064
2091
  payload
2065
2092
  });
2066
- return this._updateInternals(response);
2093
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn7).call(this, response);
2067
2094
  }
2068
2095
  async addMessage(message) {
2069
2096
  const route = Routes.guilds.tickets.resource(this.guild.id, this._id, "messages");
@@ -2073,25 +2100,28 @@ var GuildTicket = class {
2073
2100
  url: route,
2074
2101
  payload
2075
2102
  });
2076
- return this._updateInternals(response);
2077
- }
2078
- _updateInternals(data) {
2079
- for (let key in data) {
2080
- if (key === "id" || key === "createdAt") continue;
2081
- if (key in this) {
2082
- this[key] = data[key];
2083
- }
2084
- }
2085
- this.updatedAt = /* @__PURE__ */ new Date();
2086
- this.createdAt = new Date(data.createdAt);
2087
- this.manager.set(this);
2088
- return this;
2103
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn7).call(this, response);
2089
2104
  }
2090
2105
  };
2106
+ _GuildTicket_instances = new WeakSet();
2107
+ updateInternals_fn7 = function(data) {
2108
+ for (let key in data) {
2109
+ if (key === "id" || key === "createdAt") continue;
2110
+ if (key in this) {
2111
+ this[key] = data[key];
2112
+ }
2113
+ }
2114
+ this.updatedAt = /* @__PURE__ */ new Date();
2115
+ this.createdAt = new Date(data.createdAt);
2116
+ this.manager.set(this);
2117
+ return this;
2118
+ };
2091
2119
 
2092
2120
  // src/structures/minesgame/MinesGame.ts
2121
+ var _MinesGame_instances, updateInternals_fn8;
2093
2122
  var MinesGame = class {
2094
2123
  constructor(data, manager) {
2124
+ __privateAdd(this, _MinesGame_instances);
2095
2125
  __publicField(this, "guild_id");
2096
2126
  __publicField(this, "_id");
2097
2127
  __publicField(this, "creatorId");
@@ -2125,7 +2155,7 @@ var MinesGame = class {
2125
2155
  method: "GET",
2126
2156
  url: route
2127
2157
  });
2128
- return this._updateInternals(response);
2158
+ return __privateMethod(this, _MinesGame_instances, updateInternals_fn8).call(this, response);
2129
2159
  }
2130
2160
  async delete() {
2131
2161
  const route = `/${Routes.fields("minesgames", this._id)}`;
@@ -2133,7 +2163,7 @@ var MinesGame = class {
2133
2163
  method: "delete",
2134
2164
  url: route
2135
2165
  });
2136
- return this._updateInternals(response);
2166
+ return __privateMethod(this, _MinesGame_instances, updateInternals_fn8).call(this, response);
2137
2167
  }
2138
2168
  async update(data) {
2139
2169
  const route = `/${Routes.fields("minesgames", this._id)}`;
@@ -2142,25 +2172,27 @@ var MinesGame = class {
2142
2172
  url: route,
2143
2173
  payload: data
2144
2174
  });
2145
- return this._updateInternals(response);
2175
+ return __privateMethod(this, _MinesGame_instances, updateInternals_fn8).call(this, response);
2146
2176
  }
2147
- _updateInternals(data) {
2148
- for (let key in data) {
2149
- if (key === "id" || key === "createdAt") continue;
2150
- if (key in this) {
2151
- this[key] = data[key];
2152
- }
2177
+ };
2178
+ _MinesGame_instances = new WeakSet();
2179
+ updateInternals_fn8 = function(data) {
2180
+ for (let key in data) {
2181
+ if (key === "id" || key === "createdAt") continue;
2182
+ if (key in this) {
2183
+ this[key] = data[key];
2153
2184
  }
2154
- this.updatedAt = /* @__PURE__ */ new Date();
2155
- this.manager.set(this);
2156
- return this;
2157
2185
  }
2186
+ this.updatedAt = /* @__PURE__ */ new Date();
2187
+ this.manager.set(this);
2188
+ return this;
2158
2189
  };
2159
2190
 
2160
2191
  // src/structures/automaticmessage/AutomaticMessage.ts
2192
+ var _AutomaticMessage_instances, updateInternals_fn9;
2161
2193
  var AutomaticMessage = class {
2162
2194
  constructor(data, manager) {
2163
- __publicField(this, "_id");
2195
+ __privateAdd(this, _AutomaticMessage_instances);
2164
2196
  __publicField(this, "id");
2165
2197
  __publicField(this, "type");
2166
2198
  __publicField(this, "admin_id");
@@ -2179,7 +2211,6 @@ var AutomaticMessage = class {
2179
2211
  this.manager = manager;
2180
2212
  this.guild = manager.guild;
2181
2213
  this.rest = manager.rest;
2182
- this._id = data?._id;
2183
2214
  this.id = data?.id;
2184
2215
  this.type = data?.type;
2185
2216
  this.admin_id = data?.admin_id;
@@ -2194,12 +2225,7 @@ var AutomaticMessage = class {
2194
2225
  this.updatedAt = data?.updatedAt ? new Date(data?.updatedAt) : /* @__PURE__ */ new Date();
2195
2226
  }
2196
2227
  async fetch() {
2197
- const route = Routes.guilds.resource(this.guild.id, "automatic_messages", this._id);
2198
- const response = await this.rest.request({
2199
- method: "get",
2200
- url: route
2201
- });
2202
- return this._updateInternals(response);
2228
+ return this.manager.fetch(this.id);
2203
2229
  }
2204
2230
  async addChannelId(...id) {
2205
2231
  const ids = [.../* @__PURE__ */ new Set([...this.channel_ids, ...id])];
@@ -2211,39 +2237,28 @@ var AutomaticMessage = class {
2211
2237
  return this.update({ channel_ids: ids });
2212
2238
  }
2213
2239
  async update(data) {
2240
+ this.manager.cache.set(this.id, { ...this, ...data, id: this.id });
2214
2241
  const route = Routes.guilds.get(this.guild.id);
2215
2242
  const response = await this.rest.request({
2216
2243
  method: "patch",
2217
2244
  url: route,
2218
- payload: { automatic_messages: this.manager.cache.toArray() }
2245
+ payload: { automatic_messages: this.manager.toJSON() }
2219
2246
  });
2220
- return this._updateInternals(response);
2247
+ return __privateMethod(this, _AutomaticMessage_instances, updateInternals_fn9).call(this, response);
2221
2248
  }
2222
2249
  async delete() {
2223
- this.manager.cache.delete(this._id);
2250
+ this.manager.cache.delete(this.id);
2251
+ this.guild.automatic_messages = this.manager.cache.toArray();
2224
2252
  const route = Routes.guilds.get(this.guild.id);
2225
2253
  const response = await this.rest.request({
2226
2254
  method: "patch",
2227
2255
  url: route,
2228
- payload: { automatic_messages: this.manager.cache.toArray() }
2256
+ payload: { automatic_messages: this.manager.toJSON() }
2229
2257
  });
2230
2258
  return this.manager.set(response.automatic_messages);
2231
2259
  }
2232
- _updateInternals(data) {
2233
- for (let key in data) {
2234
- if (key === "_id" || key === "createdAt") continue;
2235
- if (key in this) {
2236
- this[key] = data[key];
2237
- }
2238
- }
2239
- this.updatedAt = /* @__PURE__ */ new Date();
2240
- this.createdAt = new Date(data.createdAt);
2241
- this.manager._add(this);
2242
- return this;
2243
- }
2244
2260
  toJSON() {
2245
2261
  return {
2246
- _id: this._id,
2247
2262
  id: this.id,
2248
2263
  type: this.type,
2249
2264
  admin_id: this.admin_id,
@@ -2259,6 +2274,20 @@ var AutomaticMessage = class {
2259
2274
  };
2260
2275
  }
2261
2276
  };
2277
+ _AutomaticMessage_instances = new WeakSet();
2278
+ updateInternals_fn9 = function(data) {
2279
+ const _this = data?.automatic_messages?.find((m) => m.id === this.id);
2280
+ for (let key in _this) {
2281
+ if (key === "id" || key === "createdAt") continue;
2282
+ if (key in this) {
2283
+ this[key] = _this[key];
2284
+ }
2285
+ }
2286
+ this.updatedAt = /* @__PURE__ */ new Date();
2287
+ this.createdAt = new Date(data.createdAt);
2288
+ this.manager._add(data.automatic_messages);
2289
+ return this;
2290
+ };
2262
2291
 
2263
2292
  // src/utils/randomKeyGenerator.ts
2264
2293
  var import_crypto = require("crypto");
@@ -2272,25 +2301,19 @@ var AutomaticMessageManager = class extends BaseManager {
2272
2301
  super(guild);
2273
2302
  this.guild = guild;
2274
2303
  this.rest = guild.rest;
2275
- this.base_url = Routes.guilds.resource(guild.id, "automatic_messages");
2304
+ this.base_url = Routes.guilds.resource(guild.id);
2276
2305
  this.cache = new Collection();
2277
2306
  if (guild.automatic_messages && guild.automatic_messages.length !== 0) this.set(guild.automatic_messages);
2278
2307
  else this.guild.automatic_messages = [];
2279
2308
  }
2280
2309
  async fetch(messageId) {
2281
2310
  const route = this.base_url;
2282
- if (messageId) {
2283
- const response2 = await this.rest.request({
2284
- method: "get",
2285
- url: `${route}`
2286
- });
2287
- return this._add(response2).find((m) => m.id === messageId);
2288
- }
2289
2311
  const response = await this.rest.request({
2290
2312
  method: "get",
2291
2313
  url: route
2292
2314
  });
2293
- return this._add(response.automatic_messages);
2315
+ this._add(response.automatic_messages);
2316
+ return this.cache;
2294
2317
  }
2295
2318
  async create(data) {
2296
2319
  if (!data.type) throw new Error(`Missing message's type.`);
@@ -2317,6 +2340,7 @@ var AutomaticMessageManager = class extends BaseManager {
2317
2340
  if (data instanceof AutomaticMessage) this.cache.set(data.id, data);
2318
2341
  else this.cache.set(data.id, new AutomaticMessage(data, this));
2319
2342
  }
2343
+ this.guild.automatic_messages = this.cache.toArray();
2320
2344
  return this.cache;
2321
2345
  }
2322
2346
  set(data) {
@@ -2345,6 +2369,10 @@ var AutomaticMessageManager = class extends BaseManager {
2345
2369
  });
2346
2370
  return response;
2347
2371
  }
2372
+ toJSON() {
2373
+ [...this.cache.values()].map((m) => console.log(m instanceof AutomaticMessage));
2374
+ return this.cache.toArray();
2375
+ }
2348
2376
  };
2349
2377
 
2350
2378
  // src/managers/bet/GuildBetManager.ts
@@ -2923,15 +2951,14 @@ var GuildTicketManager = class {
2923
2951
  } else {
2924
2952
  categories.push(data);
2925
2953
  }
2926
- const payload = { tickets_configuration: { categories } };
2927
- const route = Routes.guilds.get(this.guild.id);
2928
- const response = await this.rest.request({
2929
- method: "PATCH",
2930
- url: route,
2931
- payload
2954
+ return this.guild.update({
2955
+ tickets_configuration: {
2956
+ categories,
2957
+ creationCategory: this.guild.tickets_configuration.creationCategory,
2958
+ deletionCategory: this.guild.tickets_configuration.deletionCategory,
2959
+ rating_channel_id: this.guild.tickets_configuration.rating_channel_id
2960
+ }
2932
2961
  });
2933
- this.guild._updateInternals(response);
2934
- return response;
2935
2962
  }
2936
2963
  async deleteTicketCategory(data) {
2937
2964
  let categories = this.guild.tickets_configuration.categories;
@@ -2945,8 +2972,14 @@ var GuildTicketManager = class {
2945
2972
  url: route,
2946
2973
  payload
2947
2974
  });
2948
- this.guild._updateInternals(response);
2949
- return response;
2975
+ return this.guild.update({
2976
+ tickets_configuration: {
2977
+ categories,
2978
+ creationCategory: this.guild.tickets_configuration.creationCategory,
2979
+ deletionCategory: this.guild.tickets_configuration.deletionCategory,
2980
+ rating_channel_id: this.guild.tickets_configuration.rating_channel_id
2981
+ }
2982
+ });
2950
2983
  }
2951
2984
  async fetch(options) {
2952
2985
  if (options && options.cache) return this.cache;
@@ -3212,14 +3245,150 @@ var VipMemberManager = class extends BaseManager {
3212
3245
  }
3213
3246
  };
3214
3247
 
3248
+ // src/structures/tournament/Tournament.ts
3249
+ var _Tournament_instances, updateInternals_fn10;
3250
+ var Tournament = class {
3251
+ constructor(data, manager) {
3252
+ __privateAdd(this, _Tournament_instances);
3253
+ __publicField(this, "_id");
3254
+ __publicField(this, "guild_id");
3255
+ __publicField(this, "type");
3256
+ __publicField(this, "max_teams");
3257
+ __publicField(this, "teams");
3258
+ __publicField(this, "message");
3259
+ __publicField(this, "message_id");
3260
+ __publicField(this, "status");
3261
+ __publicField(this, "createdAt");
3262
+ __publicField(this, "updatedAt");
3263
+ __publicField(this, "guild");
3264
+ __publicField(this, "rest");
3265
+ __publicField(this, "manager");
3266
+ __publicField(this, "data");
3267
+ this.manager = manager;
3268
+ this.guild = manager.guild;
3269
+ this.rest = manager.rest;
3270
+ this.guild_id = data?.guild_id;
3271
+ this.type = data?.type;
3272
+ this.teams = data?.teams;
3273
+ this.message = data?.message;
3274
+ this.message_id = data?.message_id;
3275
+ this.status = data?.status;
3276
+ this.createdAt = data?.createdAt ? new Date(data?.createdAt) : /* @__PURE__ */ new Date();
3277
+ this.updatedAt = data?.updatedAt ? new Date(data?.updatedAt) : /* @__PURE__ */ new Date();
3278
+ this.data = data;
3279
+ }
3280
+ async fetch() {
3281
+ const route = Routes.fields("guilds", this.guild.id, "tournaments", this._id);
3282
+ const response = await this.rest.request({
3283
+ method: "get",
3284
+ url: route
3285
+ });
3286
+ return __privateMethod(this, _Tournament_instances, updateInternals_fn10).call(this, response);
3287
+ }
3288
+ async update(data) {
3289
+ const route = Routes.fields("guilds", this.guild.id, "tournaments", this._id);
3290
+ const response = await this.rest.request({
3291
+ method: "patch",
3292
+ url: route,
3293
+ payload: data
3294
+ });
3295
+ return __privateMethod(this, _Tournament_instances, updateInternals_fn10).call(this, response);
3296
+ }
3297
+ toJSON() {
3298
+ return {
3299
+ guild_id: this.guild_id,
3300
+ type: this.type,
3301
+ max_teams: this.max_teams,
3302
+ teams: this.teams,
3303
+ message: this.message,
3304
+ message_id: this.message_id,
3305
+ status: this.status,
3306
+ createdAt: this.createdAt ? new Date(this?.createdAt) : /* @__PURE__ */ new Date(),
3307
+ updatedAt: this.updatedAt ? new Date(this?.updatedAt) : /* @__PURE__ */ new Date()
3308
+ };
3309
+ }
3310
+ };
3311
+ _Tournament_instances = new WeakSet();
3312
+ updateInternals_fn10 = function(data) {
3313
+ for (let key in data) {
3314
+ if (key === "id" || key === "createdAt") continue;
3315
+ if (key in this) {
3316
+ this[key] = data[key];
3317
+ }
3318
+ }
3319
+ this.updatedAt = /* @__PURE__ */ new Date();
3320
+ this.createdAt = new Date(data.createdAt);
3321
+ this.manager._add(this);
3322
+ return this;
3323
+ };
3324
+
3325
+ // src/managers/tournament/TournamentManager.ts
3326
+ var TournamentManager = class extends BaseManager {
3327
+ constructor(guild) {
3328
+ super(guild);
3329
+ this.guild = guild;
3330
+ this.rest = guild.rest;
3331
+ this.base_url = Routes.guilds.resource(guild.id, "tournaments");
3332
+ this.cache = new Collection();
3333
+ }
3334
+ async fetch(options) {
3335
+ if (options && options.cache) return this.cache;
3336
+ if (options && options.tournamentId) {
3337
+ const response2 = await this.rest.request({
3338
+ method: "GET",
3339
+ url: Routes.fields(this.base_url, options.tournamentId)
3340
+ });
3341
+ const tournament = new Tournament(response2, this);
3342
+ this._add(tournament);
3343
+ return tournament;
3344
+ }
3345
+ const response = await this.rest.request({
3346
+ method: "GET",
3347
+ url: this.base_url
3348
+ });
3349
+ return this.set(response);
3350
+ }
3351
+ set(data) {
3352
+ this.cache.clear();
3353
+ if (Array.isArray(data)) {
3354
+ for (let _m of data) {
3355
+ if (!_m._id) continue;
3356
+ if (_m instanceof Tournament) this.cache.set(_m._id, _m);
3357
+ else this.cache.set(_m._id, new Tournament(_m, this));
3358
+ }
3359
+ } else {
3360
+ if (!data._id) return this.cache;
3361
+ if (data instanceof Tournament) this.cache.set(data._id, data);
3362
+ else this.cache.set(data._id, new Tournament(data, this));
3363
+ }
3364
+ return this.cache;
3365
+ }
3366
+ _add(data) {
3367
+ if (Array.isArray(data)) {
3368
+ for (let _m of data) {
3369
+ if (!_m._id) continue;
3370
+ if (_m instanceof Tournament) this.cache.set(_m._id, _m);
3371
+ else this.cache.set(_m._id, new Tournament(_m, this));
3372
+ }
3373
+ } else {
3374
+ if (!data._id) return this.cache;
3375
+ if (data instanceof Tournament) this.cache.set(data._id, data);
3376
+ else this.cache.set(data._id, new Tournament(data, this));
3377
+ }
3378
+ return this.cache;
3379
+ }
3380
+ };
3381
+
3215
3382
  // src/structures/guild/Guild.ts
3216
- var Guild6 = class {
3383
+ var _Guild_instances, updateInternals_fn11;
3384
+ var Guild7 = class {
3217
3385
  /**
3218
3386
  * The guild structure
3219
3387
  * @param data The guild's data
3220
3388
  * @param rest The rest client
3221
3389
  */
3222
3390
  constructor(data, rest) {
3391
+ __privateAdd(this, _Guild_instances);
3223
3392
  /** The data of this guild */
3224
3393
  __publicField(this, "data");
3225
3394
  /** The rest client */
@@ -3245,6 +3414,7 @@ var Guild6 = class {
3245
3414
  __publicField(this, "roulette_settings");
3246
3415
  /** Guild Prefix */
3247
3416
  __publicField(this, "prefix");
3417
+ __publicField(this, "prefixes");
3248
3418
  /** Guild Creation Date */
3249
3419
  __publicField(this, "createdAt");
3250
3420
  /** Guild Updated Date */
@@ -3264,6 +3434,7 @@ var Guild6 = class {
3264
3434
  __publicField(this, "mediators");
3265
3435
  __publicField(this, "automatic_messages");
3266
3436
  __publicField(this, "automaticMessagesManager");
3437
+ __publicField(this, "tournaments");
3267
3438
  __publicField(this, "adverts");
3268
3439
  __publicField(this, "codes");
3269
3440
  __publicField(this, "coin_symbol");
@@ -3278,6 +3449,7 @@ var Guild6 = class {
3278
3449
  this.scores = data?.scores;
3279
3450
  this.codes = data?.codes;
3280
3451
  this.prefix = data?.prefix;
3452
+ this.prefixes = data?.prefixes;
3281
3453
  this.status = data?.status;
3282
3454
  this.tickets_configuration = data?.tickets_configuration;
3283
3455
  this.automatic_messages = data?.automatic_messages;
@@ -3298,6 +3470,7 @@ var Guild6 = class {
3298
3470
  this.bets = new GuildBetManager2(this);
3299
3471
  this.mediators = new GuildMediatorManager(this);
3300
3472
  this.automaticMessagesManager = new AutomaticMessageManager(this);
3473
+ this.tournaments = new TournamentManager(this);
3301
3474
  this.adverts = [];
3302
3475
  for (let _adv of data?.adverts || []) {
3303
3476
  this.adverts.push({
@@ -3334,7 +3507,7 @@ var Guild6 = class {
3334
3507
  url: route,
3335
3508
  payload: { channels }
3336
3509
  });
3337
- this._updateInternals(response);
3510
+ __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3338
3511
  return response.channels.find((t) => t.type === type);
3339
3512
  }
3340
3513
  }
@@ -3349,7 +3522,7 @@ var Guild6 = class {
3349
3522
  url: route,
3350
3523
  payload: { permissions }
3351
3524
  });
3352
- this._updateInternals(response);
3525
+ __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3353
3526
  return response.permissions.find((t) => t.type === type);
3354
3527
  }
3355
3528
  }
@@ -3358,26 +3531,26 @@ var Guild6 = class {
3358
3531
  const route = Routes.guilds.get(this.id);
3359
3532
  const payload = { adverts: this.adverts };
3360
3533
  const response = await this.rest.request({ method: "PATCH", url: route, payload });
3361
- return this._updateInternals(response);
3534
+ return __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3362
3535
  }
3363
3536
  async removeAdvert(advertId) {
3364
3537
  const route = Routes.guilds.get(this.id);
3365
3538
  const payload = { adverts: this.adverts.filter((a) => a._id !== advertId) };
3366
3539
  const response = await this.rest.request({ method: "PATCH", url: route, payload });
3367
- return this._updateInternals(response);
3540
+ return __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3368
3541
  }
3369
3542
  async createCode(data) {
3370
3543
  this.codes.push(data);
3371
3544
  const route = Routes.guilds.get(this.id);
3372
3545
  const payload = { codes: this.codes };
3373
3546
  const response = await this.rest.request({ method: "PATCH", url: route, payload });
3374
- return this._updateInternals(response);
3547
+ return __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3375
3548
  }
3376
3549
  async removeCode(codeId) {
3377
3550
  const route = Routes.guilds.get(this.id);
3378
3551
  const payload = { codes: this.codes.filter((a) => a._id !== codeId) };
3379
3552
  const response = await this.rest.request({ method: "PATCH", url: route, payload });
3380
- return this._updateInternals(response);
3553
+ return __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3381
3554
  }
3382
3555
  async addIdToChannel(type, id) {
3383
3556
  const channel = this.channels.find((c) => c.type === type);
@@ -3396,7 +3569,7 @@ var Guild6 = class {
3396
3569
  url: route,
3397
3570
  payload
3398
3571
  });
3399
- return this._updateInternals(response);
3572
+ return __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3400
3573
  }
3401
3574
  async setChannelIds(type, ...ids) {
3402
3575
  const channel = this.channels.find((c) => c.type === type);
@@ -3415,7 +3588,7 @@ var Guild6 = class {
3415
3588
  url: route,
3416
3589
  payload
3417
3590
  });
3418
- return this._updateInternals(response);
3591
+ return __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3419
3592
  }
3420
3593
  async removeIdInChannel(type, id) {
3421
3594
  const chIndex = this.channels.findIndex((c) => c.type === type);
@@ -3437,7 +3610,7 @@ var Guild6 = class {
3437
3610
  url: route,
3438
3611
  payload
3439
3612
  });
3440
- return this._updateInternals(response);
3613
+ return __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3441
3614
  }
3442
3615
  async updateRouletteSettings(data) {
3443
3616
  const _data = {
@@ -3494,58 +3667,21 @@ var Guild6 = class {
3494
3667
  this.logEntries.fetch(),
3495
3668
  this.betusers.fetch(),
3496
3669
  this.bets.fetch(),
3497
- this.mediators.fetch()
3670
+ this.mediators.fetch(),
3671
+ this.tournaments.fetch()
3498
3672
  ]);
3499
3673
  return this;
3500
3674
  }
3501
- _updateInternals(data) {
3502
- for (let key in data) {
3503
- if (key === "id" || key === "createdAt") continue;
3504
- if (key in this) {
3505
- this[key] = data[key];
3506
- }
3507
- if (key === "adverts") {
3508
- this.adverts = [];
3509
- for (let _adv of data.adverts) {
3510
- this.adverts.push({
3511
- _id: _adv._id,
3512
- admin_id: _adv.admin_id,
3513
- points_to_remove: _adv.points_to_remove,
3514
- role_id: _adv.role_id,
3515
- createdAt: _adv.createdAt ? new Date(_adv.createdAt) : /* @__PURE__ */ new Date(),
3516
- updatedAt: _adv.updatedAt ? new Date(_adv.updatedAt) : /* @__PURE__ */ new Date()
3517
- });
3518
- }
3519
- }
3520
- if (key === "code") {
3521
- this.codes = [];
3522
- for (let _adv of data.codes) {
3523
- this.codes.push({
3524
- _id: _adv._id,
3525
- admin_id: _adv.admin_id,
3526
- type: _adv.type,
3527
- add: _adv.add,
3528
- code: _adv.code,
3529
- expire: _adv.expire ? new Date(_adv.expire) : /* @__PURE__ */ new Date(),
3530
- createdAt: _adv.createdAt ? new Date(_adv.createdAt) : /* @__PURE__ */ new Date(),
3531
- updatedAt: _adv.updatedAt ? new Date(_adv.updatedAt) : /* @__PURE__ */ new Date()
3532
- });
3533
- }
3534
- }
3535
- }
3536
- this.automaticMessagesManager.set(this.automatic_messages);
3537
- this.updatedAt = /* @__PURE__ */ new Date();
3538
- this.rest.guilds.cache.set(this.id, this);
3539
- this.rest.emit("guildUpdate", this);
3540
- return this;
3541
- }
3542
3675
  async fetch() {
3543
3676
  const route = Routes.guilds.get(this.id);
3544
3677
  const response = await this.rest.request({
3545
3678
  method: "get",
3546
3679
  url: route
3547
3680
  });
3548
- return this._updateInternals(response);
3681
+ return __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3682
+ }
3683
+ async reset() {
3684
+ return this.update({ reset: true });
3549
3685
  }
3550
3686
  async update(data) {
3551
3687
  const route = Routes.guilds.get(this.id);
@@ -3554,16 +3690,7 @@ var Guild6 = class {
3554
3690
  url: route,
3555
3691
  payload: data
3556
3692
  });
3557
- for (const k in response) {
3558
- if (k === "id" || k == "createdAt") continue;
3559
- if (k in this) {
3560
- this[k] = response[k];
3561
- }
3562
- }
3563
- this.updatedAt = /* @__PURE__ */ new Date();
3564
- this.rest.guilds.cache.set(this.id, this);
3565
- this.rest.emit("guildUpdate", this);
3566
- return this;
3693
+ return __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3567
3694
  }
3568
3695
  async setStatus(key, status) {
3569
3696
  Assertion.assertString(key);
@@ -3588,16 +3715,27 @@ var Guild6 = class {
3588
3715
  await this.update({ prices: this.prices });
3589
3716
  return this;
3590
3717
  }
3591
- async setPrefix(prefix) {
3592
- Assertion.assertString(prefix);
3593
- const route = Routes.fields(Routes.guilds.resource(this.id, "prefix"));
3594
- const payload = { set: prefix };
3718
+ async addPrefix(prefixes) {
3719
+ const route = Routes.fields(Routes.guilds.resource(this.id, "prefixes"));
3720
+ const _p = Array.isArray(prefixes) ? prefixes : [prefixes];
3721
+ const payload = { set: [.../* @__PURE__ */ new Set([...this.prefixes, ..._p])] };
3722
+ const response = await this.rest.request({
3723
+ method: "PATCH",
3724
+ url: route,
3725
+ payload
3726
+ });
3727
+ __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3728
+ return this;
3729
+ }
3730
+ async setPrefix(prefixes) {
3731
+ const route = Routes.fields(Routes.guilds.resource(this.id, "prefixes"));
3732
+ const payload = { set: Array.isArray(prefixes) ? prefixes : [prefixes] };
3595
3733
  const response = await this.rest.request({
3596
3734
  method: "PATCH",
3597
3735
  url: route,
3598
3736
  payload
3599
3737
  });
3600
- this._updateInternals(response);
3738
+ __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3601
3739
  return this;
3602
3740
  }
3603
3741
  async toggleDailyCategory(category) {
@@ -3617,7 +3755,7 @@ var Guild6 = class {
3617
3755
  url: route,
3618
3756
  payload
3619
3757
  });
3620
- this._updateInternals(response);
3758
+ __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3621
3759
  return this;
3622
3760
  }
3623
3761
  async setScores(name, amount) {
@@ -3630,7 +3768,7 @@ var Guild6 = class {
3630
3768
  url: route,
3631
3769
  payload
3632
3770
  });
3633
- this._updateInternals(response);
3771
+ __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3634
3772
  return this;
3635
3773
  }
3636
3774
  async toggleMode(mode) {
@@ -3655,10 +3793,52 @@ var Guild6 = class {
3655
3793
  url: route,
3656
3794
  payload
3657
3795
  });
3658
- this._updateInternals(response);
3796
+ __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3659
3797
  return this;
3660
3798
  }
3661
3799
  };
3800
+ _Guild_instances = new WeakSet();
3801
+ updateInternals_fn11 = function(data) {
3802
+ for (let key in data) {
3803
+ if (key === "id" || key === "createdAt") continue;
3804
+ if (key in this) {
3805
+ this[key] = data[key];
3806
+ }
3807
+ if (key === "adverts") {
3808
+ this.adverts = [];
3809
+ for (let _adv of data.adverts) {
3810
+ this.adverts.push({
3811
+ _id: _adv._id,
3812
+ admin_id: _adv.admin_id,
3813
+ points_to_remove: _adv.points_to_remove,
3814
+ role_id: _adv.role_id,
3815
+ createdAt: _adv.createdAt ? new Date(_adv.createdAt) : /* @__PURE__ */ new Date(),
3816
+ updatedAt: _adv.updatedAt ? new Date(_adv.updatedAt) : /* @__PURE__ */ new Date()
3817
+ });
3818
+ }
3819
+ }
3820
+ if (key === "code") {
3821
+ this.codes = [];
3822
+ for (let _adv of data.codes) {
3823
+ this.codes.push({
3824
+ _id: _adv._id,
3825
+ admin_id: _adv.admin_id,
3826
+ type: _adv.type,
3827
+ add: _adv.add,
3828
+ code: _adv.code,
3829
+ expire: _adv.expire ? new Date(_adv.expire) : /* @__PURE__ */ new Date(),
3830
+ createdAt: _adv.createdAt ? new Date(_adv.createdAt) : /* @__PURE__ */ new Date(),
3831
+ updatedAt: _adv.updatedAt ? new Date(_adv.updatedAt) : /* @__PURE__ */ new Date()
3832
+ });
3833
+ }
3834
+ }
3835
+ }
3836
+ this.automaticMessagesManager.set(this.automatic_messages);
3837
+ this.updatedAt = /* @__PURE__ */ new Date();
3838
+ this.rest.guilds.cache.set(this.id, this);
3839
+ this.rest.emit("guildUpdate", this);
3840
+ return this;
3841
+ };
3662
3842
 
3663
3843
  // src/managers/guild/GuildManager.ts
3664
3844
  var GuildManager = class {
@@ -3688,7 +3868,7 @@ var GuildManager = class {
3688
3868
  method: "get",
3689
3869
  url: route2
3690
3870
  });
3691
- const guild = new Guild6(response2, this.rest);
3871
+ const guild = new Guild7(response2, this.rest);
3692
3872
  await guild._start().then((g) => {
3693
3873
  this.cache.set(g.id, g);
3694
3874
  });
@@ -3702,13 +3882,22 @@ var GuildManager = class {
3702
3882
  });
3703
3883
  for (let _guild of response) {
3704
3884
  if (!_guild.id) continue;
3705
- const guild = new Guild6(_guild, this.rest);
3885
+ const guild = new Guild7(_guild, this.rest);
3706
3886
  await guild._start().then((g) => {
3707
3887
  this.cache.set(g.id, g);
3708
3888
  });
3709
3889
  }
3710
3890
  return this.cache;
3711
3891
  }
3892
+ async reset(guildId) {
3893
+ if (guildId) {
3894
+ return await this.cache.get(guildId).reset();
3895
+ }
3896
+ for (let [_, g] of this.cache) {
3897
+ await g.reset();
3898
+ }
3899
+ return this.cache;
3900
+ }
3712
3901
  async delete(options) {
3713
3902
  if (options && options.guildId) {
3714
3903
  Assertion.assertString(options.guildId);
@@ -3735,12 +3924,12 @@ var GuildManager = class {
3735
3924
  if (!data) return this.cache;
3736
3925
  if (Array.isArray(data)) {
3737
3926
  for (let _guild of data) {
3738
- const guild = new Guild6(_guild, this.rest);
3927
+ const guild = new Guild7(_guild, this.rest);
3739
3928
  this.cache.set(guild.id, guild);
3740
3929
  }
3741
3930
  return this.cache;
3742
3931
  } else {
3743
- const guild = new Guild6(data, this.rest);
3932
+ const guild = new Guild7(data, this.rest);
3744
3933
  this.cache.set(guild.id, guild);
3745
3934
  return guild;
3746
3935
  }
@@ -3754,7 +3943,7 @@ var FgGreen = "\x1B[32m";
3754
3943
  var FgRed = "\x1B[31m";
3755
3944
  var FgBlue = "\x1B[34m";
3756
3945
  var FgCyan = "\x1B[36m";
3757
- var REST8 = class extends import_events.default {
3946
+ var REST9 = class extends import_events.default {
3758
3947
  /**
3759
3948
  *
3760
3949
  * @param key The unique key for he client