@duque.edits/sdk 0.1.1 → 0.1.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.
@@ -184,6 +184,8 @@ class GuildBet {
184
184
  method: "DELETE",
185
185
  url: route,
186
186
  });
187
+ this.manager.cache.delete(this?._id);
188
+ this.rest.bets.delete(this?._id);
187
189
  return response;
188
190
  }
189
191
  async addChannel(id, type) {
@@ -196,7 +196,6 @@ class GuildBetUser {
196
196
  });
197
197
  this.rest.emit("betUserDelete", this);
198
198
  this.manager.cache.delete(this.id);
199
- this.rest.betUsers.set(this.id, this);
200
199
  return response;
201
200
  }
202
201
  toJSON() {
@@ -80,5 +80,6 @@ export declare class GuildMatch {
80
80
  addPlayer(id: string, name: string): Promise<GuildMatch>;
81
81
  removePlayer(id: string, name: string): Promise<GuildMatch>;
82
82
  update(data: Optional<APIGuildMatch>): Promise<GuildMatch>;
83
+ delete(): Promise<boolean>;
83
84
  toJSON(): Record<string, unknown>;
84
85
  }
@@ -314,6 +314,16 @@ class GuildMatch {
314
314
  this.rest.matches.set(this._id, this);
315
315
  return this;
316
316
  }
317
+ async delete() {
318
+ const route = Routes_1.Routes.guilds.matches.resource(this.guild.id, this._id);
319
+ const response = await this.rest.request({
320
+ method: "DELETE",
321
+ url: route,
322
+ });
323
+ this.manager.cache.delete(this?._id);
324
+ this.rest.matches.delete(this?._id);
325
+ return response;
326
+ }
317
327
  toJSON() {
318
328
  const json = {};
319
329
  for (const [key, value] of Object.entries(this)) {
@@ -115,7 +115,7 @@ class GuildTicket {
115
115
  const response = await this.rest.request({
116
116
  method: "PATCH",
117
117
  url: route,
118
- payload
118
+ payload,
119
119
  });
120
120
  this.customerRating = response.customerRating;
121
121
  this.manager.cache.set(this.id, this);
@@ -153,7 +153,6 @@ class GuildTicket {
153
153
  method: "DELETE",
154
154
  url: route,
155
155
  });
156
- this.manager.cache.set(this.id, this);
157
156
  this.manager.cache.delete(this.id);
158
157
  return response;
159
158
  }
@@ -213,7 +213,6 @@ class GuildUser {
213
213
  });
214
214
  this.rest.emit("betUserDelete", this);
215
215
  this.manager.cache.delete(this.id);
216
- this.rest.users.set(this.id, this);
217
216
  return response;
218
217
  }
219
218
  toJSON() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duque.edits/sdk",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "typings": "./dist/index.d.ts",