@duque.edits/sdk 0.0.1
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/.gitattributes +2 -0
- package/LICENSE +21 -0
- package/README.md +16 -0
- package/package.json +46 -0
- package/src/index.ts +30 -0
- package/src/managers/bet/GuildBetManager.ts +117 -0
- package/src/managers/betuser/GuildBetUserManager.ts +103 -0
- package/src/managers/channel/ChannelManager.ts +168 -0
- package/src/managers/groupedchannel/GroupedChannelManager.ts +117 -0
- package/src/managers/guild/GuildManager.ts +84 -0
- package/src/managers/match/GuildMatchManager.ts +115 -0
- package/src/managers/mediator/GuildMediatorManager.ts +111 -0
- package/src/managers/messages/MessagesManager.ts +95 -0
- package/src/managers/permission/GuildPermissionManager.ts +88 -0
- package/src/managers/product/GuildProductManager.ts +115 -0
- package/src/managers/ticket/GuildTicketManager.ts +112 -0
- package/src/managers/user/GuildUserManager.ts +116 -0
- package/src/rest/APIEndpoints.ts +11 -0
- package/src/rest/REST.ts +126 -0
- package/src/rest/Routes.ts +143 -0
- package/src/structures/Collection.ts +85 -0
- package/src/structures/bet/GuildBet.ts +332 -0
- package/src/structures/betuser/GuildBetUser.ts +247 -0
- package/src/structures/channel/Channel.ts +78 -0
- package/src/structures/groupedchannel/GroupedChannel.ts +165 -0
- package/src/structures/guild/Guild.ts +302 -0
- package/src/structures/match/GuildMatch.ts +385 -0
- package/src/structures/mediator/GuildMediator.ts +175 -0
- package/src/structures/product/GuildProduct.ts +217 -0
- package/src/structures/shop/GuildShop.ts +98 -0
- package/src/structures/ticket/GuildTicket.ts +227 -0
- package/src/structures/user/GuildUser.ts +248 -0
- package/src/types/api/APIBaseChannel.ts +13 -0
- package/src/types/api/APIBetChannel.ts +13 -0
- package/src/types/api/APIBetMessage.ts +13 -0
- package/src/types/api/APIGuild.ts +123 -0
- package/src/types/api/APIGuildBet.ts +69 -0
- package/src/types/api/APIGuildBetUser.ts +46 -0
- package/src/types/api/APIGuildChannel.ts +13 -0
- package/src/types/api/APIGuildEmoji.ts +16 -0
- package/src/types/api/APIGuildGroupedChannel.ts +13 -0
- package/src/types/api/APIGuildMatch.ts +67 -0
- package/src/types/api/APIGuildMediator.ts +18 -0
- package/src/types/api/APIGuildMessage.ts +13 -0
- package/src/types/api/APIGuildPermissions.ts +7 -0
- package/src/types/api/APIGuildRole.ts +13 -0
- package/src/types/api/APIGuildShop.ts +15 -0
- package/src/types/api/APIGuildTicket.ts +36 -0
- package/src/types/api/APIGuildUser.ts +45 -0
- package/src/types/api/APIMessage.ts +16 -0
- package/src/types/api/APIPlayer.ts +13 -0
- package/src/types/api/APIProduct.ts +27 -0
- package/src/types/api/index.ts +180 -0
- package/src/types/index.ts +24 -0
- package/src/utils/Assertion.ts +56 -0
- package/tests/index.ts +86 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { REST } from "../../rest/REST";
|
|
2
|
+
import { Routes } from "../../rest/Routes";
|
|
3
|
+
import { Accessory, Daily, Items, Optional, OriginalChannels, ProfileCard } from "../../types/api";
|
|
4
|
+
import { APIGuildUser } from "../../types/api/APIGuildUser";
|
|
5
|
+
import { GuildUserManager } from "../../managers/user/GuildUserManager";
|
|
6
|
+
|
|
7
|
+
export class GuildUser implements APIGuildUser {
|
|
8
|
+
/** User's id */
|
|
9
|
+
id: string;
|
|
10
|
+
|
|
11
|
+
/** User name */
|
|
12
|
+
name: string;
|
|
13
|
+
|
|
14
|
+
/** User's daily */
|
|
15
|
+
daily: Omit<Daily, "credit">;
|
|
16
|
+
|
|
17
|
+
/** User's points */
|
|
18
|
+
points: number;
|
|
19
|
+
|
|
20
|
+
/** User's wins */
|
|
21
|
+
wins: number;
|
|
22
|
+
|
|
23
|
+
/** User's mvps */
|
|
24
|
+
mvps: number;
|
|
25
|
+
|
|
26
|
+
/** User's losses */
|
|
27
|
+
losses: number;
|
|
28
|
+
|
|
29
|
+
/** User's games */
|
|
30
|
+
games: number;
|
|
31
|
+
|
|
32
|
+
/** If user is blacklisted */
|
|
33
|
+
blacklist: boolean;
|
|
34
|
+
|
|
35
|
+
/** User's accessories such as double point */
|
|
36
|
+
accessories: Accessory[];
|
|
37
|
+
|
|
38
|
+
/** User's original channels */
|
|
39
|
+
originalChannels: OriginalChannels;
|
|
40
|
+
|
|
41
|
+
/** User's items */
|
|
42
|
+
items: Items;
|
|
43
|
+
|
|
44
|
+
/** Creation Date */
|
|
45
|
+
createdAt: Date;
|
|
46
|
+
|
|
47
|
+
/** Updated Date */
|
|
48
|
+
updatedAt: Date;
|
|
49
|
+
|
|
50
|
+
/** The given manager */
|
|
51
|
+
readonly manager: GuildUserManager;
|
|
52
|
+
|
|
53
|
+
/** The rest client */
|
|
54
|
+
readonly rest: REST;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Bet user
|
|
58
|
+
* @param data The user's data
|
|
59
|
+
* @param manager The manager
|
|
60
|
+
* @param rest The rest client
|
|
61
|
+
*/
|
|
62
|
+
constructor(data: APIGuildUser, manager: GuildUserManager, rest: REST) {
|
|
63
|
+
this.name = data.name;
|
|
64
|
+
this.id = data.id;
|
|
65
|
+
this.wins = data.wins;
|
|
66
|
+
this.mvps = data.mvps;
|
|
67
|
+
this.losses = data.losses;
|
|
68
|
+
this.blacklist = data.blacklist;
|
|
69
|
+
this.items = data.items;
|
|
70
|
+
this.points = data.points;
|
|
71
|
+
this.mvps = data.mvps;
|
|
72
|
+
this.losses = data.losses;
|
|
73
|
+
this.originalChannels = data.originalChannels;
|
|
74
|
+
this.games = data.games;
|
|
75
|
+
this.accessories = data.accessories;
|
|
76
|
+
this.items = data.items;
|
|
77
|
+
this.daily = data?.daily;
|
|
78
|
+
|
|
79
|
+
this.createdAt = data?.createdAt ? new Date(data?.createdAt) : new Date();
|
|
80
|
+
this.updatedAt = data?.updatedAt ? new Date(data?.updatedAt) : new Date();
|
|
81
|
+
|
|
82
|
+
this.manager = manager;
|
|
83
|
+
this.rest = rest;
|
|
84
|
+
}
|
|
85
|
+
/** String representation of this user */
|
|
86
|
+
toString() {
|
|
87
|
+
return `<@${this.id}>`;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Fetches the user
|
|
91
|
+
* @returns New Instance of the user
|
|
92
|
+
*/
|
|
93
|
+
async fetch() {
|
|
94
|
+
const route = Routes.guilds.users.get(this.manager.guild.id, this.id);
|
|
95
|
+
const response = await this.rest.request<APIGuildUser, {}>({
|
|
96
|
+
method: "get",
|
|
97
|
+
url: route,
|
|
98
|
+
});
|
|
99
|
+
const user = new GuildUser(response, this.manager, this.rest);
|
|
100
|
+
|
|
101
|
+
this.manager.cache.set(user.id, user);
|
|
102
|
+
this.rest.users.set(user.id, user);
|
|
103
|
+
return user;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Add a propery
|
|
108
|
+
* @param key The desired key
|
|
109
|
+
* @param value The desired value
|
|
110
|
+
* @returns GuildUser
|
|
111
|
+
*/
|
|
112
|
+
async add<K extends keyof UserAddOptions, V extends UserAddOptions[K]>(key: K, value: V) {
|
|
113
|
+
const route = Routes.guilds.users.resource(this.manager.guild.id, this.id, key);
|
|
114
|
+
const payload = { [key]: value, name: this.name };
|
|
115
|
+
|
|
116
|
+
const resp = await this.rest.request<APIGuildUser, typeof payload>({
|
|
117
|
+
method: "patch",
|
|
118
|
+
url: route,
|
|
119
|
+
payload,
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
(this as any)[key] = resp[key as keyof APIGuildUser];
|
|
123
|
+
|
|
124
|
+
this.manager.cache.set(this.id, this);
|
|
125
|
+
this.rest.users.set(this.id, this);
|
|
126
|
+
return this;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Set the user blacklist
|
|
131
|
+
* @param value Value to set to
|
|
132
|
+
* @returns GuildUser
|
|
133
|
+
*/
|
|
134
|
+
async setBlacklist(value: boolean) {
|
|
135
|
+
const route = Routes.guilds.users.resource(this.manager.guild.id, this.id, "blacklist");
|
|
136
|
+
const payload = { value, name: this.name };
|
|
137
|
+
await this.rest.request<APIGuildUser, typeof payload>({
|
|
138
|
+
method: "patch",
|
|
139
|
+
url: route,
|
|
140
|
+
payload,
|
|
141
|
+
});
|
|
142
|
+
this.blacklist = value;
|
|
143
|
+
this.manager.cache.set(this.id, this);
|
|
144
|
+
this.rest.users.set(this.id, this);
|
|
145
|
+
return this;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Update certain property
|
|
150
|
+
* @param data The new data to update with
|
|
151
|
+
* @returns
|
|
152
|
+
*/
|
|
153
|
+
async update(data: Omit<Optional<APIGuildUser>, "daily"> & { type?: "add" | "remove" }) {
|
|
154
|
+
if (!data.type) data.type = 'add';
|
|
155
|
+
|
|
156
|
+
const route = Routes.guilds.users.get(this.manager.guild.id, this.id);
|
|
157
|
+
const payload: Record<string, any> = {};
|
|
158
|
+
|
|
159
|
+
const numericFields = ["coins", "wins", "points", "losses", "mvps", "games"] as const;
|
|
160
|
+
const arrayFields = ["items", "originalChannels"] as const;
|
|
161
|
+
|
|
162
|
+
if (data.type === "add" || data.type === "remove") {
|
|
163
|
+
for (const key in data) {
|
|
164
|
+
if (key === "type") continue;
|
|
165
|
+
console.log({ wdwdqwdqwdwqdwd: false });
|
|
166
|
+
|
|
167
|
+
const value = data[key as keyof typeof data];
|
|
168
|
+
|
|
169
|
+
if (numericFields.includes(key as any)) {
|
|
170
|
+
const current = this[key as keyof typeof this] as number;
|
|
171
|
+
const num = value as number;
|
|
172
|
+
payload[key] = Math.max(0, data.type === "add" ? current + num : num - current);
|
|
173
|
+
} else if (key === "blacklist") {
|
|
174
|
+
payload["blacklist"] = value;
|
|
175
|
+
} else if (arrayFields.includes(key as any)) {
|
|
176
|
+
if (key === "originalChannels") {
|
|
177
|
+
const current = this.originalChannels;
|
|
178
|
+
const fromData = data["originalChannels"];
|
|
179
|
+
let channels: OriginalChannels = [];
|
|
180
|
+
|
|
181
|
+
if (data.type === "add") {
|
|
182
|
+
const existingIds = new Set(current.map((ch) => ch.matchId));
|
|
183
|
+
channels = [...current, ...fromData.filter((ch) => !existingIds.has(ch.matchId))];
|
|
184
|
+
} else if (data.type === "remove") {
|
|
185
|
+
const idsToRemove = new Set(fromData.map((ch) => ch.matchId));
|
|
186
|
+
channels = current.filter((ch) => !idsToRemove.has(ch.matchId));
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
payload["originalChannels"] = channels;
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const current = this[key as keyof typeof this] as any[];
|
|
194
|
+
const incoming = value as any[];
|
|
195
|
+
|
|
196
|
+
payload[key] =
|
|
197
|
+
data.type === "add"
|
|
198
|
+
? [...new Set([...current, ...incoming])]
|
|
199
|
+
: current.filter((x) => !incoming.includes(x));
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
const response = await this.rest.request<APIGuildUser, typeof payload>({
|
|
204
|
+
method: "patch",
|
|
205
|
+
url: route,
|
|
206
|
+
payload,
|
|
207
|
+
});
|
|
208
|
+
for (const k in response) {
|
|
209
|
+
if (k === "id") continue;
|
|
210
|
+
if (Object.hasOwn(this, k)) {
|
|
211
|
+
(this as any)[k] = response[k as keyof APIGuildUser];
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
this.rest.users.set(this.id, this);
|
|
215
|
+
this.manager.cache.set(this.id, this);
|
|
216
|
+
return this;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
async delete() {
|
|
220
|
+
const route = Routes.guilds.users.delete(this.manager.guild.id, this.id);
|
|
221
|
+
const response = await this.rest.request<boolean, {}>({
|
|
222
|
+
method: "DELETE",
|
|
223
|
+
url: route,
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
this.rest.emit("betUserDelete", this);
|
|
227
|
+
this.manager.cache.delete(this.id);
|
|
228
|
+
this.rest.users.set(this.id, this);
|
|
229
|
+
return response;
|
|
230
|
+
}
|
|
231
|
+
toJSON() {
|
|
232
|
+
let json: Record<keyof GuildUser, unknown>;
|
|
233
|
+
for (const [key, value] of Object.entries(this)) {
|
|
234
|
+
if (typeof value !== "function") {
|
|
235
|
+
(json as any)[key] = value;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return json;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export interface UserAddOptions extends APIGuildUser {
|
|
243
|
+
coins: number;
|
|
244
|
+
points: number;
|
|
245
|
+
wins: number;
|
|
246
|
+
losses: number;
|
|
247
|
+
mvps: number;
|
|
248
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { APITicketCategory, GuildBlacklist } from ".";
|
|
2
|
+
import { APIBetMessage } from "./APIBetMessage";
|
|
3
|
+
import { APIGuildBet } from "./APIGuildBet";
|
|
4
|
+
import { APIGuildBetUser } from "./APIGuildBetUser";
|
|
5
|
+
import { APIGuildChannel } from "./APIGuildChannel";
|
|
6
|
+
import { APIGuildEmoji } from "./APIGuildEmoji";
|
|
7
|
+
import { APIGuildGroupedChannel } from "./APIGuildGroupedChannel";
|
|
8
|
+
import { APIGuildMatch } from "./APIGuildMatch";
|
|
9
|
+
import { APIGuildMediator } from "./APIGuildMediator";
|
|
10
|
+
import { APIGuildPermissions } from "./APIGuildPermissions";
|
|
11
|
+
import { APIGuildRole } from "./APIGuildRole";
|
|
12
|
+
import { APIGuildShop } from "./APIGuildShop";
|
|
13
|
+
import { APIGuildTicket } from "./APIGuildTicket";
|
|
14
|
+
import { APIGuildUser } from "./APIGuildUser";
|
|
15
|
+
import { APIMessage } from "./APIMessage";
|
|
16
|
+
|
|
17
|
+
/** Ticket's configuration */
|
|
18
|
+
export interface GuildTicketConfiguration {
|
|
19
|
+
/** Guild's categories */
|
|
20
|
+
categories: APITicketCategory;
|
|
21
|
+
}
|
|
22
|
+
export interface GuildStatus {
|
|
23
|
+
/** Matches status */
|
|
24
|
+
matches: "on" | "off";
|
|
25
|
+
/** Bets status */
|
|
26
|
+
bets: "on" | "off";
|
|
27
|
+
/** Daily Ranking status */
|
|
28
|
+
dailyRank: "on" | "off";
|
|
29
|
+
/** Voice Channels for a bet */
|
|
30
|
+
createVoiceChannels: "on" | "off";
|
|
31
|
+
}
|
|
32
|
+
export interface GuildScores {
|
|
33
|
+
/** Win */
|
|
34
|
+
win: number;
|
|
35
|
+
|
|
36
|
+
/** Loss */
|
|
37
|
+
loss: number;
|
|
38
|
+
|
|
39
|
+
/** Mvp */
|
|
40
|
+
mvp: number;
|
|
41
|
+
|
|
42
|
+
/** Coin */
|
|
43
|
+
coin: number;
|
|
44
|
+
|
|
45
|
+
/** Creator */
|
|
46
|
+
creator: number;
|
|
47
|
+
}
|
|
48
|
+
export interface APIGuild {
|
|
49
|
+
/** Guild's id */
|
|
50
|
+
id: string;
|
|
51
|
+
|
|
52
|
+
/** Guild's client key */
|
|
53
|
+
clientKey: string;
|
|
54
|
+
|
|
55
|
+
/** Guild Permissions */
|
|
56
|
+
permissions: APIGuildPermissions;
|
|
57
|
+
|
|
58
|
+
/** Guild Ticket */
|
|
59
|
+
tickets: APIGuildTicket[];
|
|
60
|
+
|
|
61
|
+
/** Guild Ticket Configuration */
|
|
62
|
+
ticketsConfiguration: GuildTicketConfiguration;
|
|
63
|
+
|
|
64
|
+
/** Guild Daily Categories */
|
|
65
|
+
dailyCategories: ["coins", "credit"];
|
|
66
|
+
|
|
67
|
+
/** Guild Scores */
|
|
68
|
+
scores: GuildScores;
|
|
69
|
+
|
|
70
|
+
/** Guild Status */
|
|
71
|
+
status: GuildStatus;
|
|
72
|
+
|
|
73
|
+
/** Guild Channel */
|
|
74
|
+
channels: APIGuildGroupedChannel[];
|
|
75
|
+
|
|
76
|
+
/** Guild Categories */
|
|
77
|
+
categories: APIGuildGroupedChannel[];
|
|
78
|
+
|
|
79
|
+
/** Guild Blacklist */
|
|
80
|
+
blacklist: GuildBlacklist;
|
|
81
|
+
|
|
82
|
+
/** Guild Prefix */
|
|
83
|
+
prefix: string;
|
|
84
|
+
|
|
85
|
+
/** Guild Prices */
|
|
86
|
+
pricesAvailable: number[];
|
|
87
|
+
|
|
88
|
+
/** Guild Prices Used */
|
|
89
|
+
pricesOn: number[];
|
|
90
|
+
|
|
91
|
+
/** Guild Creation Date */
|
|
92
|
+
createdAt: Date;
|
|
93
|
+
|
|
94
|
+
/** Guild Updated Date */
|
|
95
|
+
updatedAt: Date;
|
|
96
|
+
|
|
97
|
+
/** Guild Bets */
|
|
98
|
+
bets: APIGuildBet[];
|
|
99
|
+
|
|
100
|
+
/** Guild Users */
|
|
101
|
+
users: APIGuildUser[];
|
|
102
|
+
|
|
103
|
+
/** Guild Bet Users */
|
|
104
|
+
betUsers: APIGuildBetUser[];
|
|
105
|
+
|
|
106
|
+
/** Guild Matches */
|
|
107
|
+
matches: APIGuildMatch[];
|
|
108
|
+
|
|
109
|
+
/** Guild Mediators */
|
|
110
|
+
mediators: APIGuildMediator[];
|
|
111
|
+
|
|
112
|
+
/** Guild Messages */
|
|
113
|
+
messages: APIMessage[];
|
|
114
|
+
|
|
115
|
+
/** Guild Emojis */
|
|
116
|
+
emojis: APIGuildEmoji[];
|
|
117
|
+
|
|
118
|
+
/** Guild Roles */
|
|
119
|
+
roles: APIGuildRole[];
|
|
120
|
+
|
|
121
|
+
/** Guild Shop */
|
|
122
|
+
shop: APIGuildShop;
|
|
123
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { BaseMatchModes, Confirm, Logs } from ".";
|
|
2
|
+
import { APIBetChannel } from "./APIBetChannel";
|
|
3
|
+
import { APIMessage } from "./APIMessage";
|
|
4
|
+
import { APIPlayer } from "./APIPlayer";
|
|
5
|
+
|
|
6
|
+
export interface APIGuildBet {
|
|
7
|
+
/** The bet's type */
|
|
8
|
+
type: Omit<BaseMatchModes, "5x5" | "6x6" | "5v5" | "6v6">;
|
|
9
|
+
|
|
10
|
+
/** The bet's mode */
|
|
11
|
+
mode: "misto" | "emu" | "mob" | "MISTO" | "EMU" | "MOB";
|
|
12
|
+
|
|
13
|
+
/** The bet's status */
|
|
14
|
+
status: "off" | "created" | "on" | "shutted" | "waiting";
|
|
15
|
+
|
|
16
|
+
/** The bet's maximum size */
|
|
17
|
+
maximumSize: number;
|
|
18
|
+
|
|
19
|
+
/** The bet's price */
|
|
20
|
+
price: number;
|
|
21
|
+
|
|
22
|
+
/** Who has payed the bet */
|
|
23
|
+
payedBy: APIPlayer[];
|
|
24
|
+
|
|
25
|
+
/** The bet's players */
|
|
26
|
+
players: APIPlayer[];
|
|
27
|
+
|
|
28
|
+
/** An array of team a */
|
|
29
|
+
teamA: APIPlayer[];
|
|
30
|
+
|
|
31
|
+
/** An array of team b */
|
|
32
|
+
teamB: APIPlayer[];
|
|
33
|
+
|
|
34
|
+
/** The bet's channel */
|
|
35
|
+
channels: APIBetChannel[];
|
|
36
|
+
|
|
37
|
+
/** The bet's messages */
|
|
38
|
+
messages: APIMessage[];
|
|
39
|
+
|
|
40
|
+
/** The id of the winner */
|
|
41
|
+
winner: string;
|
|
42
|
+
|
|
43
|
+
/** The id of the loser */
|
|
44
|
+
loser: string;
|
|
45
|
+
|
|
46
|
+
/** The bet's creator id */
|
|
47
|
+
creatorId: string;
|
|
48
|
+
|
|
49
|
+
/** The bet's mediator */
|
|
50
|
+
mediatorId: string;
|
|
51
|
+
|
|
52
|
+
/** The bet's confirmers */
|
|
53
|
+
confirmed: Confirm[];
|
|
54
|
+
|
|
55
|
+
/** The bet's embed id */
|
|
56
|
+
embedMessageId: string;
|
|
57
|
+
|
|
58
|
+
/** The bet's logs */
|
|
59
|
+
logs: Logs;
|
|
60
|
+
|
|
61
|
+
/** Creation Date */
|
|
62
|
+
createdAt: Date;
|
|
63
|
+
|
|
64
|
+
/** Updated Date */
|
|
65
|
+
updatedAt: Date;
|
|
66
|
+
|
|
67
|
+
/** Bet's id */
|
|
68
|
+
_id: string;
|
|
69
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Daily, Items, ProfileCard } from ".";
|
|
2
|
+
|
|
3
|
+
/** Bet user */
|
|
4
|
+
export interface APIGuildBetUser {
|
|
5
|
+
/** User daily */
|
|
6
|
+
daily: Omit<Daily, "points">;
|
|
7
|
+
|
|
8
|
+
/** User's name */
|
|
9
|
+
name: string;
|
|
10
|
+
|
|
11
|
+
/** User's name */
|
|
12
|
+
id: string;
|
|
13
|
+
|
|
14
|
+
/** User's credit */
|
|
15
|
+
credit: number;
|
|
16
|
+
|
|
17
|
+
/** User's wins */
|
|
18
|
+
wins: number;
|
|
19
|
+
|
|
20
|
+
/** User's mvps */
|
|
21
|
+
mvps: number;
|
|
22
|
+
|
|
23
|
+
/** User's losses */
|
|
24
|
+
losses: number;
|
|
25
|
+
|
|
26
|
+
/** User's bets played */
|
|
27
|
+
betsPlayed: string[];
|
|
28
|
+
|
|
29
|
+
/** User's blacklist */
|
|
30
|
+
blacklist: boolean;
|
|
31
|
+
|
|
32
|
+
/** User's coins */
|
|
33
|
+
coins: number;
|
|
34
|
+
|
|
35
|
+
/** User's items */
|
|
36
|
+
items: Items;
|
|
37
|
+
|
|
38
|
+
/** User's profile card */
|
|
39
|
+
profileCard: ProfileCard;
|
|
40
|
+
|
|
41
|
+
/** Creation Date */
|
|
42
|
+
createdAt: Date;
|
|
43
|
+
|
|
44
|
+
/** Updated Date */
|
|
45
|
+
updatedAt: Date;
|
|
46
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { BaseMatchModes, BaseMatchStatus, Confirm } from ".";
|
|
2
|
+
import { APIBaseChannel } from "./APIBaseChannel";
|
|
3
|
+
import { APIGuildMessage } from "./APIGuildMessage";
|
|
4
|
+
import { APIMessage } from "./APIMessage";
|
|
5
|
+
import { APIPlayer } from "./APIPlayer";
|
|
6
|
+
|
|
7
|
+
export interface APIGuildMatch {
|
|
8
|
+
/** Match's type */
|
|
9
|
+
type: BaseMatchModes;
|
|
10
|
+
|
|
11
|
+
/** Match's status */
|
|
12
|
+
status: BaseMatchStatus;
|
|
13
|
+
|
|
14
|
+
/** Match's challenge */
|
|
15
|
+
challenge: boolean;
|
|
16
|
+
|
|
17
|
+
/** Match's players */
|
|
18
|
+
players: APIPlayer[];
|
|
19
|
+
|
|
20
|
+
/** Match's winners */
|
|
21
|
+
winners: APIPlayer[];
|
|
22
|
+
|
|
23
|
+
/** Match's losers */
|
|
24
|
+
losers: APIPlayer[];
|
|
25
|
+
|
|
26
|
+
/** Match;s messages */
|
|
27
|
+
messages: APIMessage[];
|
|
28
|
+
|
|
29
|
+
/** Matches channels */
|
|
30
|
+
channels: APIBaseChannel[];
|
|
31
|
+
|
|
32
|
+
/** Match's maximum size */
|
|
33
|
+
maximumSize: number;
|
|
34
|
+
|
|
35
|
+
/** Match's kicked out */
|
|
36
|
+
kickedOut: APIPlayer[];
|
|
37
|
+
|
|
38
|
+
/** Match's team a */
|
|
39
|
+
teamA: APIPlayer[];
|
|
40
|
+
|
|
41
|
+
/** Match's team b */
|
|
42
|
+
teamB: APIPlayer[];
|
|
43
|
+
|
|
44
|
+
/** Match's confirmed */
|
|
45
|
+
confirmed: Confirm[];
|
|
46
|
+
|
|
47
|
+
/** Match's leaders */
|
|
48
|
+
leaders: APIPlayer[];
|
|
49
|
+
|
|
50
|
+
/** Match's mvp */
|
|
51
|
+
mvpId: string;
|
|
52
|
+
|
|
53
|
+
/** Match's creator id */
|
|
54
|
+
creatorId: string;
|
|
55
|
+
|
|
56
|
+
/** Match's room creator id */
|
|
57
|
+
roomCreatorId: string;
|
|
58
|
+
|
|
59
|
+
/** Creation Date */
|
|
60
|
+
createdAt: Date;
|
|
61
|
+
|
|
62
|
+
/** Updated Date */
|
|
63
|
+
updatedAt: Date;
|
|
64
|
+
|
|
65
|
+
/** Match's id */
|
|
66
|
+
_id: string;
|
|
67
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { APIPlayer } from "./APIPlayer";
|
|
2
|
+
|
|
3
|
+
export interface APIGuildMediator extends APIPlayer {
|
|
4
|
+
/** Mediator's id */
|
|
5
|
+
id: string;
|
|
6
|
+
|
|
7
|
+
/** Mediator's name */
|
|
8
|
+
name: string;
|
|
9
|
+
|
|
10
|
+
/** Mediator's links */
|
|
11
|
+
paymentLinks: string[];
|
|
12
|
+
|
|
13
|
+
/** Creation Date */
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
|
|
16
|
+
/** Updated Date */
|
|
17
|
+
updatedAt: Date;
|
|
18
|
+
};
|