@duque.edits/sdk 1.3.0 → 1.3.2

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 (210) hide show
  1. package/README.md +1 -1
  2. package/dist/{index-0BFrnm6S.d.ts → index-xkfp9hFj.d.ts} +27 -22
  3. package/dist/index.d.ts +1 -1
  4. package/dist/index.js +0 -1
  5. package/dist/managers/automaticmessage/AutomaticMessageManager.d.ts +1 -1
  6. package/dist/managers/automaticmessage/AutomaticMessageManager.js +0 -1
  7. package/dist/managers/base.d.ts +1 -1
  8. package/dist/managers/base.js +0 -1
  9. package/dist/managers/bet/GuildBetManager.d.ts +1 -1
  10. package/dist/managers/bet/GuildBetManager.js +0 -1
  11. package/dist/managers/betuser/GuildBetUserManager.d.ts +1 -1
  12. package/dist/managers/betuser/GuildBetUserManager.js +0 -1
  13. package/dist/managers/buffer/BufferManager.d.ts +1 -1
  14. package/dist/managers/buffer/BufferManager.js +0 -1
  15. package/dist/managers/guild/GuildManager.d.ts +1 -1
  16. package/dist/managers/guild/GuildManager.js +0 -1
  17. package/dist/managers/index.d.ts +1 -1
  18. package/dist/managers/index.js +0 -1
  19. package/dist/managers/logs/LogManager.d.ts +1 -1
  20. package/dist/managers/logs/LogManager.js +0 -1
  21. package/dist/managers/match/GuildMatchManager.d.ts +1 -1
  22. package/dist/managers/match/GuildMatchManager.js +0 -1
  23. package/dist/managers/mediator/GuildMediatorManager.d.ts +1 -1
  24. package/dist/managers/mediator/GuildMediatorManager.js +0 -1
  25. package/dist/managers/message/MessagesManager.d.ts +1 -1
  26. package/dist/managers/message/MessagesManager.js +0 -1
  27. package/dist/managers/minesgame/MinesGameManager.d.ts +1 -1
  28. package/dist/managers/minesgame/MinesGameManager.js +0 -1
  29. package/dist/managers/permission/GuildPermissionManager.d.ts +1 -1
  30. package/dist/managers/permission/GuildPermissionManager.js +0 -1
  31. package/dist/managers/player/PlayerManager.d.ts +1 -1
  32. package/dist/managers/player/PlayerManager.js +0 -1
  33. package/dist/managers/product/ProductManager.d.ts +1 -1
  34. package/dist/managers/product/ProductManager.js +0 -1
  35. package/dist/managers/shop/ShopManager.d.ts +1 -1
  36. package/dist/managers/shop/ShopManager.js +0 -1
  37. package/dist/managers/ticket/TicketManager.d.ts +1 -1
  38. package/dist/managers/ticket/TicketManager.js +0 -1
  39. package/dist/managers/ticketpanel/TicketPanelManager.d.ts +1 -1
  40. package/dist/managers/ticketpanel/TicketPanelManager.js +0 -1
  41. package/dist/managers/tournament/TournamentManager.d.ts +1 -1
  42. package/dist/managers/tournament/TournamentManager.js +0 -1
  43. package/dist/managers/user/GuildUserManager.d.ts +1 -1
  44. package/dist/managers/user/GuildUserManager.js +5 -6
  45. package/dist/managers/vipmember/VipMemberManager.d.ts +1 -1
  46. package/dist/managers/vipmember/VipMemberManager.js +0 -1
  47. package/dist/rest/APIEndpoints.js +0 -1
  48. package/dist/rest/REST.d.ts +1 -1
  49. package/dist/rest/REST.js +0 -1
  50. package/dist/rest/Routes.d.ts +1 -1
  51. package/dist/rest/Routes.js +1 -2
  52. package/dist/rest/index.d.ts +1 -1
  53. package/dist/rest/index.js +0 -1
  54. package/dist/structures/Collection.js +0 -1
  55. package/dist/structures/automaticmessage/AutomaticMessage.d.ts +1 -1
  56. package/dist/structures/automaticmessage/AutomaticMessage.js +0 -1
  57. package/dist/structures/bet/GuildBet.d.ts +1 -1
  58. package/dist/structures/bet/GuildBet.js +0 -1
  59. package/dist/structures/betuser/GuildBetUser.d.ts +1 -1
  60. package/dist/structures/betuser/GuildBetUser.js +0 -1
  61. package/dist/structures/guild/Guild.d.ts +1 -1
  62. package/dist/structures/guild/Guild.js +2 -2
  63. package/dist/structures/index.d.ts +1 -1
  64. package/dist/structures/index.js +0 -1
  65. package/dist/structures/logentry/LogEntry.d.ts +1 -1
  66. package/dist/structures/logentry/LogEntry.js +0 -1
  67. package/dist/structures/match/GuildMatch.d.ts +1 -1
  68. package/dist/structures/match/GuildMatch.js +0 -1
  69. package/dist/structures/mediator/GuildMediator.d.ts +1 -1
  70. package/dist/structures/mediator/GuildMediator.js +0 -1
  71. package/dist/structures/minesgame/MinesGame.d.ts +1 -1
  72. package/dist/structures/minesgame/MinesGame.js +0 -1
  73. package/dist/structures/product/Product.d.ts +1 -1
  74. package/dist/structures/product/Product.js +4 -1
  75. package/dist/structures/shop/Shop.d.ts +1 -1
  76. package/dist/structures/shop/Shop.js +0 -1
  77. package/dist/structures/ticket/Ticket.d.ts +1 -1
  78. package/dist/structures/ticket/Ticket.js +9 -1
  79. package/dist/structures/ticketpanel/TicketPanel.d.ts +1 -1
  80. package/dist/structures/ticketpanel/TicketPanel.js +0 -2
  81. package/dist/structures/tournament/Tournament.d.ts +1 -1
  82. package/dist/structures/tournament/Tournament.js +0 -1
  83. package/dist/structures/user/GuildUser.d.ts +1 -1
  84. package/dist/structures/user/GuildUser.js +132 -38
  85. package/dist/structures/vipmember/VipMember.d.ts +1 -1
  86. package/dist/structures/vipmember/VipMember.js +0 -1
  87. package/dist/types/RestTypes.d.ts +1 -1
  88. package/dist/types/RestTypes.js +0 -1
  89. package/dist/types/api/APIAdvert.js +0 -1
  90. package/dist/types/api/APIAutomaticMessage.d.ts +1 -1
  91. package/dist/types/api/APIAutomaticMessage.js +0 -1
  92. package/dist/types/api/APIBaseChannel.js +0 -1
  93. package/dist/types/api/APIBetChannel.js +0 -1
  94. package/dist/types/api/APICode.js +0 -1
  95. package/dist/types/api/APIGiveaway.js +0 -1
  96. package/dist/types/api/APIGuild.d.ts +1 -1
  97. package/dist/types/api/APIGuild.js +0 -1
  98. package/dist/types/api/APIGuildAdvert.js +0 -1
  99. package/dist/types/api/APIGuildBet.d.ts +1 -1
  100. package/dist/types/api/APIGuildBet.js +0 -1
  101. package/dist/types/api/APIGuildBetUser.d.ts +1 -1
  102. package/dist/types/api/APIGuildBetUser.js +0 -1
  103. package/dist/types/api/APIGuildChannel.js +0 -1
  104. package/dist/types/api/APIGuildGroupedChannel.d.ts +1 -1
  105. package/dist/types/api/APIGuildGroupedChannel.js +0 -1
  106. package/dist/types/api/APIGuildMatch.d.ts +1 -1
  107. package/dist/types/api/APIGuildMatch.js +0 -1
  108. package/dist/types/api/APIGuildMediator.js +0 -1
  109. package/dist/types/api/APIGuildPermissions.js +0 -1
  110. package/dist/types/api/APIGuildShop.js +0 -1
  111. package/dist/types/api/APIGuildTicket.js +0 -1
  112. package/dist/types/api/APIGuildUser.d.ts +1 -1
  113. package/dist/types/api/APIGuildUser.js +0 -1
  114. package/dist/types/api/APILogEntry.js +0 -1
  115. package/dist/types/api/APIMessage.js +0 -1
  116. package/dist/types/api/APIMinesGame.js +0 -1
  117. package/dist/types/api/APIPlayer.js +0 -1
  118. package/dist/types/api/APIProduct.d.ts +1 -0
  119. package/dist/types/api/APIProduct.js +0 -1
  120. package/dist/types/api/APITicketPanel.d.ts +1 -1
  121. package/dist/types/api/APITicketPanel.js +0 -1
  122. package/dist/types/api/APITournament.js +0 -1
  123. package/dist/types/api/APIVipMember.js +0 -1
  124. package/dist/types/api/index.d.ts +1 -1
  125. package/dist/types/api/index.js +8 -10
  126. package/dist/types/index.d.ts +1 -1
  127. package/dist/types/index.js +0 -1
  128. package/dist/utils/Assertion.js +0 -1
  129. package/dist/utils/clamp0.d.ts +3 -0
  130. package/dist/utils/clamp0.js +31 -0
  131. package/dist/utils/getRandomNumber.js +0 -1
  132. package/dist/utils/isSameDayUTC.js +0 -1
  133. package/dist/utils/randomKeyGenerator.js +0 -1
  134. package/package.json +1 -1
  135. package/dist/index.js.map +0 -1
  136. package/dist/managers/automaticmessage/AutomaticMessageManager.js.map +0 -1
  137. package/dist/managers/base.js.map +0 -1
  138. package/dist/managers/bet/GuildBetManager.js.map +0 -1
  139. package/dist/managers/betuser/GuildBetUserManager.js.map +0 -1
  140. package/dist/managers/buffer/BufferManager.js.map +0 -1
  141. package/dist/managers/guild/GuildManager.js.map +0 -1
  142. package/dist/managers/index.js.map +0 -1
  143. package/dist/managers/logs/LogManager.js.map +0 -1
  144. package/dist/managers/match/GuildMatchManager.js.map +0 -1
  145. package/dist/managers/mediator/GuildMediatorManager.js.map +0 -1
  146. package/dist/managers/message/MessagesManager.js.map +0 -1
  147. package/dist/managers/minesgame/MinesGameManager.js.map +0 -1
  148. package/dist/managers/permission/GuildPermissionManager.js.map +0 -1
  149. package/dist/managers/player/PlayerManager.js.map +0 -1
  150. package/dist/managers/product/ProductManager.js.map +0 -1
  151. package/dist/managers/shop/ShopManager.js.map +0 -1
  152. package/dist/managers/ticket/TicketManager.js.map +0 -1
  153. package/dist/managers/ticketpanel/TicketPanelManager.js.map +0 -1
  154. package/dist/managers/tournament/TournamentManager.js.map +0 -1
  155. package/dist/managers/user/GuildUserManager.js.map +0 -1
  156. package/dist/managers/vipmember/VipMemberManager.js.map +0 -1
  157. package/dist/rest/APIEndpoints.js.map +0 -1
  158. package/dist/rest/REST.js.map +0 -1
  159. package/dist/rest/Routes.js.map +0 -1
  160. package/dist/rest/index.js.map +0 -1
  161. package/dist/structures/Collection.js.map +0 -1
  162. package/dist/structures/automaticmessage/AutomaticMessage.js.map +0 -1
  163. package/dist/structures/bet/GuildBet.js.map +0 -1
  164. package/dist/structures/betuser/GuildBetUser.js.map +0 -1
  165. package/dist/structures/guild/Guild.js.map +0 -1
  166. package/dist/structures/index.js.map +0 -1
  167. package/dist/structures/logentry/LogEntry.js.map +0 -1
  168. package/dist/structures/match/GuildMatch.js.map +0 -1
  169. package/dist/structures/mediator/GuildMediator.js.map +0 -1
  170. package/dist/structures/minesgame/MinesGame.js.map +0 -1
  171. package/dist/structures/product/Product.js.map +0 -1
  172. package/dist/structures/shop/Shop.js.map +0 -1
  173. package/dist/structures/ticket/Ticket.js.map +0 -1
  174. package/dist/structures/ticketpanel/TicketPanel.js.map +0 -1
  175. package/dist/structures/tournament/Tournament.js.map +0 -1
  176. package/dist/structures/user/GuildUser.js.map +0 -1
  177. package/dist/structures/vipmember/VipMember.js.map +0 -1
  178. package/dist/types/RestTypes.js.map +0 -1
  179. package/dist/types/api/APIAdvert.js.map +0 -1
  180. package/dist/types/api/APIAutomaticMessage.js.map +0 -1
  181. package/dist/types/api/APIBaseChannel.js.map +0 -1
  182. package/dist/types/api/APIBetChannel.js.map +0 -1
  183. package/dist/types/api/APICode.js.map +0 -1
  184. package/dist/types/api/APIGiveaway.js.map +0 -1
  185. package/dist/types/api/APIGuild.js.map +0 -1
  186. package/dist/types/api/APIGuildAdvert.js.map +0 -1
  187. package/dist/types/api/APIGuildBet.js.map +0 -1
  188. package/dist/types/api/APIGuildBetUser.js.map +0 -1
  189. package/dist/types/api/APIGuildChannel.js.map +0 -1
  190. package/dist/types/api/APIGuildGroupedChannel.js.map +0 -1
  191. package/dist/types/api/APIGuildMatch.js.map +0 -1
  192. package/dist/types/api/APIGuildMediator.js.map +0 -1
  193. package/dist/types/api/APIGuildPermissions.js.map +0 -1
  194. package/dist/types/api/APIGuildShop.js.map +0 -1
  195. package/dist/types/api/APIGuildTicket.js.map +0 -1
  196. package/dist/types/api/APIGuildUser.js.map +0 -1
  197. package/dist/types/api/APILogEntry.js.map +0 -1
  198. package/dist/types/api/APIMessage.js.map +0 -1
  199. package/dist/types/api/APIMinesGame.js.map +0 -1
  200. package/dist/types/api/APIPlayer.js.map +0 -1
  201. package/dist/types/api/APIProduct.js.map +0 -1
  202. package/dist/types/api/APITicketPanel.js.map +0 -1
  203. package/dist/types/api/APITournament.js.map +0 -1
  204. package/dist/types/api/APIVipMember.js.map +0 -1
  205. package/dist/types/api/index.js.map +0 -1
  206. package/dist/types/index.js.map +0 -1
  207. package/dist/utils/Assertion.js.map +0 -1
  208. package/dist/utils/getRandomNumber.js.map +0 -1
  209. package/dist/utils/isSameDayUTC.js.map +0 -1
  210. package/dist/utils/randomKeyGenerator.js.map +0 -1
@@ -50,4 +50,3 @@ __reExport(structures_exports, require("./Collection"), module.exports);
50
50
  ...require("./shop/Shop"),
51
51
  ...require("./Collection")
52
52
  });
53
- //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- export { a2 as LogEntry } from '../../index-0BFrnm6S.js';
1
+ export { a0 as LogEntry } from '../../index-xkfp9hFj.js';
2
2
  import '../../types/api/APILogEntry.js';
3
3
  import '../../types/api/APIAdvert.js';
4
4
  import '../../types/api/APIBaseChannel.js';
@@ -107,4 +107,3 @@ update_fn = function(data) {
107
107
  0 && (module.exports = {
108
108
  LogEntry
109
109
  });
110
- //# sourceMappingURL=LogEntry.js.map
@@ -1,4 +1,4 @@
1
- export { M as GuildMatch } from '../../index-0BFrnm6S.js';
1
+ export { K as GuildMatch } from '../../index-xkfp9hFj.js';
2
2
  import '../../types/api/APIPlayer.js';
3
3
  import '../../types/api/APIBaseChannel.js';
4
4
  import '../../types/api/APIAdvert.js';
@@ -302,4 +302,3 @@ let GuildMatch = _GuildMatch;
302
302
  0 && (module.exports = {
303
303
  GuildMatch
304
304
  });
305
- //# sourceMappingURL=GuildMatch.js.map
@@ -1,4 +1,4 @@
1
- export { Q as GuildMediator } from '../../index-0BFrnm6S.js';
1
+ export { O as GuildMediator } from '../../index-xkfp9hFj.js';
2
2
  import '../../types/api/APIGuildMediator.js';
3
3
  import '../../types/api/APIAdvert.js';
4
4
  import '../../types/api/APIBaseChannel.js';
@@ -164,4 +164,3 @@ let GuildMediator = _GuildMediator;
164
164
  0 && (module.exports = {
165
165
  GuildMediator
166
166
  });
167
- //# sourceMappingURL=GuildMediator.js.map
@@ -1,4 +1,4 @@
1
- export { aa as MinesGame } from '../../index-0BFrnm6S.js';
1
+ export { a8 as MinesGame } from '../../index-xkfp9hFj.js';
2
2
  import '../../types/api/APIMinesGame.js';
3
3
  import '../../types/api/APIAdvert.js';
4
4
  import '../../types/api/APIBaseChannel.js';
@@ -103,4 +103,3 @@ update_fn = function(data) {
103
103
  0 && (module.exports = {
104
104
  MinesGame
105
105
  });
106
- //# sourceMappingURL=MinesGame.js.map
@@ -1,4 +1,4 @@
1
- export { ah as Product } from '../../index-0BFrnm6S.js';
1
+ export { af as Product } from '../../index-xkfp9hFj.js';
2
2
  import '../../types/api/APIPlayer.js';
3
3
  import '../../types/api/APIProduct.js';
4
4
  import '../../types/api/APIAdvert.js';
@@ -45,6 +45,7 @@ class Product {
45
45
  __publicField(this, "buyers");
46
46
  /** Product's emoji */
47
47
  __publicField(this, "emoji");
48
+ __publicField(this, "units_in_stock");
48
49
  /** Creation Date */
49
50
  __publicField(this, "createdAt");
50
51
  /** Updated Date */
@@ -61,6 +62,7 @@ class Product {
61
62
  this.buyers = data?.buyers;
62
63
  this.emoji = data?.emoji;
63
64
  this.price = data?.price;
65
+ this.units_in_stock = data?.units_in_stock;
64
66
  this.createdAt = data?.createdAt ? new Date(data?.createdAt) : /* @__PURE__ */ new Date();
65
67
  this.updatedAt = data?.updatedAt ? new Date(data?.updatedAt) : /* @__PURE__ */ new Date();
66
68
  }
@@ -77,6 +79,7 @@ class Product {
77
79
  buyers: data.buyers || this.buyers,
78
80
  emoji: data.emoji || this.emoji,
79
81
  price: data.price || this.price,
82
+ units_in_stock: data.units_in_stock || this.units_in_stock,
80
83
  createdAt: this.createdAt,
81
84
  updatedAt: data.updatedAt || this.updatedAt
82
85
  };
@@ -94,6 +97,7 @@ class Product {
94
97
  emoji: this.emoji,
95
98
  name: this.name,
96
99
  price: this.price,
100
+ units_in_stock: this.units_in_stock,
97
101
  createdAt: this.createdAt,
98
102
  updatedAt: this.updatedAt
99
103
  };
@@ -117,4 +121,3 @@ update_fn = async function(data) {
117
121
  0 && (module.exports = {
118
122
  Product
119
123
  });
120
- //# sourceMappingURL=Product.js.map
@@ -1,5 +1,5 @@
1
1
  import 'discord-api-types/v10';
2
- export { ap as Shop } from '../../index-0BFrnm6S.js';
2
+ export { an as Shop } from '../../index-xkfp9hFj.js';
3
3
  import '../../types/api/APIGuildShop.js';
4
4
  import '../../types/api/APIAdvert.js';
5
5
  import '../../types/api/APIBaseChannel.js';
@@ -122,4 +122,3 @@ update_fn = function(data) {
122
122
  0 && (module.exports = {
123
123
  Shop
124
124
  });
125
- //# sourceMappingURL=Shop.js.map
@@ -1,4 +1,4 @@
1
- export { Z as GuildTicket } from '../../index-0BFrnm6S.js';
1
+ export { X as GuildTicket } from '../../index-xkfp9hFj.js';
2
2
  import '../../types/api/APIGuildTicket.js';
3
3
  import '../../types/api/APIAdvert.js';
4
4
  import '../../types/api/APIBaseChannel.js';
@@ -74,6 +74,15 @@ class GuildTicket {
74
74
  });
75
75
  return __privateMethod(this, _GuildTicket_instances, update_fn).call(this, response);
76
76
  }
77
+ async delete() {
78
+ this.manager.cache.delete(this._id);
79
+ const url = import_rest.Routes.guilds.tickets.get(this.guild.id, this._id);
80
+ const response = await this.rest.request({
81
+ method: "delete",
82
+ url
83
+ });
84
+ return response;
85
+ }
77
86
  async setCustomerRating(rating) {
78
87
  const url = import_rest.Routes.guilds.tickets.resource(this.guild.id, this._id, "customer_rating");
79
88
  const payload = { set: rating };
@@ -144,4 +153,3 @@ update_fn = function(data) {
144
153
  0 && (module.exports = {
145
154
  GuildTicket
146
155
  });
147
- //# sourceMappingURL=Ticket.js.map
@@ -1,5 +1,5 @@
1
1
  import 'discord-api-types/v10';
2
- export { at as TicketPanel } from '../../index-0BFrnm6S.js';
2
+ export { ar as TicketPanel } from '../../index-xkfp9hFj.js';
3
3
  import '../../types/api/APIAdvert.js';
4
4
  import '../../types/api/APIBaseChannel.js';
5
5
  import '../../types/api/APIBetChannel.js';
@@ -107,7 +107,6 @@ class TicketPanel {
107
107
  cat.role_ids = [.../* @__PURE__ */ new Set([...roles])];
108
108
  this.categories[index] = cat;
109
109
  }
110
- console.dir({ categories: this.categories }, { depth: null });
111
110
  return await this.update({ categories: this.categories });
112
111
  }
113
112
  async removeRoleIdToCategory(id, ...roles) {
@@ -174,4 +173,3 @@ update_fn = function(data) {
174
173
  0 && (module.exports = {
175
174
  TicketPanel
176
175
  });
177
- //# sourceMappingURL=TicketPanel.js.map
@@ -1,4 +1,4 @@
1
- export { av as Tournament } from '../../index-0BFrnm6S.js';
1
+ export { at as Tournament } from '../../index-xkfp9hFj.js';
2
2
  import '../../types/api/APIPlayer.js';
3
3
  import '../../types/api/APITournament.js';
4
4
  import '../../types/api/APIAdvert.js';
@@ -111,4 +111,3 @@ update_fn = function(data) {
111
111
  0 && (module.exports = {
112
112
  Tournament
113
113
  });
114
- //# sourceMappingURL=Tournament.js.map
@@ -1,4 +1,4 @@
1
- export { i as AccReturn, a0 as GuildUser } from '../../index-0BFrnm6S.js';
1
+ export { _ as GuildUser } from '../../index-xkfp9hFj.js';
2
2
  import '../../types/api/APIAdvert.js';
3
3
  import '../../types/api/APIBaseChannel.js';
4
4
  import '../../types/api/APIBetChannel.js';
@@ -31,6 +31,7 @@ __export(GuildUser_exports, {
31
31
  module.exports = __toCommonJS(GuildUser_exports);
32
32
  var import_Routes = require("../../rest/Routes");
33
33
  var import_isSameDayUTC = require("../../utils/isSameDayUTC");
34
+ var import_clamp0 = require("../../utils/clamp0");
34
35
  var _GuildUser_instances, update_fn;
35
36
  const _GuildUser = class _GuildUser {
36
37
  /**
@@ -167,11 +168,13 @@ const _GuildUser = class _GuildUser {
167
168
  profile: {
168
169
  avatarUrl: data.avatarUrl || this.profile.avatarUrl || "",
169
170
  bannerUrl: data.bannerUrl || this.profile.bannerUrl || "",
170
- bio: data.bio || this.profile.bio || "Melhor da minha aldeia (use !bio para alterar)",
171
+ bio: data.bio || this.profile.bio || "Melhorzinho(a) do momento!",
171
172
  name: data.name || this.profile.name || "",
173
+ extra: data.extra || this.profile.extra || "",
172
174
  textColor: data.textColor || this.profile.textColor || "#ffffff",
173
175
  primaryColor: data.primaryColor || this.profile.primaryColor || "#272727",
174
176
  secondaryColor: data.secondaryColor || this.profile.secondaryColor || "#151515",
177
+ tertiaryColor: data.tertiaryColor || this.profile.tertiaryColor || "#151515",
175
178
  booster: {
176
179
  expires: data?.booster?.expires || this.profile.booster.expires,
177
180
  status: data?.booster?.status || this.profile.booster.status || "off"
@@ -191,7 +194,8 @@ const _GuildUser = class _GuildUser {
191
194
  name: "",
192
195
  textColor: "#ffffff",
193
196
  primaryColor: "#272727",
194
- secondaryColor: "#151515"
197
+ secondaryColor: "#151515",
198
+ tertiaryColor: "#272727"
195
199
  }
196
200
  };
197
201
  }
@@ -211,39 +215,117 @@ const _GuildUser = class _GuildUser {
211
215
  acc = {
212
216
  type,
213
217
  time: 0,
214
- units: 0
218
+ units: 0,
219
+ active: {
220
+ time: 0,
221
+ units: 0
222
+ }
215
223
  };
216
224
  this.accessories.push(acc);
217
- await this.update({ accessories: this.accessories });
225
+ await this.setUpdate({ accessories: this.accessories });
218
226
  return acc;
219
227
  }
220
228
  async addAccessory(type, data) {
221
- const { units, time } = data;
222
- let acc = this.accessories.find((a) => a.type === type);
223
- if (!acc) acc = { type, units, time };
229
+ const { units, time, active } = data;
230
+ let acc = this?.accessories?.find((a) => a.type === type);
231
+ if (!acc) acc = { type, units, time, active };
224
232
  else
225
233
  acc = {
226
234
  type,
227
- time: Math.max(0, acc.time + time),
228
- units: Math.max(0, acc.units + units)
235
+ time: (0, import_clamp0.clamp0)(0, acc.time + (time || 0)),
236
+ units: (0, import_clamp0.clamp0)(0, acc.units + (units || 0)),
237
+ active: {
238
+ time: active && active?.time ? (0, import_clamp0.clamp0)(acc?.active?.time || 0 + active.time || 0) : 0,
239
+ units: active && active?.units ? (0, import_clamp0.clamp0)(acc?.active?.units || 0 + active.units || 0) : 0
240
+ }
229
241
  };
230
242
  const index = this.accessories.findIndex((a) => a.type === type);
231
243
  this.accessories[index] = acc;
232
- return await this.update({ accessories: this.accessories });
244
+ await this.setUpdate({ accessories: this.accessories });
245
+ return acc;
233
246
  }
234
- async removeAccessory(type, data) {
235
- const { units, time } = data;
247
+ async setAccessory(type, data) {
248
+ const { units, time, active } = data;
236
249
  let acc = this.accessories.find((a) => a.type === type);
237
- if (!acc) acc = { type, units, time };
238
- else
250
+ const payload = {
251
+ type,
252
+ units: units !== void 0 ? units : acc?.units || 0,
253
+ time: time !== void 0 ? time : acc?.time || 0,
254
+ active: {
255
+ time: active?.time !== void 0 ? active?.time : acc?.active?.time || 0,
256
+ units: active?.units !== void 0 ? active?.units : acc?.active?.units || 0
257
+ }
258
+ };
259
+ if (!acc) acc = payload;
260
+ else acc = payload;
261
+ const index = this.accessories.findIndex((a) => a.type === type);
262
+ this.accessories[index] = acc;
263
+ await this.setUpdate({ accessories: this.accessories });
264
+ return acc;
265
+ }
266
+ async reduceAccessory(type, data) {
267
+ const { units = 0, time = 0 } = data;
268
+ let acc = this.accessories.find((a) => a.type === type);
269
+ if (!acc) {
239
270
  acc = {
240
271
  type,
241
- time: Math.max(0, acc.time - time),
242
- units: Math.max(0, acc.units - units)
272
+ units: 0,
273
+ time: 0,
274
+ active: { time: 0, units: 0 }
243
275
  };
276
+ }
277
+ acc = {
278
+ type,
279
+ time: (0, import_clamp0.clamp0)(acc.time - time),
280
+ units: (0, import_clamp0.clamp0)(acc.units - units),
281
+ active: acc.active
282
+ };
283
+ const index = this.accessories.findIndex((a) => a.type === type);
284
+ this.accessories[index] = acc;
285
+ await this.setUpdate({ accessories: this.accessories });
286
+ return acc;
287
+ }
288
+ async reduceActiveAccessory(type, data) {
289
+ const { units = 0, time = 0 } = data;
290
+ let acc = await this.getAccessory(type);
291
+ acc = {
292
+ ...acc,
293
+ active: {
294
+ time: (0, import_clamp0.clamp0)(acc?.active?.time - time),
295
+ units: (0, import_clamp0.clamp0)(acc?.active?.units - units)
296
+ }
297
+ };
244
298
  const index = this.accessories.findIndex((a) => a.type === type);
245
299
  this.accessories[index] = acc;
246
- return await this.update({ accessories: this.accessories });
300
+ await this.setUpdate({ accessories: this.accessories });
301
+ return acc;
302
+ }
303
+ async activateAccessory(type, data) {
304
+ const acc = await this.reduceAccessory(type, data);
305
+ const timeToAdd = (0, import_clamp0.clamp0)(data.time);
306
+ const unitsToAdd = (0, import_clamp0.clamp0)(acc.active.units + data.units);
307
+ const _dateBefore = new Date(acc.active.time === 0 ? Date.now() : acc.active.time);
308
+ const dateBefore = _dateBefore.getTime() <= Date.now() ? /* @__PURE__ */ new Date() : _dateBefore;
309
+ const finalTime = dateBefore.getTime() + timeToAdd;
310
+ acc.active = { time: finalTime, units: unitsToAdd };
311
+ const index = this.accessories.findIndex((a) => a.type === type);
312
+ this.accessories[index] = acc;
313
+ await this.setUpdate({ accessories: this.accessories });
314
+ return acc;
315
+ }
316
+ async isAccessoryActive(type) {
317
+ const acc = await this.getAccessory(type);
318
+ if (acc.active.time === 0 && acc.active.units === 0) return { value: false, type: "both" };
319
+ const hasTimeExpired = new Date(acc.active.time).getTime() <= Date.now();
320
+ if (hasTimeExpired && acc.units === 0) return { value: false, type: "both" };
321
+ if (!hasTimeExpired && acc.units === 0) return { value: true, type: "time" };
322
+ if (hasTimeExpired && acc.units !== 0) return { value: true, type: "units" };
323
+ return { value: true, type: "units" };
324
+ }
325
+ async hasAccessory(type) {
326
+ const acc = await this.getAccessory(type);
327
+ if (acc?.time === 0 && acc?.units === 0) return false;
328
+ else return true;
247
329
  }
248
330
  async addAdvert(data) {
249
331
  const url = import_Routes.Routes.guilds.users.resource(this.manager.guild.id, this.id, "adverts");
@@ -280,7 +362,7 @@ const _GuildUser = class _GuildUser {
280
362
  "coins",
281
363
  "consecutive_wins"
282
364
  ];
283
- const arrayFields = ["items", "original_channels", "adverts", "accessories", "used_codes"];
365
+ const arrayFields = ["items", "original_channels", "adverts", "used_codes"];
284
366
  if (data?.type === "add" || data?.type === "remove") {
285
367
  for (const key in data) {
286
368
  if (key === "type") continue;
@@ -314,6 +396,7 @@ const _GuildUser = class _GuildUser {
314
396
  }
315
397
  }
316
398
  }
399
+ if ("accessories" in data) payload["accessories"] = data["accessories"];
317
400
  payload["daily"] = this.userDailyWrapper(data).daily;
318
401
  payload["consecutive_wins"] = this.userDailyWrapper(data).consecutive_wins;
319
402
  const response = await this.rest.request({
@@ -321,8 +404,7 @@ const _GuildUser = class _GuildUser {
321
404
  url,
322
405
  payload
323
406
  });
324
- __privateMethod(this, _GuildUser_instances, update_fn).call(this, response);
325
- return this;
407
+ return __privateMethod(this, _GuildUser_instances, update_fn).call(this, response);
326
408
  }
327
409
  async setUpdate(data) {
328
410
  const url = import_Routes.Routes.guilds.users.get(this.manager.guild.id, this.id);
@@ -345,20 +427,33 @@ const _GuildUser = class _GuildUser {
345
427
  return response;
346
428
  }
347
429
  toJSON() {
348
- let json = {};
349
- for (const [key, value] of Object.entries(this)) {
350
- const exclude = ["rest", "guilds", "guild", "manager"];
351
- if (exclude.includes(key)) continue;
352
- if (typeof value !== "function") {
353
- json[key] = value;
354
- }
355
- }
356
- return json;
430
+ return {
431
+ accessories: this.accessories,
432
+ adverts: this.adverts,
433
+ blacklist: this.blacklist,
434
+ coins: this.coins,
435
+ consecutive_wins: this.consecutive_wins,
436
+ createdAt: this.createdAt,
437
+ creations: this.creations,
438
+ daily: this.daily,
439
+ games: this.games,
440
+ guild_id: this.guild_id,
441
+ id: this.id,
442
+ losses: this.losses,
443
+ mvps: this.mvps,
444
+ original_channels: this.original_channels,
445
+ points: this.points,
446
+ profile: this.profile,
447
+ spins: this.spins,
448
+ updatedAt: this.updatedAt,
449
+ used_codes: this.used_codes,
450
+ wins: this.wins
451
+ };
357
452
  }
358
453
  userDailyWrapper(user) {
359
454
  const now = /* @__PURE__ */ new Date();
360
455
  const sameDay = !!this.daily?.date && (0, import_isSameDayUTC.isSameDateUTC)(this.daily.date, now);
361
- const clamp0 = (n) => Math.max(0, n);
456
+ const clamp02 = (n) => Math.max(0, n);
362
457
  const prev = this.daily ?? { points: 0, wins: 0, coins: 0, losses: 0, mvps: 0 };
363
458
  const inc = {
364
459
  points: user?.points || 0,
@@ -368,16 +463,16 @@ const _GuildUser = class _GuildUser {
368
463
  mvps: user?.mvps || 0
369
464
  };
370
465
  user.daily = {
371
- points: clamp0((sameDay ? prev.points : 0) + inc.points),
372
- wins: clamp0((sameDay ? prev.wins : 0) + inc.wins),
373
- coins: clamp0((sameDay ? prev.coins : 0) + inc.coins),
374
- losses: clamp0((sameDay ? prev.losses : 0) + inc.losses),
375
- mvps: clamp0((sameDay ? prev.mvps : 0) + inc.mvps),
466
+ points: clamp02((sameDay ? prev.points : 0) + inc.points),
467
+ wins: clamp02((sameDay ? prev.wins : 0) + inc.wins),
468
+ coins: clamp02((sameDay ? prev.coins : 0) + inc.coins),
469
+ losses: clamp02((sameDay ? prev.losses : 0) + inc.losses),
470
+ mvps: clamp02((sameDay ? prev.mvps : 0) + inc.mvps),
376
471
  date: now
377
472
  };
378
473
  const gainedWins = inc.wins;
379
- const hasLostToday = inc.losses > 0;
380
- user.consecutive_wins = hasLostToday ? 0 : (this.consecutive_wins || 0) + gainedWins;
474
+ const hasLostToday = user.losses !== 0;
475
+ user.consecutive_wins = hasLostToday && !gainedWins ? 0 : (this.consecutive_wins || 0) + 1;
381
476
  return user;
382
477
  }
383
478
  };
@@ -416,4 +511,3 @@ let GuildUser = _GuildUser;
416
511
  0 && (module.exports = {
417
512
  GuildUser
418
513
  });
419
- //# sourceMappingURL=GuildUser.js.map
@@ -1,4 +1,4 @@
1
- export { ay as VipMember } from '../../index-0BFrnm6S.js';
1
+ export { aw as VipMember } from '../../index-xkfp9hFj.js';
2
2
  import '../../types/api/APIVipMember.js';
3
3
  import '../../types/api/APIAdvert.js';
4
4
  import '../../types/api/APIBaseChannel.js';
@@ -168,4 +168,3 @@ let VipMember = _VipMember;
168
168
  0 && (module.exports = {
169
169
  VipMember
170
170
  });
171
- //# sourceMappingURL=VipMember.js.map
@@ -1,5 +1,5 @@
1
1
  import '../structures/Collection.js';
2
- export { ak as RequestOptions, al as RestEvents } from '../index-0BFrnm6S.js';
2
+ export { ai as RequestOptions, aj as RestEvents } from '../index-xkfp9hFj.js';
3
3
  import './api/APIAdvert.js';
4
4
  import './api/APIBaseChannel.js';
5
5
  import './api/APIBetChannel.js';
@@ -14,4 +14,3 @@ var __copyProps = (to, from, except, desc) => {
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
15
  var RestTypes_exports = {};
16
16
  module.exports = __toCommonJS(RestTypes_exports);
17
- //# sourceMappingURL=RestTypes.js.map
@@ -14,4 +14,3 @@ var __copyProps = (to, from, except, desc) => {
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
15
  var APIAdvert_exports = {};
16
16
  module.exports = __toCommonJS(APIAdvert_exports);
17
- //# sourceMappingURL=APIAdvert.js.map
@@ -1,5 +1,5 @@
1
1
  import 'discord-api-types/v10';
2
- export { A as APIAutomaticMessage } from '../../index-0BFrnm6S.js';
2
+ export { A as APIAutomaticMessage } from '../../index-xkfp9hFj.js';
3
3
  import './APIAdvert.js';
4
4
  import './APIBaseChannel.js';
5
5
  import './APIBetChannel.js';
@@ -14,4 +14,3 @@ var __copyProps = (to, from, except, desc) => {
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
15
  var APIAutomaticMessage_exports = {};
16
16
  module.exports = __toCommonJS(APIAutomaticMessage_exports);
17
- //# sourceMappingURL=APIAutomaticMessage.js.map
@@ -14,4 +14,3 @@ var __copyProps = (to, from, except, desc) => {
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
15
  var APIBaseChannel_exports = {};
16
16
  module.exports = __toCommonJS(APIBaseChannel_exports);
17
- //# sourceMappingURL=APIBaseChannel.js.map
@@ -14,4 +14,3 @@ var __copyProps = (to, from, except, desc) => {
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
15
  var APIBetChannel_exports = {};
16
16
  module.exports = __toCommonJS(APIBetChannel_exports);
17
- //# sourceMappingURL=APIBetChannel.js.map
@@ -14,4 +14,3 @@ var __copyProps = (to, from, except, desc) => {
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
15
  var APICode_exports = {};
16
16
  module.exports = __toCommonJS(APICode_exports);
17
- //# sourceMappingURL=APICode.js.map
@@ -14,4 +14,3 @@ var __copyProps = (to, from, except, desc) => {
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
15
  var APIGiveaway_exports = {};
16
16
  module.exports = __toCommonJS(APIGiveaway_exports);
17
- //# sourceMappingURL=APIGiveaway.js.map
@@ -1,4 +1,4 @@
1
- export { a as APIGuild, n as AutomaticMessagesTypes, x as DailyCategories, J as GuildChannelsType, K as GuildLogsWebhookUrls, T as GuildModes, V as GuildPrices, W as GuildScores, X as GuildStatus, Y as GuildStatusEnum, _ as GuildTicketConfiguration, am as RoulettePrize, an as RouletteSettings } from '../../index-0BFrnm6S.js';
1
+ export { a as APIGuild, l as AutomaticMessagesTypes, v as DailyCategories, H as GuildChannelsType, I as GuildLogsWebhookUrls, Q as GuildModes, T as GuildPrices, U as GuildScores, V as GuildStatus, W as GuildStatusEnum, Y as GuildTicketConfiguration, ak as RoulettePrize, al as RouletteSettings } from '../../index-xkfp9hFj.js';
2
2
  import './APIGuildPermissions.js';
3
3
  import './APIGuildAdvert.js';
4
4
  import './APICode.js';
@@ -70,4 +70,3 @@ var GuildChannelsType = /* @__PURE__ */ ((GuildChannelsType2) => {
70
70
  GuildChannelsType,
71
71
  GuildStatusEnum
72
72
  });
73
- //# sourceMappingURL=APIGuild.js.map
@@ -14,4 +14,3 @@ var __copyProps = (to, from, except, desc) => {
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
15
  var APIGuildAdvert_exports = {};
16
16
  module.exports = __toCommonJS(APIGuildAdvert_exports);
17
- //# sourceMappingURL=APIGuildAdvert.js.map
@@ -1,4 +1,4 @@
1
- export { b as APIGuildBet, s as BetChannelTypes, t as BetQueue } from '../../index-0BFrnm6S.js';
1
+ export { b as APIGuildBet, q as BetChannelTypes, r as BetQueue } from '../../index-xkfp9hFj.js';
2
2
  import './APIBetChannel.js';
3
3
  import './APIMessage.js';
4
4
  import './APIPlayer.js';
@@ -29,4 +29,3 @@ var BetChannelTypes = /* @__PURE__ */ ((BetChannelTypes2) => {
29
29
  0 && (module.exports = {
30
30
  BetChannelTypes
31
31
  });
32
- //# sourceMappingURL=APIGuildBet.js.map
@@ -1,4 +1,4 @@
1
- export { c as APIGuildBetUser } from '../../index-0BFrnm6S.js';
1
+ export { c as APIGuildBetUser } from '../../index-xkfp9hFj.js';
2
2
  import './APIAdvert.js';
3
3
  import './APIBaseChannel.js';
4
4
  import './APIBetChannel.js';
@@ -14,4 +14,3 @@ var __copyProps = (to, from, except, desc) => {
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
15
  var APIGuildBetUser_exports = {};
16
16
  module.exports = __toCommonJS(APIGuildBetUser_exports);
17
- //# sourceMappingURL=APIGuildBetUser.js.map
@@ -14,4 +14,3 @@ var __copyProps = (to, from, except, desc) => {
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
15
  var APIGuildChannel_exports = {};
16
16
  module.exports = __toCommonJS(APIGuildChannel_exports);
17
- //# sourceMappingURL=APIGuildChannel.js.map
@@ -1,4 +1,4 @@
1
- export { d as APIGuildGroupedChannel } from '../../index-0BFrnm6S.js';
1
+ export { d as APIGuildGroupedChannel } from '../../index-xkfp9hFj.js';
2
2
  import './APIAdvert.js';
3
3
  import './APIBaseChannel.js';
4
4
  import './APIBetChannel.js';
@@ -14,4 +14,3 @@ var __copyProps = (to, from, except, desc) => {
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
15
  var APIGuildGroupedChannel_exports = {};
16
16
  module.exports = __toCommonJS(APIGuildGroupedChannel_exports);
17
- //# sourceMappingURL=APIGuildGroupedChannel.js.map
@@ -1,4 +1,4 @@
1
- export { e as APIGuildMatch, N as GuildMatchChannelsType, P as GuildMatchMessagesType, a8 as MatchSelection } from '../../index-0BFrnm6S.js';
1
+ export { e as APIGuildMatch, L as GuildMatchChannelsType, N as GuildMatchMessagesType, a6 as MatchSelection } from '../../index-xkfp9hFj.js';
2
2
  import './APIPlayer.js';
3
3
  import './APIBaseChannel.js';
4
4
  import './APIMessage.js';
@@ -36,4 +36,3 @@ var GuildMatchMessagesType = /* @__PURE__ */ ((GuildMatchMessagesType2) => {
36
36
  GuildMatchChannelsType,
37
37
  GuildMatchMessagesType
38
38
  });
39
- //# sourceMappingURL=APIGuildMatch.js.map
@@ -14,4 +14,3 @@ var __copyProps = (to, from, except, desc) => {
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
15
  var APIGuildMediator_exports = {};
16
16
  module.exports = __toCommonJS(APIGuildMediator_exports);
17
- //# sourceMappingURL=APIGuildMediator.js.map
@@ -50,4 +50,3 @@ var GuildPermissionsTypes = /* @__PURE__ */ ((GuildPermissionsTypes2) => {
50
50
  0 && (module.exports = {
51
51
  GuildPermissionsTypes
52
52
  });
53
- //# sourceMappingURL=APIGuildPermissions.js.map
@@ -14,4 +14,3 @@ var __copyProps = (to, from, except, desc) => {
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
15
  var APIGuildShop_exports = {};
16
16
  module.exports = __toCommonJS(APIGuildShop_exports);
17
- //# sourceMappingURL=APIGuildShop.js.map
@@ -14,4 +14,3 @@ var __copyProps = (to, from, except, desc) => {
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
15
  var APIGuildTicket_exports = {};
16
16
  module.exports = __toCommonJS(APIGuildTicket_exports);
17
- //# sourceMappingURL=APIGuildTicket.js.map