@duque.edits/sdk 0.0.6 → 0.0.7
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.
- package/dist/managers/bet/GuildBetManager.js +2 -1
- package/dist/managers/betuser/GuildBetUserManager.js +1 -1
- package/dist/managers/channel/ChannelManager.js +1 -1
- package/dist/managers/mediator/GuildMediatorManager.js +2 -1
- package/dist/managers/product/GuildProductManager.js +2 -1
- package/dist/managers/ticket/GuildTicketManager.js +3 -2
- package/dist/managers/user/GuildUserManager.js +1 -1
- package/dist/rest/Routes.js +2 -2
- package/dist/structures/bet/GuildBet.js +1 -1
- package/dist/structures/match/GuildMatch.js +1 -1
- package/dist/structures/ticket/GuildTicket.d.ts +1 -0
- package/dist/structures/ticket/GuildTicket.js +5 -2
- package/dist/types/api/APIGuildTicket.d.ts +1 -0
- package/dist/types/api/APIGuildTicket.js +0 -1
- package/package.json +1 -1
|
@@ -28,6 +28,7 @@ class GuildBetManager {
|
|
|
28
28
|
const response = await this.rest.request({
|
|
29
29
|
method: "POST",
|
|
30
30
|
url: route,
|
|
31
|
+
payload
|
|
31
32
|
});
|
|
32
33
|
const bet = this.set(response);
|
|
33
34
|
return bet;
|
|
@@ -65,7 +66,7 @@ class GuildBetManager {
|
|
|
65
66
|
return this.cache;
|
|
66
67
|
}
|
|
67
68
|
set(data) {
|
|
68
|
-
if (!data
|
|
69
|
+
if (!data?._id)
|
|
69
70
|
return;
|
|
70
71
|
const bet = new GuildBet_1.GuildBet(data, this.guild, this, this.rest);
|
|
71
72
|
this.cache.set(bet._id, bet);
|
|
@@ -23,7 +23,7 @@ class GuildBetUserManager {
|
|
|
23
23
|
this.cache = new Collection_1.Collection("betUsers");
|
|
24
24
|
}
|
|
25
25
|
set(data) {
|
|
26
|
-
if (!data
|
|
26
|
+
if (!data?.id)
|
|
27
27
|
return;
|
|
28
28
|
const user = new GuildBetUser_1.GuildBetUser(data, this, this.rest);
|
|
29
29
|
this.rest.betUsers.set(user.id, user);
|
|
@@ -76,7 +76,7 @@ class ChannelManager {
|
|
|
76
76
|
return this.cache;
|
|
77
77
|
}
|
|
78
78
|
set(data) {
|
|
79
|
-
if (!data
|
|
79
|
+
if (!data?.type)
|
|
80
80
|
return;
|
|
81
81
|
const channel = new Channel_1.Channel({
|
|
82
82
|
baseUrl: Routes_1.Routes.guilds[this.structure.key].resource(this.guild.id, this.structure._id, "channels"),
|
|
@@ -28,6 +28,7 @@ class GuildMediatorManager {
|
|
|
28
28
|
const response = await this.rest.request({
|
|
29
29
|
method: "POST",
|
|
30
30
|
url: route,
|
|
31
|
+
payload
|
|
31
32
|
});
|
|
32
33
|
const mediator = this.set(response);
|
|
33
34
|
return mediator;
|
|
@@ -60,7 +61,7 @@ class GuildMediatorManager {
|
|
|
60
61
|
if (!data.id)
|
|
61
62
|
return;
|
|
62
63
|
const mediator = new GuildMediator_1.GuildMediator(data, this.guild, this, this.rest);
|
|
63
|
-
this.cache.set(data
|
|
64
|
+
this.cache.set(data?.id, mediator);
|
|
64
65
|
this.rest.mediators.set(mediator.id, mediator);
|
|
65
66
|
return mediator;
|
|
66
67
|
}
|
|
@@ -28,6 +28,7 @@ class GuildProductManager {
|
|
|
28
28
|
const response = await this.rest.request({
|
|
29
29
|
method: "POST",
|
|
30
30
|
url: route,
|
|
31
|
+
payload
|
|
31
32
|
});
|
|
32
33
|
const product = this.set(response);
|
|
33
34
|
return product;
|
|
@@ -60,7 +61,7 @@ class GuildProductManager {
|
|
|
60
61
|
return this.cache;
|
|
61
62
|
}
|
|
62
63
|
set(data) {
|
|
63
|
-
if (!data
|
|
64
|
+
if (!data?.id)
|
|
64
65
|
return;
|
|
65
66
|
const product = new GuildProduct_1.GuildProduct(data, this, this.rest);
|
|
66
67
|
this.cache.set(data.id, product);
|
|
@@ -28,6 +28,7 @@ class GuildTicketManager {
|
|
|
28
28
|
const response = await this.rest.request({
|
|
29
29
|
method: "POST",
|
|
30
30
|
url: route,
|
|
31
|
+
payload,
|
|
31
32
|
});
|
|
32
33
|
const ticket = this.set(response);
|
|
33
34
|
return ticket;
|
|
@@ -60,10 +61,10 @@ class GuildTicketManager {
|
|
|
60
61
|
return this.cache;
|
|
61
62
|
}
|
|
62
63
|
set(data) {
|
|
63
|
-
if (!data
|
|
64
|
+
if (!data?.id)
|
|
64
65
|
return;
|
|
65
66
|
const ticket = new GuildTicket_1.GuildTicket(data, this.guild, this, this.rest);
|
|
66
|
-
this.cache.set(data
|
|
67
|
+
this.cache.set(data?.id?.toString(), ticket);
|
|
67
68
|
return ticket;
|
|
68
69
|
}
|
|
69
70
|
setAll(data) {
|
package/dist/rest/Routes.js
CHANGED
|
@@ -4,8 +4,8 @@ exports.Routes = exports.Route = void 0;
|
|
|
4
4
|
const Route = (route) => route;
|
|
5
5
|
exports.Route = Route;
|
|
6
6
|
exports.Routes = {
|
|
7
|
-
base: "http://localhost:3000/api/v1",
|
|
8
|
-
|
|
7
|
+
//base: "http://localhost:3000/api/v1",
|
|
8
|
+
base: "https://duquedev.up.railway.app/api/v1",
|
|
9
9
|
field: (field) => `${field}`,
|
|
10
10
|
fields: (...fields) => `${fields.join("/")}`,
|
|
11
11
|
guilds: {
|
|
@@ -83,7 +83,7 @@ class GuildBet {
|
|
|
83
83
|
this.manager = manager;
|
|
84
84
|
this.key = "bets";
|
|
85
85
|
this.channels = new ChannelManager_1.ChannelManager(guild, this, rest);
|
|
86
|
-
this.messages = new MessagesManager_1.MessagesManager(this?.guild,
|
|
86
|
+
this.messages = new MessagesManager_1.MessagesManager(this?.guild, `bets/${data?._id}`, rest);
|
|
87
87
|
this.createdAt = data?.createdAt ? new Date(data?.createdAt) : new Date();
|
|
88
88
|
this.updatedAt = data?.updatedAt ? new Date(data?.updatedAt) : new Date();
|
|
89
89
|
this.guild = guild;
|
|
@@ -78,7 +78,7 @@ class GuildMatch {
|
|
|
78
78
|
this.mvpId = data?.mvpId;
|
|
79
79
|
this.key = "matches";
|
|
80
80
|
this.channels = new ChannelManager_1.ChannelManager(guild, this, rest);
|
|
81
|
-
this.messages = new MessagesManager_1.MessagesManager(guild,
|
|
81
|
+
this.messages = new MessagesManager_1.MessagesManager(guild, `matches/${data?._id}`, rest);
|
|
82
82
|
this.createdAt = data?.createdAt ? new Date(data?.createdAt) : new Date();
|
|
83
83
|
this.updatedAt = data?.updatedAt ? new Date(data?.updatedAt) : new Date();
|
|
84
84
|
this.guild = guild;
|
|
@@ -7,6 +7,7 @@ const MessagesManager_1 = require("../../managers/messages/MessagesManager");
|
|
|
7
7
|
class GuildTicket {
|
|
8
8
|
/** Ticket's id */
|
|
9
9
|
id;
|
|
10
|
+
_id;
|
|
10
11
|
/** Ticket's creator id */
|
|
11
12
|
creatorId;
|
|
12
13
|
/** Ticket's admin id */
|
|
@@ -39,7 +40,8 @@ class GuildTicket {
|
|
|
39
40
|
* @param rest The rest client
|
|
40
41
|
*/
|
|
41
42
|
constructor(data, guild, manager, rest) {
|
|
42
|
-
this.id = data?.id
|
|
43
|
+
this.id = data?.id?.toString();
|
|
44
|
+
this._id = data?._id?.toString();
|
|
43
45
|
this.creatorId = data?.creatorId;
|
|
44
46
|
this.adminId = data?.adminId;
|
|
45
47
|
this.customerRating = data.customerRating;
|
|
@@ -47,7 +49,7 @@ class GuildTicket {
|
|
|
47
49
|
this.type = data?.type;
|
|
48
50
|
this.status = data?.status;
|
|
49
51
|
this.channelId = data?.channelId;
|
|
50
|
-
this.messages = new MessagesManager_1.MessagesManager(
|
|
52
|
+
this.messages = new MessagesManager_1.MessagesManager(guild, `tickets/${data?.id}`, rest);
|
|
51
53
|
this.createdAt = data?.createdAt ? new Date(data?.createdAt) : new Date();
|
|
52
54
|
this.updatedAt = data?.updatedAt ? new Date(data?.updatedAt) : new Date();
|
|
53
55
|
this.guild = guild;
|
|
@@ -113,6 +115,7 @@ class GuildTicket {
|
|
|
113
115
|
const response = await this.rest.request({
|
|
114
116
|
method: "PATCH",
|
|
115
117
|
url: route,
|
|
118
|
+
payload
|
|
116
119
|
});
|
|
117
120
|
this.customerRating = response.customerRating;
|
|
118
121
|
this.manager.cache.set(this.id, this);
|