@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
package/dist/index.mjs CHANGED
@@ -493,6 +493,9 @@ var BaseManager = class {
493
493
  this.rest = guild.rest;
494
494
  this.cache = new Collection();
495
495
  }
496
+ toJSON() {
497
+ return [...this.cache.values()].map((m) => m && "toJSON" in m && typeof m.toJSON === "function" ? m.toJSON() : m);
498
+ }
496
499
  };
497
500
 
498
501
  // src/managers/player/PlayerManager.ts
@@ -579,7 +582,7 @@ var APIEndpoints = {
579
582
  // src/rest/Routes.ts
580
583
  var Routes = {
581
584
  //base: "http://localhost:80/api/v1",
582
- base: "https://duque-api.up.railway.app/api/v1",
585
+ base: "https://duqueapi.shardweb.app/api/v1",
583
586
  field: (field) => `/${field}`,
584
587
  fields: (...fields) => `${fields.join("/")}`,
585
588
  guilds: {
@@ -736,7 +739,8 @@ var Assertion = class {
736
739
  import { request, Headers } from "undici";
737
740
 
738
741
  // src/structures/betuser/GuildBetUser.ts
739
- var GuildBetUser = class _GuildBetUser {
742
+ var _GuildBetUser_instances, updateInternals_fn;
743
+ var _GuildBetUser = class _GuildBetUser {
740
744
  /**
741
745
  * Bet user
742
746
  * @param data The user's data
@@ -744,6 +748,7 @@ var GuildBetUser = class _GuildBetUser {
744
748
  * @param rest The rest client
745
749
  */
746
750
  constructor(data, manager) {
751
+ __privateAdd(this, _GuildBetUser_instances);
747
752
  /** User daily */
748
753
  __publicField(this, "daily");
749
754
  __publicField(this, "profile");
@@ -838,7 +843,7 @@ var GuildBetUser = class _GuildBetUser {
838
843
  url: route,
839
844
  payload
840
845
  });
841
- return this._updateInternals(response);
846
+ return __privateMethod(this, _GuildBetUser_instances, updateInternals_fn).call(this, response);
842
847
  }
843
848
  async updateProfile(data) {
844
849
  const _data = {
@@ -858,20 +863,7 @@ var GuildBetUser = class _GuildBetUser {
858
863
  url: route,
859
864
  payload: _data
860
865
  });
861
- return this._updateInternals(response);
862
- }
863
- _updateInternals(data) {
864
- for (let key in data) {
865
- if (key === "id" || key === "createdAt") continue;
866
- if (key in this) {
867
- this[key] = data[key];
868
- }
869
- }
870
- this.updatedAt = /* @__PURE__ */ new Date();
871
- this.createdAt = new Date(data.createdAt);
872
- this.manager.set(this);
873
- this.rest.emit("betuserUpdate", this);
874
- return this;
866
+ return __privateMethod(this, _GuildBetUser_instances, updateInternals_fn).call(this, response);
875
867
  }
876
868
  /**
877
869
  * Update certain property
@@ -908,7 +900,7 @@ var GuildBetUser = class _GuildBetUser {
908
900
  url: route,
909
901
  payload
910
902
  });
911
- return this._updateInternals(response);
903
+ return __privateMethod(this, _GuildBetUser_instances, updateInternals_fn).call(this, response);
912
904
  }
913
905
  async _update(data) {
914
906
  const route = Routes.guilds.betusers.get(this.manager.guild.id, this.id);
@@ -918,7 +910,7 @@ var GuildBetUser = class _GuildBetUser {
918
910
  url: route,
919
911
  payload
920
912
  });
921
- return this._updateInternals(response);
913
+ return __privateMethod(this, _GuildBetUser_instances, updateInternals_fn).call(this, response);
922
914
  }
923
915
  async delete() {
924
916
  const route = Routes.guilds.betusers.delete(this.manager.guild.id, this.id);
@@ -942,6 +934,21 @@ var GuildBetUser = class _GuildBetUser {
942
934
  return json;
943
935
  }
944
936
  };
937
+ _GuildBetUser_instances = new WeakSet();
938
+ updateInternals_fn = function(data) {
939
+ for (let key in data) {
940
+ if (key === "id" || key === "createdAt") continue;
941
+ if (key in this) {
942
+ this[key] = data[key];
943
+ }
944
+ }
945
+ this.updatedAt = /* @__PURE__ */ new Date();
946
+ this.createdAt = new Date(data.createdAt);
947
+ this.manager.set(this);
948
+ this.rest.emit("betuserUpdate", this);
949
+ return this;
950
+ };
951
+ var GuildBetUser = _GuildBetUser;
945
952
 
946
953
  // src/managers/betuser/GuildBetUserManager.ts
947
954
  var GuildBetUserManager = class extends BaseManager {
@@ -1019,7 +1026,8 @@ var GuildBetUserManager = class extends BaseManager {
1019
1026
  };
1020
1027
 
1021
1028
  // src/structures/mediator/GuildMediator.ts
1022
- var GuildMediator = class _GuildMediator {
1029
+ var _GuildMediator_instances, updateInternals_fn2;
1030
+ var _GuildMediator = class _GuildMediator {
1023
1031
  /**
1024
1032
  * Bet user
1025
1033
  * @param data The user's data
@@ -1027,6 +1035,7 @@ var GuildMediator = class _GuildMediator {
1027
1035
  * @param rest The rest client
1028
1036
  */
1029
1037
  constructor(data, manager) {
1038
+ __privateAdd(this, _GuildMediator_instances);
1030
1039
  /** User's name */
1031
1040
  __publicField(this, "id");
1032
1041
  __publicField(this, "guild_id");
@@ -1085,19 +1094,7 @@ var GuildMediator = class _GuildMediator {
1085
1094
  url: route,
1086
1095
  payload
1087
1096
  });
1088
- return this._updateInternals(response);
1089
- }
1090
- _updateInternals(data) {
1091
- for (let key in data) {
1092
- if (key === "id" || key === "createdAt") continue;
1093
- if (key in this) {
1094
- this[key] = data[key];
1095
- }
1096
- }
1097
- this.updatedAt = /* @__PURE__ */ new Date();
1098
- this.createdAt = new Date(data.createdAt);
1099
- this.manager.set(this);
1100
- return this;
1097
+ return __privateMethod(this, _GuildMediator_instances, updateInternals_fn2).call(this, response);
1101
1098
  }
1102
1099
  /**
1103
1100
  * Update certain property
@@ -1112,7 +1109,7 @@ var GuildMediator = class _GuildMediator {
1112
1109
  url: route,
1113
1110
  payload
1114
1111
  });
1115
- return this._updateInternals(response);
1112
+ return __privateMethod(this, _GuildMediator_instances, updateInternals_fn2).call(this, response);
1116
1113
  }
1117
1114
  async setPaymentlink(type, link) {
1118
1115
  const route = Routes.guilds.mediators.get(this.manager.guild.id, this.id);
@@ -1122,7 +1119,7 @@ var GuildMediator = class _GuildMediator {
1122
1119
  url: route,
1123
1120
  payload
1124
1121
  });
1125
- return this._updateInternals(response);
1122
+ return __privateMethod(this, _GuildMediator_instances, updateInternals_fn2).call(this, response);
1126
1123
  }
1127
1124
  async delete() {
1128
1125
  const route = Routes.guilds.mediators.delete(this.manager.guild.id, this.id);
@@ -1145,6 +1142,20 @@ var GuildMediator = class _GuildMediator {
1145
1142
  return json;
1146
1143
  }
1147
1144
  };
1145
+ _GuildMediator_instances = new WeakSet();
1146
+ updateInternals_fn2 = function(data) {
1147
+ for (let key in data) {
1148
+ if (key === "id" || key === "createdAt") continue;
1149
+ if (key in this) {
1150
+ this[key] = data[key];
1151
+ }
1152
+ }
1153
+ this.updatedAt = /* @__PURE__ */ new Date();
1154
+ this.createdAt = new Date(data.createdAt);
1155
+ this.manager.set(this);
1156
+ return this;
1157
+ };
1158
+ var GuildMediator = _GuildMediator;
1148
1159
 
1149
1160
  // src/managers/mediator/GuildMediatorManager.ts
1150
1161
  var GuildMediatorManager = class extends BaseManager {
@@ -1229,14 +1240,150 @@ var GuildMediatorManager = class extends BaseManager {
1229
1240
  }
1230
1241
  };
1231
1242
 
1243
+ // src/structures/tournament/Tournament.ts
1244
+ var _Tournament_instances, updateInternals_fn3;
1245
+ var Tournament = class {
1246
+ constructor(data, manager) {
1247
+ __privateAdd(this, _Tournament_instances);
1248
+ __publicField(this, "_id");
1249
+ __publicField(this, "guild_id");
1250
+ __publicField(this, "type");
1251
+ __publicField(this, "max_teams");
1252
+ __publicField(this, "teams");
1253
+ __publicField(this, "message");
1254
+ __publicField(this, "message_id");
1255
+ __publicField(this, "status");
1256
+ __publicField(this, "createdAt");
1257
+ __publicField(this, "updatedAt");
1258
+ __publicField(this, "guild");
1259
+ __publicField(this, "rest");
1260
+ __publicField(this, "manager");
1261
+ __publicField(this, "data");
1262
+ this.manager = manager;
1263
+ this.guild = manager.guild;
1264
+ this.rest = manager.rest;
1265
+ this.guild_id = data?.guild_id;
1266
+ this.type = data?.type;
1267
+ this.teams = data?.teams;
1268
+ this.message = data?.message;
1269
+ this.message_id = data?.message_id;
1270
+ this.status = data?.status;
1271
+ this.createdAt = data?.createdAt ? new Date(data?.createdAt) : /* @__PURE__ */ new Date();
1272
+ this.updatedAt = data?.updatedAt ? new Date(data?.updatedAt) : /* @__PURE__ */ new Date();
1273
+ this.data = data;
1274
+ }
1275
+ async fetch() {
1276
+ const route = Routes.fields("guilds", this.guild.id, "tournaments", this._id);
1277
+ const response = await this.rest.request({
1278
+ method: "get",
1279
+ url: route
1280
+ });
1281
+ return __privateMethod(this, _Tournament_instances, updateInternals_fn3).call(this, response);
1282
+ }
1283
+ async update(data) {
1284
+ const route = Routes.fields("guilds", this.guild.id, "tournaments", this._id);
1285
+ const response = await this.rest.request({
1286
+ method: "patch",
1287
+ url: route,
1288
+ payload: data
1289
+ });
1290
+ return __privateMethod(this, _Tournament_instances, updateInternals_fn3).call(this, response);
1291
+ }
1292
+ toJSON() {
1293
+ return {
1294
+ guild_id: this.guild_id,
1295
+ type: this.type,
1296
+ max_teams: this.max_teams,
1297
+ teams: this.teams,
1298
+ message: this.message,
1299
+ message_id: this.message_id,
1300
+ status: this.status,
1301
+ createdAt: this.createdAt ? new Date(this?.createdAt) : /* @__PURE__ */ new Date(),
1302
+ updatedAt: this.updatedAt ? new Date(this?.updatedAt) : /* @__PURE__ */ new Date()
1303
+ };
1304
+ }
1305
+ };
1306
+ _Tournament_instances = new WeakSet();
1307
+ updateInternals_fn3 = function(data) {
1308
+ for (let key in data) {
1309
+ if (key === "id" || key === "createdAt") continue;
1310
+ if (key in this) {
1311
+ this[key] = data[key];
1312
+ }
1313
+ }
1314
+ this.updatedAt = /* @__PURE__ */ new Date();
1315
+ this.createdAt = new Date(data.createdAt);
1316
+ this.manager._add(this);
1317
+ return this;
1318
+ };
1319
+
1320
+ // src/managers/tournament/TournamentManager.ts
1321
+ var TournamentManager = class extends BaseManager {
1322
+ constructor(guild) {
1323
+ super(guild);
1324
+ this.guild = guild;
1325
+ this.rest = guild.rest;
1326
+ this.base_url = Routes.guilds.resource(guild.id, "tournaments");
1327
+ this.cache = new Collection();
1328
+ }
1329
+ async fetch(options) {
1330
+ if (options && options.cache) return this.cache;
1331
+ if (options && options.tournamentId) {
1332
+ const response2 = await this.rest.request({
1333
+ method: "GET",
1334
+ url: Routes.fields(this.base_url, options.tournamentId)
1335
+ });
1336
+ const tournament = new Tournament(response2, this);
1337
+ this._add(tournament);
1338
+ return tournament;
1339
+ }
1340
+ const response = await this.rest.request({
1341
+ method: "GET",
1342
+ url: this.base_url
1343
+ });
1344
+ return this.set(response);
1345
+ }
1346
+ set(data) {
1347
+ this.cache.clear();
1348
+ if (Array.isArray(data)) {
1349
+ for (let _m of data) {
1350
+ if (!_m._id) continue;
1351
+ if (_m instanceof Tournament) this.cache.set(_m._id, _m);
1352
+ else this.cache.set(_m._id, new Tournament(_m, this));
1353
+ }
1354
+ } else {
1355
+ if (!data._id) return this.cache;
1356
+ if (data instanceof Tournament) this.cache.set(data._id, data);
1357
+ else this.cache.set(data._id, new Tournament(data, this));
1358
+ }
1359
+ return this.cache;
1360
+ }
1361
+ _add(data) {
1362
+ if (Array.isArray(data)) {
1363
+ for (let _m of data) {
1364
+ if (!_m._id) continue;
1365
+ if (_m instanceof Tournament) this.cache.set(_m._id, _m);
1366
+ else this.cache.set(_m._id, new Tournament(_m, this));
1367
+ }
1368
+ } else {
1369
+ if (!data._id) return this.cache;
1370
+ if (data instanceof Tournament) this.cache.set(data._id, data);
1371
+ else this.cache.set(data._id, new Tournament(data, this));
1372
+ }
1373
+ return this.cache;
1374
+ }
1375
+ };
1376
+
1232
1377
  // src/structures/guild/Guild.ts
1233
- var Guild2 = class {
1378
+ var _Guild_instances, updateInternals_fn4;
1379
+ var Guild3 = class {
1234
1380
  /**
1235
1381
  * The guild structure
1236
1382
  * @param data The guild's data
1237
1383
  * @param rest The rest client
1238
1384
  */
1239
1385
  constructor(data, rest) {
1386
+ __privateAdd(this, _Guild_instances);
1240
1387
  /** The data of this guild */
1241
1388
  __publicField(this, "data");
1242
1389
  /** The rest client */
@@ -1262,6 +1409,7 @@ var Guild2 = class {
1262
1409
  __publicField(this, "roulette_settings");
1263
1410
  /** Guild Prefix */
1264
1411
  __publicField(this, "prefix");
1412
+ __publicField(this, "prefixes");
1265
1413
  /** Guild Creation Date */
1266
1414
  __publicField(this, "createdAt");
1267
1415
  /** Guild Updated Date */
@@ -1281,6 +1429,7 @@ var Guild2 = class {
1281
1429
  __publicField(this, "mediators");
1282
1430
  __publicField(this, "automatic_messages");
1283
1431
  __publicField(this, "automaticMessagesManager");
1432
+ __publicField(this, "tournaments");
1284
1433
  __publicField(this, "adverts");
1285
1434
  __publicField(this, "codes");
1286
1435
  __publicField(this, "coin_symbol");
@@ -1295,6 +1444,7 @@ var Guild2 = class {
1295
1444
  this.scores = data?.scores;
1296
1445
  this.codes = data?.codes;
1297
1446
  this.prefix = data?.prefix;
1447
+ this.prefixes = data?.prefixes;
1298
1448
  this.status = data?.status;
1299
1449
  this.tickets_configuration = data?.tickets_configuration;
1300
1450
  this.automatic_messages = data?.automatic_messages;
@@ -1315,6 +1465,7 @@ var Guild2 = class {
1315
1465
  this.bets = new GuildBetManager(this);
1316
1466
  this.mediators = new GuildMediatorManager(this);
1317
1467
  this.automaticMessagesManager = new AutomaticMessageManager(this);
1468
+ this.tournaments = new TournamentManager(this);
1318
1469
  this.adverts = [];
1319
1470
  for (let _adv of data?.adverts || []) {
1320
1471
  this.adverts.push({
@@ -1351,7 +1502,7 @@ var Guild2 = class {
1351
1502
  url: route,
1352
1503
  payload: { channels }
1353
1504
  });
1354
- this._updateInternals(response);
1505
+ __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1355
1506
  return response.channels.find((t) => t.type === type);
1356
1507
  }
1357
1508
  }
@@ -1366,7 +1517,7 @@ var Guild2 = class {
1366
1517
  url: route,
1367
1518
  payload: { permissions }
1368
1519
  });
1369
- this._updateInternals(response);
1520
+ __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1370
1521
  return response.permissions.find((t) => t.type === type);
1371
1522
  }
1372
1523
  }
@@ -1375,26 +1526,26 @@ var Guild2 = class {
1375
1526
  const route = Routes.guilds.get(this.id);
1376
1527
  const payload = { adverts: this.adverts };
1377
1528
  const response = await this.rest.request({ method: "PATCH", url: route, payload });
1378
- return this._updateInternals(response);
1529
+ return __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1379
1530
  }
1380
1531
  async removeAdvert(advertId) {
1381
1532
  const route = Routes.guilds.get(this.id);
1382
1533
  const payload = { adverts: this.adverts.filter((a) => a._id !== advertId) };
1383
1534
  const response = await this.rest.request({ method: "PATCH", url: route, payload });
1384
- return this._updateInternals(response);
1535
+ return __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1385
1536
  }
1386
1537
  async createCode(data) {
1387
1538
  this.codes.push(data);
1388
1539
  const route = Routes.guilds.get(this.id);
1389
1540
  const payload = { codes: this.codes };
1390
1541
  const response = await this.rest.request({ method: "PATCH", url: route, payload });
1391
- return this._updateInternals(response);
1542
+ return __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1392
1543
  }
1393
1544
  async removeCode(codeId) {
1394
1545
  const route = Routes.guilds.get(this.id);
1395
1546
  const payload = { codes: this.codes.filter((a) => a._id !== codeId) };
1396
1547
  const response = await this.rest.request({ method: "PATCH", url: route, payload });
1397
- return this._updateInternals(response);
1548
+ return __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1398
1549
  }
1399
1550
  async addIdToChannel(type, id) {
1400
1551
  const channel = this.channels.find((c) => c.type === type);
@@ -1413,7 +1564,7 @@ var Guild2 = class {
1413
1564
  url: route,
1414
1565
  payload
1415
1566
  });
1416
- return this._updateInternals(response);
1567
+ return __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1417
1568
  }
1418
1569
  async setChannelIds(type, ...ids) {
1419
1570
  const channel = this.channels.find((c) => c.type === type);
@@ -1432,7 +1583,7 @@ var Guild2 = class {
1432
1583
  url: route,
1433
1584
  payload
1434
1585
  });
1435
- return this._updateInternals(response);
1586
+ return __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1436
1587
  }
1437
1588
  async removeIdInChannel(type, id) {
1438
1589
  const chIndex = this.channels.findIndex((c) => c.type === type);
@@ -1454,7 +1605,7 @@ var Guild2 = class {
1454
1605
  url: route,
1455
1606
  payload
1456
1607
  });
1457
- return this._updateInternals(response);
1608
+ return __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1458
1609
  }
1459
1610
  async updateRouletteSettings(data) {
1460
1611
  const _data = {
@@ -1511,58 +1662,21 @@ var Guild2 = class {
1511
1662
  this.logEntries.fetch(),
1512
1663
  this.betusers.fetch(),
1513
1664
  this.bets.fetch(),
1514
- this.mediators.fetch()
1665
+ this.mediators.fetch(),
1666
+ this.tournaments.fetch()
1515
1667
  ]);
1516
1668
  return this;
1517
1669
  }
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
- if (key === "adverts") {
1525
- this.adverts = [];
1526
- for (let _adv of data.adverts) {
1527
- this.adverts.push({
1528
- _id: _adv._id,
1529
- admin_id: _adv.admin_id,
1530
- points_to_remove: _adv.points_to_remove,
1531
- role_id: _adv.role_id,
1532
- createdAt: _adv.createdAt ? new Date(_adv.createdAt) : /* @__PURE__ */ new Date(),
1533
- updatedAt: _adv.updatedAt ? new Date(_adv.updatedAt) : /* @__PURE__ */ new Date()
1534
- });
1535
- }
1536
- }
1537
- if (key === "code") {
1538
- this.codes = [];
1539
- for (let _adv of data.codes) {
1540
- this.codes.push({
1541
- _id: _adv._id,
1542
- admin_id: _adv.admin_id,
1543
- type: _adv.type,
1544
- add: _adv.add,
1545
- code: _adv.code,
1546
- expire: _adv.expire ? new Date(_adv.expire) : /* @__PURE__ */ new Date(),
1547
- createdAt: _adv.createdAt ? new Date(_adv.createdAt) : /* @__PURE__ */ new Date(),
1548
- updatedAt: _adv.updatedAt ? new Date(_adv.updatedAt) : /* @__PURE__ */ new Date()
1549
- });
1550
- }
1551
- }
1552
- }
1553
- this.automaticMessagesManager.set(this.automatic_messages);
1554
- this.updatedAt = /* @__PURE__ */ new Date();
1555
- this.rest.guilds.cache.set(this.id, this);
1556
- this.rest.emit("guildUpdate", this);
1557
- return this;
1558
- }
1559
1670
  async fetch() {
1560
1671
  const route = Routes.guilds.get(this.id);
1561
1672
  const response = await this.rest.request({
1562
1673
  method: "get",
1563
1674
  url: route
1564
1675
  });
1565
- return this._updateInternals(response);
1676
+ return __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1677
+ }
1678
+ async reset() {
1679
+ return this.update({ reset: true });
1566
1680
  }
1567
1681
  async update(data) {
1568
1682
  const route = Routes.guilds.get(this.id);
@@ -1571,16 +1685,7 @@ var Guild2 = class {
1571
1685
  url: route,
1572
1686
  payload: data
1573
1687
  });
1574
- for (const k in response) {
1575
- if (k === "id" || k == "createdAt") continue;
1576
- if (k in this) {
1577
- this[k] = response[k];
1578
- }
1579
- }
1580
- this.updatedAt = /* @__PURE__ */ new Date();
1581
- this.rest.guilds.cache.set(this.id, this);
1582
- this.rest.emit("guildUpdate", this);
1583
- return this;
1688
+ return __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1584
1689
  }
1585
1690
  async setStatus(key, status) {
1586
1691
  Assertion.assertString(key);
@@ -1605,16 +1710,27 @@ var Guild2 = class {
1605
1710
  await this.update({ prices: this.prices });
1606
1711
  return this;
1607
1712
  }
1608
- async setPrefix(prefix) {
1609
- Assertion.assertString(prefix);
1610
- const route = Routes.fields(Routes.guilds.resource(this.id, "prefix"));
1611
- const payload = { set: prefix };
1713
+ async addPrefix(prefixes) {
1714
+ const route = Routes.fields(Routes.guilds.resource(this.id, "prefixes"));
1715
+ const _p = Array.isArray(prefixes) ? prefixes : [prefixes];
1716
+ const payload = { set: [.../* @__PURE__ */ new Set([...this.prefixes, ..._p])] };
1612
1717
  const response = await this.rest.request({
1613
1718
  method: "PATCH",
1614
1719
  url: route,
1615
1720
  payload
1616
1721
  });
1617
- this._updateInternals(response);
1722
+ __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1723
+ return this;
1724
+ }
1725
+ async setPrefix(prefixes) {
1726
+ const route = Routes.fields(Routes.guilds.resource(this.id, "prefixes"));
1727
+ const payload = { set: Array.isArray(prefixes) ? prefixes : [prefixes] };
1728
+ const response = await this.rest.request({
1729
+ method: "PATCH",
1730
+ url: route,
1731
+ payload
1732
+ });
1733
+ __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1618
1734
  return this;
1619
1735
  }
1620
1736
  async toggleDailyCategory(category) {
@@ -1634,7 +1750,7 @@ var Guild2 = class {
1634
1750
  url: route,
1635
1751
  payload
1636
1752
  });
1637
- this._updateInternals(response);
1753
+ __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1638
1754
  return this;
1639
1755
  }
1640
1756
  async setScores(name, amount) {
@@ -1647,7 +1763,7 @@ var Guild2 = class {
1647
1763
  url: route,
1648
1764
  payload
1649
1765
  });
1650
- this._updateInternals(response);
1766
+ __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1651
1767
  return this;
1652
1768
  }
1653
1769
  async toggleMode(mode) {
@@ -1672,10 +1788,52 @@ var Guild2 = class {
1672
1788
  url: route,
1673
1789
  payload
1674
1790
  });
1675
- this._updateInternals(response);
1791
+ __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1676
1792
  return this;
1677
1793
  }
1678
1794
  };
1795
+ _Guild_instances = new WeakSet();
1796
+ updateInternals_fn4 = function(data) {
1797
+ for (let key in data) {
1798
+ if (key === "id" || key === "createdAt") continue;
1799
+ if (key in this) {
1800
+ this[key] = data[key];
1801
+ }
1802
+ if (key === "adverts") {
1803
+ this.adverts = [];
1804
+ for (let _adv of data.adverts) {
1805
+ this.adverts.push({
1806
+ _id: _adv._id,
1807
+ admin_id: _adv.admin_id,
1808
+ points_to_remove: _adv.points_to_remove,
1809
+ role_id: _adv.role_id,
1810
+ createdAt: _adv.createdAt ? new Date(_adv.createdAt) : /* @__PURE__ */ new Date(),
1811
+ updatedAt: _adv.updatedAt ? new Date(_adv.updatedAt) : /* @__PURE__ */ new Date()
1812
+ });
1813
+ }
1814
+ }
1815
+ if (key === "code") {
1816
+ this.codes = [];
1817
+ for (let _adv of data.codes) {
1818
+ this.codes.push({
1819
+ _id: _adv._id,
1820
+ admin_id: _adv.admin_id,
1821
+ type: _adv.type,
1822
+ add: _adv.add,
1823
+ code: _adv.code,
1824
+ expire: _adv.expire ? new Date(_adv.expire) : /* @__PURE__ */ new Date(),
1825
+ createdAt: _adv.createdAt ? new Date(_adv.createdAt) : /* @__PURE__ */ new Date(),
1826
+ updatedAt: _adv.updatedAt ? new Date(_adv.updatedAt) : /* @__PURE__ */ new Date()
1827
+ });
1828
+ }
1829
+ }
1830
+ }
1831
+ this.automaticMessagesManager.set(this.automatic_messages);
1832
+ this.updatedAt = /* @__PURE__ */ new Date();
1833
+ this.rest.guilds.cache.set(this.id, this);
1834
+ this.rest.emit("guildUpdate", this);
1835
+ return this;
1836
+ };
1679
1837
 
1680
1838
  // src/managers/guild/GuildManager.ts
1681
1839
  var GuildManager = class {
@@ -1705,7 +1863,7 @@ var GuildManager = class {
1705
1863
  method: "get",
1706
1864
  url: route2
1707
1865
  });
1708
- const guild = new Guild2(response2, this.rest);
1866
+ const guild = new Guild3(response2, this.rest);
1709
1867
  await guild._start().then((g) => {
1710
1868
  this.cache.set(g.id, g);
1711
1869
  });
@@ -1719,13 +1877,22 @@ var GuildManager = class {
1719
1877
  });
1720
1878
  for (let _guild of response) {
1721
1879
  if (!_guild.id) continue;
1722
- const guild = new Guild2(_guild, this.rest);
1880
+ const guild = new Guild3(_guild, this.rest);
1723
1881
  await guild._start().then((g) => {
1724
1882
  this.cache.set(g.id, g);
1725
1883
  });
1726
1884
  }
1727
1885
  return this.cache;
1728
1886
  }
1887
+ async reset(guildId) {
1888
+ if (guildId) {
1889
+ return await this.cache.get(guildId).reset();
1890
+ }
1891
+ for (let [_, g] of this.cache) {
1892
+ await g.reset();
1893
+ }
1894
+ return this.cache;
1895
+ }
1729
1896
  async delete(options) {
1730
1897
  if (options && options.guildId) {
1731
1898
  Assertion.assertString(options.guildId);
@@ -1752,12 +1919,12 @@ var GuildManager = class {
1752
1919
  if (!data) return this.cache;
1753
1920
  if (Array.isArray(data)) {
1754
1921
  for (let _guild of data) {
1755
- const guild = new Guild2(_guild, this.rest);
1922
+ const guild = new Guild3(_guild, this.rest);
1756
1923
  this.cache.set(guild.id, guild);
1757
1924
  }
1758
1925
  return this.cache;
1759
1926
  } else {
1760
- const guild = new Guild2(data, this.rest);
1927
+ const guild = new Guild3(data, this.rest);
1761
1928
  this.cache.set(guild.id, guild);
1762
1929
  return guild;
1763
1930
  }
@@ -1771,7 +1938,7 @@ var FgGreen = "\x1B[32m";
1771
1938
  var FgRed = "\x1B[31m";
1772
1939
  var FgBlue = "\x1B[34m";
1773
1940
  var FgCyan = "\x1B[36m";
1774
- var REST = class extends EventEmitter {
1941
+ var REST2 = class extends EventEmitter {
1775
1942
  /**
1776
1943
  *
1777
1944
  * @param key The unique key for he client
@@ -1868,8 +2035,10 @@ var REST = class extends EventEmitter {
1868
2035
  };
1869
2036
 
1870
2037
  // src/structures/bet/GuildBet.ts
2038
+ var _GuildBet_instances, updateInternals_fn5;
1871
2039
  var GuildBet = class {
1872
2040
  constructor(data, manager) {
2041
+ __privateAdd(this, _GuildBet_instances);
1873
2042
  /** The bet's type */
1874
2043
  __publicField(this, "type");
1875
2044
  /** The bet's mode */
@@ -1948,7 +2117,7 @@ var GuildBet = class {
1948
2117
  async fetch() {
1949
2118
  const route = Routes.guilds.bets.get(this.guild.id, this._id);
1950
2119
  const response = await this.rest.request({ url: route, method: "GET" });
1951
- return this._updateInternals(response);
2120
+ return __privateMethod(this, _GuildBet_instances, updateInternals_fn5).call(this, response);
1952
2121
  }
1953
2122
  async addPlayer(player, queue_type) {
1954
2123
  if (this.players.length === 2) return this;
@@ -1985,7 +2154,7 @@ var GuildBet = class {
1985
2154
  const payload = data;
1986
2155
  const route = Routes.guilds.bets.update(this.guild.id, this._id);
1987
2156
  const response = await this.rest.request({ method: "patch", url: route, payload });
1988
- return this._updateInternals(response);
2157
+ return __privateMethod(this, _GuildBet_instances, updateInternals_fn5).call(this, response);
1989
2158
  }
1990
2159
  async delete() {
1991
2160
  const route = Routes.guilds.bets.delete(this.manager.guild.id, this._id);
@@ -1997,33 +2166,6 @@ var GuildBet = class {
1997
2166
  this.manager.cache.delete(this._id);
1998
2167
  return response;
1999
2168
  }
2000
- _updateInternals(data) {
2001
- for (let key in data) {
2002
- if (key === "_id" || key === "createdAt") continue;
2003
- if (key === "messages") {
2004
- this.messages.set(data[key]);
2005
- continue;
2006
- }
2007
- if (key === "players") {
2008
- this.players._set(data[key]);
2009
- continue;
2010
- }
2011
- if (key in this) {
2012
- this[key] = data[key];
2013
- }
2014
- }
2015
- if (data?.messages?.length !== 0) {
2016
- if (this?.messages instanceof MessagesManager) this.messages.set(data.messages);
2017
- else {
2018
- this.messages = new MessagesManager(this, Routes.guilds.matches.resource(this.guild_id, this._id, "messages"));
2019
- this.messages.set(data.messages);
2020
- }
2021
- }
2022
- this.updatedAt = /* @__PURE__ */ new Date();
2023
- this.createdAt = new Date(data.createdAt);
2024
- this.manager.set(this);
2025
- return this;
2026
- }
2027
2169
  toJSON() {
2028
2170
  let json = {};
2029
2171
  for (const [key, value] of Object.entries(this)) {
@@ -2040,10 +2182,40 @@ var GuildBet = class {
2040
2182
  };
2041
2183
  }
2042
2184
  };
2185
+ _GuildBet_instances = new WeakSet();
2186
+ updateInternals_fn5 = function(data) {
2187
+ for (let key in data) {
2188
+ if (key === "_id" || key === "createdAt") continue;
2189
+ if (key === "messages") {
2190
+ this.messages.set(data[key]);
2191
+ continue;
2192
+ }
2193
+ if (key === "players") {
2194
+ this.players._set(data[key]);
2195
+ continue;
2196
+ }
2197
+ if (key in this) {
2198
+ this[key] = data[key];
2199
+ }
2200
+ }
2201
+ if (data?.messages?.length !== 0) {
2202
+ if (this?.messages instanceof MessagesManager) this.messages.set(data.messages);
2203
+ else {
2204
+ this.messages = new MessagesManager(this, Routes.guilds.matches.resource(this.guild_id, this._id, "messages"));
2205
+ this.messages.set(data.messages);
2206
+ }
2207
+ }
2208
+ this.updatedAt = /* @__PURE__ */ new Date();
2209
+ this.createdAt = new Date(data.createdAt);
2210
+ this.manager.set(this);
2211
+ return this;
2212
+ };
2043
2213
 
2044
2214
  // src/structures/logentry/LogEntry.ts
2215
+ var _LogEntry_instances, updateInternals_fn6;
2045
2216
  var LogEntry = class {
2046
2217
  constructor(data, manager) {
2218
+ __privateAdd(this, _LogEntry_instances);
2047
2219
  __publicField(this, "_id");
2048
2220
  __publicField(this, "guild_id");
2049
2221
  __publicField(this, "user_id");
@@ -2079,9 +2251,9 @@ var LogEntry = class {
2079
2251
  this.updatedAt = data?.updatedAt ? new Date(data?.updatedAt) : /* @__PURE__ */ new Date();
2080
2252
  }
2081
2253
  async fetch() {
2082
- const route = Routes.guilds.resources(this.guild.id, "logs", this._id);
2254
+ const route = Routes.fields("guilds", this.guild.id, "logentries", this._id);
2083
2255
  const response = await this.rest.request({ url: route, method: "GET" });
2084
- return this._updateInternals(response);
2256
+ return __privateMethod(this, _LogEntry_instances, updateInternals_fn6).call(this, response);
2085
2257
  }
2086
2258
  toJSON() {
2087
2259
  const json = {};
@@ -2092,21 +2264,23 @@ var LogEntry = class {
2092
2264
  }
2093
2265
  return json;
2094
2266
  }
2095
- _updateInternals(data) {
2096
- for (let key in data) {
2097
- if (key === "id" || key === "createdAt") continue;
2098
- if (key in this) {
2099
- this[key] = data[key];
2100
- }
2267
+ };
2268
+ _LogEntry_instances = new WeakSet();
2269
+ updateInternals_fn6 = function(data) {
2270
+ for (let key in data) {
2271
+ if (key === "id" || key === "createdAt") continue;
2272
+ if (key in this) {
2273
+ this[key] = data[key];
2101
2274
  }
2102
- this.updatedAt = /* @__PURE__ */ new Date();
2103
- this.manager.set(this);
2104
- return this;
2105
2275
  }
2276
+ this.updatedAt = /* @__PURE__ */ new Date();
2277
+ this.manager.set(this);
2278
+ return this;
2106
2279
  };
2107
2280
 
2108
2281
  // src/structures/match/GuildMatch.ts
2109
- var GuildMatch = class _GuildMatch {
2282
+ var _GuildMatch_instances, updateInternals_fn7;
2283
+ var _GuildMatch = class _GuildMatch {
2110
2284
  /**
2111
2285
  * GuildMatch match
2112
2286
  * @param data The match's data
@@ -2114,6 +2288,7 @@ var GuildMatch = class _GuildMatch {
2114
2288
  * @param rest The rest client
2115
2289
  */
2116
2290
  constructor(data, manager) {
2291
+ __privateAdd(this, _GuildMatch_instances);
2117
2292
  __publicField(this, "_id");
2118
2293
  __publicField(this, "selections");
2119
2294
  /** Match's type */
@@ -2197,7 +2372,7 @@ var GuildMatch = class _GuildMatch {
2197
2372
  method: "get",
2198
2373
  url: route
2199
2374
  });
2200
- return await this._updateInternals(response);
2375
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn7).call(this, response);
2201
2376
  }
2202
2377
  async addConfirmed(type, id) {
2203
2378
  const confirmed = this.confirmed.find((c) => c.type === type);
@@ -2219,7 +2394,7 @@ var GuildMatch = class _GuildMatch {
2219
2394
  url: route,
2220
2395
  payload: set
2221
2396
  });
2222
- return await this._updateInternals(response);
2397
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn7).call(this, response);
2223
2398
  }
2224
2399
  async setStatus(status) {
2225
2400
  Assertion.assertString(status);
@@ -2230,7 +2405,7 @@ var GuildMatch = class _GuildMatch {
2230
2405
  url: route,
2231
2406
  payload
2232
2407
  });
2233
- return await this._updateInternals(response);
2408
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn7).call(this, response);
2234
2409
  }
2235
2410
  async setWinners(players) {
2236
2411
  if (!Array.isArray(players)) players = [players];
@@ -2241,7 +2416,7 @@ var GuildMatch = class _GuildMatch {
2241
2416
  url: route,
2242
2417
  payload
2243
2418
  });
2244
- return await this._updateInternals(response);
2419
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn7).call(this, response);
2245
2420
  }
2246
2421
  async setLoser(players) {
2247
2422
  if (!Array.isArray(players)) players = [players];
@@ -2252,7 +2427,7 @@ var GuildMatch = class _GuildMatch {
2252
2427
  url: route,
2253
2428
  payload
2254
2429
  });
2255
- return await this._updateInternals(response);
2430
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn7).call(this, response);
2256
2431
  }
2257
2432
  async setMvps(...usersId) {
2258
2433
  const payload = { set: usersId };
@@ -2262,7 +2437,7 @@ var GuildMatch = class _GuildMatch {
2262
2437
  url: route,
2263
2438
  payload
2264
2439
  });
2265
- return await this._updateInternals(response);
2440
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn7).call(this, response);
2266
2441
  }
2267
2442
  async setRoomCreatorId(userId) {
2268
2443
  Assertion.assertString(userId);
@@ -2273,7 +2448,7 @@ var GuildMatch = class _GuildMatch {
2273
2448
  url: route,
2274
2449
  payload
2275
2450
  });
2276
- return await this._updateInternals(response);
2451
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn7).call(this, response);
2277
2452
  }
2278
2453
  async setRoomAdminId(userId) {
2279
2454
  Assertion.assertString(userId);
@@ -2284,7 +2459,7 @@ var GuildMatch = class _GuildMatch {
2284
2459
  url: route,
2285
2460
  payload
2286
2461
  });
2287
- return await this._updateInternals(response);
2462
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn7).call(this, response);
2288
2463
  }
2289
2464
  async kick(player) {
2290
2465
  this.players = this.players.filter((p) => p.id !== player.id);
@@ -2308,7 +2483,7 @@ var GuildMatch = class _GuildMatch {
2308
2483
  payload: data
2309
2484
  });
2310
2485
  this.rest.emit("matchUpdate", this, new _GuildMatch(response, this.manager));
2311
- return await this._updateInternals(response);
2486
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn7).call(this, response);
2312
2487
  }
2313
2488
  async delete() {
2314
2489
  const route = Routes.guilds.matches.resource(this.guild.id, this._id);
@@ -2334,35 +2509,38 @@ var GuildMatch = class _GuildMatch {
2334
2509
  messages: this?.messages instanceof MessagesManager ? this.messages?.cache?.toArray() : []
2335
2510
  };
2336
2511
  }
2337
- async _updateInternals(data) {
2338
- if (!data) return;
2339
- for (let key in data) {
2340
- if (key === "id" || key === "createdAt" || key === "messages") continue;
2341
- if (key in this) {
2342
- this[key] = data[key];
2343
- }
2344
- if (key === "bet") {
2345
- this.bet = this.guild.bets.set(data.bet);
2346
- }
2512
+ };
2513
+ _GuildMatch_instances = new WeakSet();
2514
+ updateInternals_fn7 = async function(data) {
2515
+ if (!data) return;
2516
+ for (let key in data) {
2517
+ if (key === "id" || key === "createdAt" || key === "messages") continue;
2518
+ if (key in this) {
2519
+ this[key] = data[key];
2347
2520
  }
2348
- if (data?.messages?.length !== 0) {
2349
- if (this?.messages instanceof MessagesManager) this.messages.set(data.messages);
2350
- else {
2351
- this.messages = new MessagesManager(this, Routes.guilds.matches.resource(this.guild_id, this._id, "messages"));
2352
- this.messages.set(data.messages);
2353
- }
2521
+ if (key === "bet") {
2522
+ this.bet = this.guild.bets.set(data.bet);
2354
2523
  }
2355
- if (!(this.bet instanceof GuildBet) && data?.bet) {
2356
- this.bet = this.guild.bets.cache.get(data._id) ?? await this.guild.bets.fetch({ betId: data?.bet?._id });
2524
+ }
2525
+ if (data?.messages?.length !== 0) {
2526
+ if (this?.messages instanceof MessagesManager) this.messages.set(data.messages);
2527
+ else {
2528
+ this.messages = new MessagesManager(this, Routes.guilds.matches.resource(this.guild_id, this._id, "messages"));
2529
+ this.messages.set(data.messages);
2357
2530
  }
2358
- this.updatedAt = /* @__PURE__ */ new Date();
2359
- this.manager.set(this);
2360
- return this;
2361
2531
  }
2532
+ if (!(this.bet instanceof GuildBet) && data?.bet) {
2533
+ this.bet = this.guild.bets.cache.get(data._id) ?? await this.guild.bets.fetch({ betId: data?.bet?._id });
2534
+ }
2535
+ this.updatedAt = /* @__PURE__ */ new Date();
2536
+ this.manager.set(this);
2537
+ return this;
2362
2538
  };
2539
+ var GuildMatch = _GuildMatch;
2363
2540
 
2364
2541
  // src/structures/user/GuildUser.ts
2365
- var GuildUser = class _GuildUser {
2542
+ var _GuildUser_instances, updateInternals_fn8;
2543
+ var _GuildUser = class _GuildUser {
2366
2544
  /**
2367
2545
  * Bet user
2368
2546
  * @param data The user's data
@@ -2370,6 +2548,7 @@ var GuildUser = class _GuildUser {
2370
2548
  * @param rest The rest client
2371
2549
  */
2372
2550
  constructor(data, manager) {
2551
+ __privateAdd(this, _GuildUser_instances);
2373
2552
  /** User's id */
2374
2553
  __publicField(this, "id");
2375
2554
  __publicField(this, "guild_id");
@@ -2482,7 +2661,7 @@ var GuildUser = class _GuildUser {
2482
2661
  url: route,
2483
2662
  payload
2484
2663
  });
2485
- this._updateInternals(response);
2664
+ __privateMethod(this, _GuildUser_instances, updateInternals_fn8).call(this, response);
2486
2665
  return this;
2487
2666
  }
2488
2667
  async updateProfile(data) {
@@ -2503,43 +2682,14 @@ var GuildUser = class _GuildUser {
2503
2682
  url: route,
2504
2683
  payload: _data
2505
2684
  });
2506
- this._updateInternals(response);
2507
- return this;
2508
- }
2509
- _updateInternals(data) {
2510
- for (let key in data) {
2511
- if (key === "id" || key === "createdAt") continue;
2512
- if (key in this) {
2513
- this[key] = data[key];
2514
- }
2515
- if (key === "adverts") {
2516
- this.adverts = [];
2517
- for (let _adv of data.adverts) {
2518
- this.adverts.push({
2519
- _id: _adv._id,
2520
- admin_id: _adv.admin_id,
2521
- role_id: _adv.role_id,
2522
- reason: _adv.reason,
2523
- points_removed: _adv.points_removed,
2524
- proof: _adv.proof,
2525
- proof_ext: _adv.proof_ext,
2526
- createdAt: _adv.createdAt ? new Date(_adv.createdAt) : /* @__PURE__ */ new Date(),
2527
- updatedAt: _adv.updatedAt ? new Date(_adv.updatedAt) : /* @__PURE__ */ new Date()
2528
- });
2529
- }
2530
- }
2531
- }
2532
- this.updatedAt = /* @__PURE__ */ new Date();
2533
- this.createdAt = new Date(data.createdAt);
2534
- this.manager.set(this);
2535
- this.rest.emit("userUpdate", this);
2685
+ __privateMethod(this, _GuildUser_instances, updateInternals_fn8).call(this, response);
2536
2686
  return this;
2537
2687
  }
2538
2688
  async addAdvert(data) {
2539
2689
  const route = Routes.guilds.users.resource(this.manager.guild.id, this.id, "adverts");
2540
2690
  const payload = data;
2541
2691
  const response = await this.rest.request({ method: "POST", url: route, payload });
2542
- return this._updateInternals(response);
2692
+ return __privateMethod(this, _GuildUser_instances, updateInternals_fn8).call(this, response);
2543
2693
  }
2544
2694
  async removeAdvert(advertId) {
2545
2695
  let advs = this.adverts;
@@ -2548,7 +2698,7 @@ var GuildUser = class _GuildUser {
2548
2698
  const payload = { adverts: advs };
2549
2699
  const route = Routes.guilds.users.update(this.manager.guild.id, this.id);
2550
2700
  const response = await this.rest.request({ method: "PATCH", url: route, payload });
2551
- return this._updateInternals(response);
2701
+ return __privateMethod(this, _GuildUser_instances, updateInternals_fn8).call(this, response);
2552
2702
  }
2553
2703
  /**
2554
2704
  * Update certain property
@@ -2599,7 +2749,7 @@ var GuildUser = class _GuildUser {
2599
2749
  url: route,
2600
2750
  payload
2601
2751
  });
2602
- this._updateInternals(response);
2752
+ __privateMethod(this, _GuildUser_instances, updateInternals_fn8).call(this, response);
2603
2753
  return this;
2604
2754
  }
2605
2755
  async delete() {
@@ -2624,6 +2774,37 @@ var GuildUser = class _GuildUser {
2624
2774
  return json;
2625
2775
  }
2626
2776
  };
2777
+ _GuildUser_instances = new WeakSet();
2778
+ updateInternals_fn8 = function(data) {
2779
+ for (let key in data) {
2780
+ if (key === "id" || key === "createdAt") continue;
2781
+ if (key in this) {
2782
+ this[key] = data[key];
2783
+ }
2784
+ if (key === "adverts") {
2785
+ this.adverts = [];
2786
+ for (let _adv of data.adverts) {
2787
+ this.adverts.push({
2788
+ _id: _adv._id,
2789
+ admin_id: _adv.admin_id,
2790
+ role_id: _adv.role_id,
2791
+ reason: _adv.reason,
2792
+ points_removed: _adv.points_removed,
2793
+ proof: _adv.proof,
2794
+ proof_ext: _adv.proof_ext,
2795
+ createdAt: _adv.createdAt ? new Date(_adv.createdAt) : /* @__PURE__ */ new Date(),
2796
+ updatedAt: _adv.updatedAt ? new Date(_adv.updatedAt) : /* @__PURE__ */ new Date()
2797
+ });
2798
+ }
2799
+ }
2800
+ }
2801
+ this.updatedAt = /* @__PURE__ */ new Date();
2802
+ this.createdAt = new Date(data.createdAt);
2803
+ this.manager.set(this);
2804
+ this.rest.emit("userUpdate", this);
2805
+ return this;
2806
+ };
2807
+ var GuildUser = _GuildUser;
2627
2808
 
2628
2809
  // src/structures/vipmember/VipMember.ts
2629
2810
  var _VipMember_instances, updateData_fn;
@@ -2762,8 +2943,10 @@ updateData_fn = function(data) {
2762
2943
  var VipMember = _VipMember;
2763
2944
 
2764
2945
  // src/structures/ticket/Ticket.ts
2946
+ var _GuildTicket_instances, updateInternals_fn9;
2765
2947
  var GuildTicket = class {
2766
2948
  constructor(data, manager) {
2949
+ __privateAdd(this, _GuildTicket_instances);
2767
2950
  __publicField(this, "_id");
2768
2951
  __publicField(this, "guild_id");
2769
2952
  __publicField(this, "type");
@@ -2800,7 +2983,7 @@ var GuildTicket = class {
2800
2983
  method: "GET",
2801
2984
  url: route
2802
2985
  });
2803
- return this._updateInternals(response);
2986
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn9).call(this, response);
2804
2987
  }
2805
2988
  async setCustomerRating(rating) {
2806
2989
  const route = Routes.guilds.tickets.resource(this.guild.id, this._id, "customer_rating");
@@ -2810,7 +2993,7 @@ var GuildTicket = class {
2810
2993
  url: route,
2811
2994
  payload
2812
2995
  });
2813
- return this._updateInternals(response);
2996
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn9).call(this, response);
2814
2997
  }
2815
2998
  async setAdminId(id) {
2816
2999
  const route = Routes.guilds.tickets.resource(this.guild.id, this._id, "admin_id");
@@ -2820,7 +3003,7 @@ var GuildTicket = class {
2820
3003
  url: route,
2821
3004
  payload
2822
3005
  });
2823
- return this._updateInternals(response);
3006
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn9).call(this, response);
2824
3007
  }
2825
3008
  async setChannelId(id) {
2826
3009
  const route = Routes.guilds.tickets.resource(this.guild.id, this._id, "channel_id");
@@ -2830,7 +3013,7 @@ var GuildTicket = class {
2830
3013
  url: route,
2831
3014
  payload
2832
3015
  });
2833
- return this._updateInternals(response);
3016
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn9).call(this, response);
2834
3017
  }
2835
3018
  async setClosedById(id) {
2836
3019
  const route = Routes.guilds.tickets.resource(this.guild.id, this._id, "closed_by_id");
@@ -2840,7 +3023,7 @@ var GuildTicket = class {
2840
3023
  url: route,
2841
3024
  payload
2842
3025
  });
2843
- return this._updateInternals(response);
3026
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn9).call(this, response);
2844
3027
  }
2845
3028
  async setStatus(status) {
2846
3029
  const route = Routes.guilds.tickets.resource(this.guild.id, this._id, "status");
@@ -2850,7 +3033,7 @@ var GuildTicket = class {
2850
3033
  url: route,
2851
3034
  payload
2852
3035
  });
2853
- return this._updateInternals(response);
3036
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn9).call(this, response);
2854
3037
  }
2855
3038
  async addMessage(message) {
2856
3039
  const route = Routes.guilds.tickets.resource(this.guild.id, this._id, "messages");
@@ -2860,25 +3043,28 @@ var GuildTicket = class {
2860
3043
  url: route,
2861
3044
  payload
2862
3045
  });
2863
- return this._updateInternals(response);
3046
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn9).call(this, response);
2864
3047
  }
2865
- _updateInternals(data) {
2866
- for (let key in data) {
2867
- if (key === "id" || key === "createdAt") continue;
2868
- if (key in this) {
2869
- this[key] = data[key];
2870
- }
3048
+ };
3049
+ _GuildTicket_instances = new WeakSet();
3050
+ updateInternals_fn9 = function(data) {
3051
+ for (let key in data) {
3052
+ if (key === "id" || key === "createdAt") continue;
3053
+ if (key in this) {
3054
+ this[key] = data[key];
2871
3055
  }
2872
- this.updatedAt = /* @__PURE__ */ new Date();
2873
- this.createdAt = new Date(data.createdAt);
2874
- this.manager.set(this);
2875
- return this;
2876
3056
  }
3057
+ this.updatedAt = /* @__PURE__ */ new Date();
3058
+ this.createdAt = new Date(data.createdAt);
3059
+ this.manager.set(this);
3060
+ return this;
2877
3061
  };
2878
3062
 
2879
3063
  // src/structures/minesgame/MinesGame.ts
3064
+ var _MinesGame_instances, updateInternals_fn10;
2880
3065
  var MinesGame = class {
2881
3066
  constructor(data, manager) {
3067
+ __privateAdd(this, _MinesGame_instances);
2882
3068
  __publicField(this, "guild_id");
2883
3069
  __publicField(this, "_id");
2884
3070
  __publicField(this, "creatorId");
@@ -2912,7 +3098,7 @@ var MinesGame = class {
2912
3098
  method: "GET",
2913
3099
  url: route
2914
3100
  });
2915
- return this._updateInternals(response);
3101
+ return __privateMethod(this, _MinesGame_instances, updateInternals_fn10).call(this, response);
2916
3102
  }
2917
3103
  async delete() {
2918
3104
  const route = `/${Routes.fields("minesgames", this._id)}`;
@@ -2920,7 +3106,7 @@ var MinesGame = class {
2920
3106
  method: "delete",
2921
3107
  url: route
2922
3108
  });
2923
- return this._updateInternals(response);
3109
+ return __privateMethod(this, _MinesGame_instances, updateInternals_fn10).call(this, response);
2924
3110
  }
2925
3111
  async update(data) {
2926
3112
  const route = `/${Routes.fields("minesgames", this._id)}`;
@@ -2929,25 +3115,27 @@ var MinesGame = class {
2929
3115
  url: route,
2930
3116
  payload: data
2931
3117
  });
2932
- return this._updateInternals(response);
3118
+ return __privateMethod(this, _MinesGame_instances, updateInternals_fn10).call(this, response);
2933
3119
  }
2934
- _updateInternals(data) {
2935
- for (let key in data) {
2936
- if (key === "id" || key === "createdAt") continue;
2937
- if (key in this) {
2938
- this[key] = data[key];
2939
- }
3120
+ };
3121
+ _MinesGame_instances = new WeakSet();
3122
+ updateInternals_fn10 = function(data) {
3123
+ for (let key in data) {
3124
+ if (key === "id" || key === "createdAt") continue;
3125
+ if (key in this) {
3126
+ this[key] = data[key];
2940
3127
  }
2941
- this.updatedAt = /* @__PURE__ */ new Date();
2942
- this.manager.set(this);
2943
- return this;
2944
3128
  }
3129
+ this.updatedAt = /* @__PURE__ */ new Date();
3130
+ this.manager.set(this);
3131
+ return this;
2945
3132
  };
2946
3133
 
2947
3134
  // src/structures/automaticmessage/AutomaticMessage.ts
3135
+ var _AutomaticMessage_instances, updateInternals_fn11;
2948
3136
  var AutomaticMessage = class {
2949
3137
  constructor(data, manager) {
2950
- __publicField(this, "_id");
3138
+ __privateAdd(this, _AutomaticMessage_instances);
2951
3139
  __publicField(this, "id");
2952
3140
  __publicField(this, "type");
2953
3141
  __publicField(this, "admin_id");
@@ -2966,7 +3154,6 @@ var AutomaticMessage = class {
2966
3154
  this.manager = manager;
2967
3155
  this.guild = manager.guild;
2968
3156
  this.rest = manager.rest;
2969
- this._id = data?._id;
2970
3157
  this.id = data?.id;
2971
3158
  this.type = data?.type;
2972
3159
  this.admin_id = data?.admin_id;
@@ -2981,12 +3168,7 @@ var AutomaticMessage = class {
2981
3168
  this.updatedAt = data?.updatedAt ? new Date(data?.updatedAt) : /* @__PURE__ */ new Date();
2982
3169
  }
2983
3170
  async fetch() {
2984
- const route = Routes.guilds.resource(this.guild.id, "automatic_messages", this._id);
2985
- const response = await this.rest.request({
2986
- method: "get",
2987
- url: route
2988
- });
2989
- return this._updateInternals(response);
3171
+ return this.manager.fetch(this.id);
2990
3172
  }
2991
3173
  async addChannelId(...id) {
2992
3174
  const ids = [.../* @__PURE__ */ new Set([...this.channel_ids, ...id])];
@@ -2998,39 +3180,28 @@ var AutomaticMessage = class {
2998
3180
  return this.update({ channel_ids: ids });
2999
3181
  }
3000
3182
  async update(data) {
3183
+ this.manager.cache.set(this.id, { ...this, ...data, id: this.id });
3001
3184
  const route = Routes.guilds.get(this.guild.id);
3002
3185
  const response = await this.rest.request({
3003
3186
  method: "patch",
3004
3187
  url: route,
3005
- payload: { automatic_messages: this.manager.cache.toArray() }
3188
+ payload: { automatic_messages: this.manager.toJSON() }
3006
3189
  });
3007
- return this._updateInternals(response);
3190
+ return __privateMethod(this, _AutomaticMessage_instances, updateInternals_fn11).call(this, response);
3008
3191
  }
3009
3192
  async delete() {
3010
- this.manager.cache.delete(this._id);
3193
+ this.manager.cache.delete(this.id);
3194
+ this.guild.automatic_messages = this.manager.cache.toArray();
3011
3195
  const route = Routes.guilds.get(this.guild.id);
3012
3196
  const response = await this.rest.request({
3013
3197
  method: "patch",
3014
3198
  url: route,
3015
- payload: { automatic_messages: this.manager.cache.toArray() }
3199
+ payload: { automatic_messages: this.manager.toJSON() }
3016
3200
  });
3017
3201
  return this.manager.set(response.automatic_messages);
3018
3202
  }
3019
- _updateInternals(data) {
3020
- for (let key in data) {
3021
- if (key === "_id" || key === "createdAt") continue;
3022
- if (key in this) {
3023
- this[key] = data[key];
3024
- }
3025
- }
3026
- this.updatedAt = /* @__PURE__ */ new Date();
3027
- this.createdAt = new Date(data.createdAt);
3028
- this.manager._add(this);
3029
- return this;
3030
- }
3031
3203
  toJSON() {
3032
3204
  return {
3033
- _id: this._id,
3034
3205
  id: this.id,
3035
3206
  type: this.type,
3036
3207
  admin_id: this.admin_id,
@@ -3046,6 +3217,20 @@ var AutomaticMessage = class {
3046
3217
  };
3047
3218
  }
3048
3219
  };
3220
+ _AutomaticMessage_instances = new WeakSet();
3221
+ updateInternals_fn11 = function(data) {
3222
+ const _this = data?.automatic_messages?.find((m) => m.id === this.id);
3223
+ for (let key in _this) {
3224
+ if (key === "id" || key === "createdAt") continue;
3225
+ if (key in this) {
3226
+ this[key] = _this[key];
3227
+ }
3228
+ }
3229
+ this.updatedAt = /* @__PURE__ */ new Date();
3230
+ this.createdAt = new Date(data.createdAt);
3231
+ this.manager._add(data.automatic_messages);
3232
+ return this;
3233
+ };
3049
3234
 
3050
3235
  // src/utils/randomKeyGenerator.ts
3051
3236
  import { randomBytes } from "crypto";
@@ -3059,25 +3244,19 @@ var AutomaticMessageManager = class extends BaseManager {
3059
3244
  super(guild);
3060
3245
  this.guild = guild;
3061
3246
  this.rest = guild.rest;
3062
- this.base_url = Routes.guilds.resource(guild.id, "automatic_messages");
3247
+ this.base_url = Routes.guilds.resource(guild.id);
3063
3248
  this.cache = new Collection();
3064
3249
  if (guild.automatic_messages && guild.automatic_messages.length !== 0) this.set(guild.automatic_messages);
3065
3250
  else this.guild.automatic_messages = [];
3066
3251
  }
3067
3252
  async fetch(messageId) {
3068
3253
  const route = this.base_url;
3069
- if (messageId) {
3070
- const response2 = await this.rest.request({
3071
- method: "get",
3072
- url: `${route}`
3073
- });
3074
- return this._add(response2).find((m) => m.id === messageId);
3075
- }
3076
3254
  const response = await this.rest.request({
3077
3255
  method: "get",
3078
3256
  url: route
3079
3257
  });
3080
- return this._add(response.automatic_messages);
3258
+ this._add(response.automatic_messages);
3259
+ return this.cache;
3081
3260
  }
3082
3261
  async create(data) {
3083
3262
  if (!data.type) throw new Error(`Missing message's type.`);
@@ -3104,6 +3283,7 @@ var AutomaticMessageManager = class extends BaseManager {
3104
3283
  if (data instanceof AutomaticMessage) this.cache.set(data.id, data);
3105
3284
  else this.cache.set(data.id, new AutomaticMessage(data, this));
3106
3285
  }
3286
+ this.guild.automatic_messages = this.cache.toArray();
3107
3287
  return this.cache;
3108
3288
  }
3109
3289
  set(data) {
@@ -3132,6 +3312,10 @@ var AutomaticMessageManager = class extends BaseManager {
3132
3312
  });
3133
3313
  return response;
3134
3314
  }
3315
+ toJSON() {
3316
+ [...this.cache.values()].map((m) => console.log(m instanceof AutomaticMessage));
3317
+ return this.cache.toArray();
3318
+ }
3135
3319
  };
3136
3320
 
3137
3321
  // src/managers/bet/GuildBetManager.ts
@@ -3552,15 +3736,14 @@ var GuildTicketManager = class {
3552
3736
  } else {
3553
3737
  categories.push(data);
3554
3738
  }
3555
- const payload = { tickets_configuration: { categories } };
3556
- const route = Routes.guilds.get(this.guild.id);
3557
- const response = await this.rest.request({
3558
- method: "PATCH",
3559
- url: route,
3560
- payload
3739
+ return this.guild.update({
3740
+ tickets_configuration: {
3741
+ categories,
3742
+ creationCategory: this.guild.tickets_configuration.creationCategory,
3743
+ deletionCategory: this.guild.tickets_configuration.deletionCategory,
3744
+ rating_channel_id: this.guild.tickets_configuration.rating_channel_id
3745
+ }
3561
3746
  });
3562
- this.guild._updateInternals(response);
3563
- return response;
3564
3747
  }
3565
3748
  async deleteTicketCategory(data) {
3566
3749
  let categories = this.guild.tickets_configuration.categories;
@@ -3574,8 +3757,14 @@ var GuildTicketManager = class {
3574
3757
  url: route,
3575
3758
  payload
3576
3759
  });
3577
- this.guild._updateInternals(response);
3578
- return response;
3760
+ return this.guild.update({
3761
+ tickets_configuration: {
3762
+ categories,
3763
+ creationCategory: this.guild.tickets_configuration.creationCategory,
3764
+ deletionCategory: this.guild.tickets_configuration.deletionCategory,
3765
+ rating_channel_id: this.guild.tickets_configuration.rating_channel_id
3766
+ }
3767
+ });
3579
3768
  }
3580
3769
  async fetch(options) {
3581
3770
  if (options && options.cache) return this.cache;
@@ -3971,7 +4160,7 @@ export {
3971
4160
  BetChannelTypes,
3972
4161
  BufferManager,
3973
4162
  Collection,
3974
- Guild2 as Guild,
4163
+ Guild3 as Guild,
3975
4164
  GuildBet,
3976
4165
  GuildBetManager,
3977
4166
  GuildBetUser,
@@ -3999,7 +4188,7 @@ export {
3999
4188
  MessagesManager,
4000
4189
  MinesGame,
4001
4190
  MinesGameManager,
4002
- REST,
4191
+ REST2 as REST,
4003
4192
  Routes,
4004
4193
  STATES,
4005
4194
  VipMember,