@duque.edits/sdk 1.0.3 → 1.0.5
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 +4 -0
- package/dist/managers/betuser/GuildBetUserManager.js +1 -2
- package/dist/managers/match/GuildMatchManager.js +8 -21
- package/dist/managers/mediator/GuildMediatorManager.js +94 -0
- package/dist/managers/message/MessagesManager.js +14 -8
- package/dist/managers/player/PlayerManager.js +35 -0
- package/dist/managers/ticket/TicketManager.js +0 -1
- package/dist/rest/REST.js +6 -1
- package/dist/rest/Routes.js +2 -2
- package/dist/structures/bet/GuildBet.js +36 -18
- package/dist/structures/betuser/GuildBetUser.js +11 -8
- package/dist/structures/guild/Guild.js +4 -0
- package/dist/structures/match/GuildMatch.js +41 -36
- package/dist/structures/mediator/GuildMediator.js +133 -0
- package/dist/structures/user/GuildUser.js +1 -1
- package/dist/types/api/APIGuildMediator.js +0 -1
- package/dist/types/api/APIGuildPermissions.js +1 -0
- package/dist/types/api/APILogEntry.js +6 -0
- package/dist/types/api/index.js +0 -2
- package/package.json +1 -1
- package/types/managers/bet/GuildBetManager.d.ts +1 -1
- package/types/managers/betuser/GuildBetUserManager.d.ts +1 -1
- package/types/managers/match/GuildMatchManager.d.ts +2 -3
- package/types/managers/mediator/GuildMediatorManager.d.ts +19 -0
- package/types/managers/message/MessagesManager.d.ts +5 -2
- package/types/managers/player/PlayerManager.d.ts +9 -0
- package/types/rest/REST.d.ts +3 -0
- package/types/structures/bet/GuildBet.d.ts +5 -4
- package/types/structures/betuser/GuildBetUser.d.ts +3 -0
- package/types/structures/guild/Guild.d.ts +2 -0
- package/types/structures/match/GuildMatch.d.ts +10 -4
- package/types/structures/mediator/GuildMediator.d.ts +50 -0
- package/types/structures/ticket/Ticket.d.ts +3 -3
- package/types/structures/user/GuildUser.d.ts +1 -1
- package/types/types/api/APIGuildBet.d.ts +1 -0
- package/types/types/api/APIGuildBetUser.d.ts +1 -0
- package/types/types/api/APIGuildMatch.d.ts +3 -1
- package/types/types/api/APIGuildMediator.d.ts +7 -6
- package/types/types/api/APIGuildPermissions.d.ts +2 -1
- package/types/types/api/APIGuildTicket.d.ts +2 -2
- package/types/types/api/APILogEntry.d.ts +7 -1
- package/types/types/api/APIMessage.d.ts +3 -5
- package/types/types/api/index.d.ts +0 -2
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GuildMediator = void 0;
|
|
4
|
+
const Routes_1 = require("../../rest/Routes");
|
|
5
|
+
class GuildMediator {
|
|
6
|
+
/** User's name */
|
|
7
|
+
id;
|
|
8
|
+
guild_id;
|
|
9
|
+
/** User's games */
|
|
10
|
+
games;
|
|
11
|
+
paypal;
|
|
12
|
+
revolut;
|
|
13
|
+
mbway;
|
|
14
|
+
external_links;
|
|
15
|
+
/** Creation Date */
|
|
16
|
+
createdAt;
|
|
17
|
+
/** Updated Date */
|
|
18
|
+
updatedAt;
|
|
19
|
+
/** The given manager */
|
|
20
|
+
manager;
|
|
21
|
+
/** The rest client */
|
|
22
|
+
rest;
|
|
23
|
+
guild;
|
|
24
|
+
/**
|
|
25
|
+
* Bet user
|
|
26
|
+
* @param data The user's data
|
|
27
|
+
* @param manager The manager
|
|
28
|
+
* @param rest The rest client
|
|
29
|
+
*/
|
|
30
|
+
constructor(data, manager) {
|
|
31
|
+
this.id = data?.id;
|
|
32
|
+
this.guild_id = data?.guild_id;
|
|
33
|
+
this.manager = manager;
|
|
34
|
+
this.rest = manager.rest;
|
|
35
|
+
this.guild = manager.guild;
|
|
36
|
+
this.games = data?.games;
|
|
37
|
+
this.paypal = data?.paypal;
|
|
38
|
+
this.revolut = data?.revolut;
|
|
39
|
+
this.mbway = data?.mbway;
|
|
40
|
+
this.external_links = data?.external_links;
|
|
41
|
+
this.createdAt = data?.createdAt ? new Date(data?.createdAt) : new Date();
|
|
42
|
+
this.updatedAt = data?.updatedAt ? new Date(data?.updatedAt) : new Date();
|
|
43
|
+
}
|
|
44
|
+
/** String representation of this user */
|
|
45
|
+
toString() {
|
|
46
|
+
return `<@${this.id}>`;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Fetches the user
|
|
50
|
+
* @returns New Instance of the user
|
|
51
|
+
*/
|
|
52
|
+
async fetch() {
|
|
53
|
+
const route = Routes_1.Routes.guilds.mediators.get(this.manager.guild.id, this.id);
|
|
54
|
+
const response = await this.rest.request({
|
|
55
|
+
method: "get",
|
|
56
|
+
url: route,
|
|
57
|
+
});
|
|
58
|
+
const user = new GuildMediator(response, this.manager);
|
|
59
|
+
this.manager.cache.set(user.id, user);
|
|
60
|
+
this.rest.mediators.set(user.id, user);
|
|
61
|
+
return user;
|
|
62
|
+
}
|
|
63
|
+
async reset() {
|
|
64
|
+
const route = Routes_1.Routes.guilds.mediators.get(this.manager.guild.id, this.id);
|
|
65
|
+
const payload = { reset: true };
|
|
66
|
+
const response = await this.rest.request({
|
|
67
|
+
method: "DELETE",
|
|
68
|
+
url: route,
|
|
69
|
+
payload,
|
|
70
|
+
});
|
|
71
|
+
return this._updateInternals(response);
|
|
72
|
+
}
|
|
73
|
+
_updateInternals(data) {
|
|
74
|
+
for (let key in data) {
|
|
75
|
+
if (key === "id" || key === "createdAt")
|
|
76
|
+
continue;
|
|
77
|
+
if (key in this) {
|
|
78
|
+
this[key] = data[key];
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
this.updatedAt = new Date();
|
|
82
|
+
this.createdAt = new Date(data.createdAt);
|
|
83
|
+
this.manager.set(this);
|
|
84
|
+
return this;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Update certain property
|
|
88
|
+
* @param data The new data to update with
|
|
89
|
+
* @returns
|
|
90
|
+
*/
|
|
91
|
+
async update(data) {
|
|
92
|
+
const route = Routes_1.Routes.guilds.mediators.get(this.manager.guild.id, this.id);
|
|
93
|
+
let payload = data;
|
|
94
|
+
const response = await this.rest.request({
|
|
95
|
+
method: "patch",
|
|
96
|
+
url: route,
|
|
97
|
+
payload,
|
|
98
|
+
});
|
|
99
|
+
return this._updateInternals(response);
|
|
100
|
+
}
|
|
101
|
+
async setPaymentlink(type, link) {
|
|
102
|
+
const route = Routes_1.Routes.guilds.mediators.get(this.manager.guild.id, this.id);
|
|
103
|
+
let payload = { [type]: link };
|
|
104
|
+
const response = await this.rest.request({
|
|
105
|
+
method: "patch",
|
|
106
|
+
url: route,
|
|
107
|
+
payload,
|
|
108
|
+
});
|
|
109
|
+
return this._updateInternals(response);
|
|
110
|
+
}
|
|
111
|
+
async delete() {
|
|
112
|
+
const route = Routes_1.Routes.guilds.mediators.delete(this.manager.guild.id, this.id);
|
|
113
|
+
const response = await this.rest.request({
|
|
114
|
+
method: "DELETE",
|
|
115
|
+
url: route,
|
|
116
|
+
});
|
|
117
|
+
this.manager.cache.delete(this.id);
|
|
118
|
+
return response;
|
|
119
|
+
}
|
|
120
|
+
toJSON() {
|
|
121
|
+
let json = {};
|
|
122
|
+
for (const [key, value] of Object.entries(this)) {
|
|
123
|
+
const exclude = ["rest", "guilds", "guild", "manager"];
|
|
124
|
+
if (exclude.includes(key))
|
|
125
|
+
continue;
|
|
126
|
+
if (typeof value !== "function") {
|
|
127
|
+
json[key] = value;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return json;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
exports.GuildMediator = GuildMediator;
|
|
@@ -265,7 +265,7 @@ class GuildUser {
|
|
|
265
265
|
toJSON() {
|
|
266
266
|
let json = {};
|
|
267
267
|
for (const [key, value] of Object.entries(this)) {
|
|
268
|
-
const exclude = ["rest", "guilds", "manager"];
|
|
268
|
+
const exclude = ["rest", "guilds", "guild", "manager"];
|
|
269
269
|
if (exclude.includes(key))
|
|
270
270
|
continue;
|
|
271
271
|
if (typeof value !== "function") {
|
|
@@ -7,4 +7,5 @@ var GuildPermissionsTypes;
|
|
|
7
7
|
GuildPermissionsTypes["ManageQueues"] = "manage_queues";
|
|
8
8
|
GuildPermissionsTypes["ManageUsers"] = "manage_users";
|
|
9
9
|
GuildPermissionsTypes["ViewQueueChannels"] = "view_queue_channels";
|
|
10
|
+
GuildPermissionsTypes["MediatorRole"] = "mediator_role";
|
|
10
11
|
})(GuildPermissionsTypes || (exports.GuildPermissionsTypes = GuildPermissionsTypes = {}));
|
|
@@ -10,4 +10,10 @@ var LogEntryTypes;
|
|
|
10
10
|
LogEntryTypes["MatchClosed"] = "match_closed";
|
|
11
11
|
LogEntryTypes["UserUpdated"] = "user_updated";
|
|
12
12
|
LogEntryTypes["UserManaged"] = "user_managed";
|
|
13
|
+
LogEntryTypes["BetManaged"] = "bet_managed";
|
|
14
|
+
LogEntryTypes["BetMediador"] = "bet_mediador";
|
|
15
|
+
LogEntryTypes["BetInitiated"] = "bet_initiated";
|
|
16
|
+
LogEntryTypes["BetClosed"] = "bet_closed";
|
|
17
|
+
LogEntryTypes["BetAwaitingConfirmation"] = "bet_awaiting_confirmation";
|
|
18
|
+
LogEntryTypes["BetCanceled"] = "bet_canceled";
|
|
13
19
|
})(LogEntryTypes || (exports.LogEntryTypes = LogEntryTypes = {}));
|
package/dist/types/api/index.js
CHANGED
|
@@ -50,7 +50,6 @@ var STATES;
|
|
|
50
50
|
__exportStar(require("./APIAdvert"), exports);
|
|
51
51
|
__exportStar(require("./APIBaseChannel"), exports);
|
|
52
52
|
__exportStar(require("./APIBetChannel"), exports);
|
|
53
|
-
__exportStar(require("./APIBetMessage"), exports);
|
|
54
53
|
__exportStar(require("./APICode"), exports);
|
|
55
54
|
__exportStar(require("./APIGiveaway"), exports);
|
|
56
55
|
__exportStar(require("./APIGuild"), exports);
|
|
@@ -66,7 +65,6 @@ __exportStar(require("./APIGuildShop"), exports);
|
|
|
66
65
|
__exportStar(require("./APIGuildTicket"), exports);
|
|
67
66
|
__exportStar(require("./APIGuildUser"), exports);
|
|
68
67
|
__exportStar(require("./APILogEntry"), exports);
|
|
69
|
-
__exportStar(require("./APILogMessage"), exports);
|
|
70
68
|
__exportStar(require("./APIMessage"), exports);
|
|
71
69
|
__exportStar(require("./APIMinesGame"), exports);
|
|
72
70
|
__exportStar(require("./APIPlayer"), exports);
|
package/package.json
CHANGED
|
@@ -11,5 +11,5 @@ export declare class GuildBetManager extends BaseManager<GuildBet> {
|
|
|
11
11
|
fetch(options?: FetchOptions): Promise<GuildBet | Collection<string, GuildBet>>;
|
|
12
12
|
create(data: Optional<APIGuildBet>): Promise<GuildBet>;
|
|
13
13
|
delete(betId?: string): Promise<GuildBet>;
|
|
14
|
-
set(data: Optional<APIGuildBet> | Optional<APIGuildBet>[]): GuildBet;
|
|
14
|
+
set(data: Optional<APIGuildBet> | Optional<APIGuildBet>[] | GuildBet): GuildBet;
|
|
15
15
|
}
|
|
@@ -12,7 +12,7 @@ export declare class GuildBetUserManager extends BaseManager<GuildBetUser> {
|
|
|
12
12
|
fetch(options?: FetchOptions): Promise<Collection<string, GuildBetUser> | GuildBetUser>;
|
|
13
13
|
updateMany(...betusers: Optional<APIGuildBetUser>[]): Promise<Collection<string, GuildBetUser>>;
|
|
14
14
|
deleteAll(): Promise<void>;
|
|
15
|
-
resetAll(): Promise<Collection<string, GuildBetUser>>;
|
|
15
|
+
resetAll(): Promise<GuildBetUser | Collection<string, GuildBetUser>>;
|
|
16
16
|
set(data: APIGuildBetUser | APIGuildBetUser[]): GuildBetUser | Collection<string, GuildBetUser>;
|
|
17
17
|
}
|
|
18
18
|
export {};
|
|
@@ -22,9 +22,8 @@ export declare class GuildMatchManager extends BaseManager<GuildMatch> {
|
|
|
22
22
|
*/
|
|
23
23
|
fetch(options?: Optional<FetchOptions>): Promise<GuildMatch | Collection<string, GuildMatch>>;
|
|
24
24
|
fetchAll(): Promise<Collection<string, GuildMatch>>;
|
|
25
|
-
set(data: APIGuildMatch | APIGuildMatch[]): GuildMatch | Collection<string, GuildMatch>;
|
|
25
|
+
set(data: APIGuildMatch | APIGuildMatch[] | GuildMatch): GuildMatch | Collection<string, GuildMatch>;
|
|
26
26
|
create(payload: Optional<APIGuildMatch>): Promise<GuildMatch>;
|
|
27
|
-
delete(id
|
|
28
|
-
deleteAll(): Promise<boolean>;
|
|
27
|
+
delete(id?: string): Promise<GuildMatch | Collection<string, GuildMatch>>;
|
|
29
28
|
}
|
|
30
29
|
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { GuildMediator } from "../../structures/mediator/GuildMediator";
|
|
2
|
+
import { Collection } from "../../structures/Collection";
|
|
3
|
+
import { Guild } from "../../structures/guild/Guild";
|
|
4
|
+
import { Optional, APIGuildMediator } from "../../types";
|
|
5
|
+
import { BaseManager } from "../base";
|
|
6
|
+
type FetchOptions = {
|
|
7
|
+
mediatorId?: string;
|
|
8
|
+
cache?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare class GuildMediatorManager extends BaseManager<GuildMediator> {
|
|
11
|
+
constructor(guild: Guild);
|
|
12
|
+
fetch(options?: FetchOptions): Promise<Collection<string, GuildMediator> | GuildMediator>;
|
|
13
|
+
updateMany(...mediators: Optional<APIGuildMediator>[]): Promise<Collection<string, GuildMediator>>;
|
|
14
|
+
create(payload: Optional<APIGuildMediator>): Promise<GuildMediator>;
|
|
15
|
+
deleteAll(): Promise<void>;
|
|
16
|
+
resetAll(): Promise<Collection<string, GuildMediator>>;
|
|
17
|
+
set(data: APIGuildMediator | APIGuildMediator[]): GuildMediator | Collection<string, GuildMediator>;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { REST } from "../../rest";
|
|
2
|
+
import { Guild } from "../../structures";
|
|
2
3
|
import { Collection } from "../../structures/Collection";
|
|
3
4
|
import { APIMessage, Optional } from "../../types";
|
|
4
5
|
type T<e> = e & {
|
|
5
6
|
rest: REST;
|
|
7
|
+
guild: Guild;
|
|
6
8
|
messages: MessagesManager<e>;
|
|
7
9
|
};
|
|
8
10
|
export declare class MessagesManager<Structure> {
|
|
9
11
|
cache: Collection<string, APIMessage>;
|
|
10
12
|
readonly base_url: string;
|
|
11
13
|
readonly rest: REST;
|
|
14
|
+
readonly guild: Guild;
|
|
12
15
|
constructor(structure: T<Structure>, base_url: string);
|
|
13
16
|
fetch(): Promise<APIMessage>;
|
|
14
|
-
create(data: Optional<APIMessage> | Optional<APIMessage>[]): Promise<APIMessage
|
|
15
|
-
|
|
17
|
+
create(data: Optional<APIMessage> | Optional<APIMessage>[]): Promise<Collection<string, APIMessage>>;
|
|
18
|
+
set(data: APIMessage | APIMessage[]): Collection<string, APIMessage>;
|
|
16
19
|
}
|
|
17
20
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Collection } from "../../structures";
|
|
2
|
+
import { APIPlayer } from "../../types";
|
|
3
|
+
export type AddPlayer = APIPlayer[] | APIPlayer;
|
|
4
|
+
export declare class PlayerManager {
|
|
5
|
+
_cache: Collection<string, APIPlayer>;
|
|
6
|
+
constructor(players: APIPlayer | APIPlayer[], base_url: string);
|
|
7
|
+
get(id: string): APIPlayer;
|
|
8
|
+
add(player: AddPlayer): void;
|
|
9
|
+
}
|
package/types/rest/REST.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { MinesGameManager } from "../managers";
|
|
|
8
8
|
import { StatusResponse } from "../types";
|
|
9
9
|
import { GuildBetUser } from "../structures/betuser/GuildBetUser";
|
|
10
10
|
import { GuildBet, GuildTicket, VipMember } from "../structures";
|
|
11
|
+
import { GuildMediator } from "../structures/mediator/GuildMediator";
|
|
11
12
|
interface ClientOptions {
|
|
12
13
|
clientKey: string;
|
|
13
14
|
guildId: string;
|
|
@@ -32,6 +33,7 @@ export declare class REST extends EventEmitter {
|
|
|
32
33
|
bets: Collection<string, GuildBet>;
|
|
33
34
|
tickets: Collection<string, GuildTicket>;
|
|
34
35
|
vipmembers: Collection<string, VipMember>;
|
|
36
|
+
mediators: Collection<string, GuildMediator>;
|
|
35
37
|
/**
|
|
36
38
|
*
|
|
37
39
|
* @param key The unique key for he client
|
|
@@ -39,6 +41,7 @@ export declare class REST extends EventEmitter {
|
|
|
39
41
|
constructor(options: ClientOptions);
|
|
40
42
|
/** Initialize the caching sistem */
|
|
41
43
|
init(): Promise<this>;
|
|
44
|
+
formatUrl(url: string): string;
|
|
42
45
|
/**
|
|
43
46
|
* Request Data from a certain url
|
|
44
47
|
* @param options
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { GuildBetManager } from "../../managers";
|
|
1
|
+
import { GuildBetManager, MessagesManager } from "../../managers";
|
|
2
2
|
import { REST } from "../../rest";
|
|
3
|
-
import { APIBetChannel, APIGuildBet,
|
|
3
|
+
import { APIBetChannel, APIGuildBet, APIPlayer, BaseMatchModes, BetQueue, Confirm, Optional } from "../../types";
|
|
4
4
|
import { Guild } from "../guild/Guild";
|
|
5
5
|
export declare class GuildBet {
|
|
6
6
|
/** The bet's type */
|
|
@@ -19,7 +19,7 @@ export declare class GuildBet {
|
|
|
19
19
|
/** The bet's channel */
|
|
20
20
|
channels: APIBetChannel[];
|
|
21
21
|
/** The bet's messages */
|
|
22
|
-
messages:
|
|
22
|
+
messages: MessagesManager<GuildBet>;
|
|
23
23
|
/** The id of the winner */
|
|
24
24
|
winners: APIPlayer[];
|
|
25
25
|
/** The id of the loser */
|
|
@@ -37,13 +37,14 @@ export declare class GuildBet {
|
|
|
37
37
|
/** Bet's id */
|
|
38
38
|
_id: string;
|
|
39
39
|
queues: BetQueue[];
|
|
40
|
+
guild_id: string;
|
|
40
41
|
rest: REST;
|
|
41
42
|
guild: Guild;
|
|
42
43
|
manager: GuildBetManager;
|
|
43
44
|
constructor(data: Optional<APIGuildBet>, manager: GuildBetManager);
|
|
44
45
|
toString(): string;
|
|
45
46
|
fetch(): Promise<this>;
|
|
46
|
-
addPlayer(player: APIPlayer): Promise<this>;
|
|
47
|
+
addPlayer(player: APIPlayer, queue_type?: string): Promise<this>;
|
|
47
48
|
removePlayer(player: APIPlayer): Promise<this>;
|
|
48
49
|
update(data: Optional<APIGuildBet>): Promise<this>;
|
|
49
50
|
delete(): Promise<boolean>;
|
|
@@ -2,6 +2,7 @@ import { REST } from "../../rest/REST";
|
|
|
2
2
|
import { Daily, Optional, Profile } from "../../types/api";
|
|
3
3
|
import { APIGuildBetUser } from "../../types/api/APIGuildBetUser";
|
|
4
4
|
import { GuildBetUserManager } from "../../managers/betuser/GuildBetUserManager";
|
|
5
|
+
import { Guild } from "../guild/Guild";
|
|
5
6
|
export declare class GuildBetUser implements APIGuildBetUser {
|
|
6
7
|
/** User daily */
|
|
7
8
|
daily: Omit<Daily, "points">;
|
|
@@ -27,10 +28,12 @@ export declare class GuildBetUser implements APIGuildBetUser {
|
|
|
27
28
|
createdAt: Date;
|
|
28
29
|
/** Updated Date */
|
|
29
30
|
updatedAt: Date;
|
|
31
|
+
consecutive_wins: number;
|
|
30
32
|
/** The given manager */
|
|
31
33
|
readonly manager: GuildBetUserManager;
|
|
32
34
|
/** The rest client */
|
|
33
35
|
readonly rest: REST;
|
|
36
|
+
readonly guild: Guild;
|
|
34
37
|
/**
|
|
35
38
|
* Bet user
|
|
36
39
|
* @param data The user's data
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BufferManager, GuildBetManager, GuildMatchManager, GuildPermissionManager, GuildTicketManager, GuildUserManager, LogManager, VipMemberManager } from "../../managers";
|
|
2
2
|
import { GuildBetUserManager } from "../../managers/betuser/GuildBetUserManager";
|
|
3
|
+
import { GuildMediatorManager } from "../../managers/mediator/GuildMediatorManager";
|
|
3
4
|
import { REST } from "../../rest/REST";
|
|
4
5
|
import { APICode, APIGuildAdvert, APIGuildGroupedChannel, APIGuildPermissions, APIGuildShop, Daily, GuildPermissionsTypes, Optional, Permission } from "../../types/api";
|
|
5
6
|
import { APIGuild, DailyCategories, GuildChannelsType, GuildModes, GuildPrices, GuildScores, GuildStatus, GuildTicketConfiguration } from "../../types/api/APIGuild";
|
|
@@ -44,6 +45,7 @@ export declare class Guild {
|
|
|
44
45
|
shop: APIGuildShop;
|
|
45
46
|
betusers: GuildBetUserManager;
|
|
46
47
|
bets: GuildBetManager;
|
|
48
|
+
mediators: GuildMediatorManager;
|
|
47
49
|
adverts: APIGuildAdvert[];
|
|
48
50
|
codes: APICode[];
|
|
49
51
|
coin_symbol: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { REST } from "../../rest/REST";
|
|
2
2
|
import { APIBaseChannel, APIGuildMatch, APIMessage, APIPlayer, BaseMatchModes, BaseMatchStatus, Confirm, MatchSelection, Optional } from "../../types";
|
|
3
|
-
import { GuildMatchManager } from "../../managers";
|
|
3
|
+
import { GuildMatchManager, MessagesManager } from "../../managers";
|
|
4
4
|
import { Guild } from "../guild/Guild";
|
|
5
|
+
import { GuildBet } from "../bet/GuildBet";
|
|
5
6
|
export declare class GuildMatch {
|
|
6
7
|
_id: string;
|
|
7
8
|
selections: MatchSelection[];
|
|
@@ -36,10 +37,12 @@ export declare class GuildMatch {
|
|
|
36
37
|
createdAt: Date;
|
|
37
38
|
/** Updated Date */
|
|
38
39
|
updatedAt: Date;
|
|
39
|
-
messages:
|
|
40
|
+
messages: MessagesManager<GuildMatch>;
|
|
40
41
|
/** Match's id */
|
|
41
42
|
mvps: [];
|
|
42
43
|
manager: GuildMatchManager;
|
|
44
|
+
bet: GuildBet;
|
|
45
|
+
admin_id: string;
|
|
43
46
|
/** The given guild */
|
|
44
47
|
readonly guild: Guild;
|
|
45
48
|
/** The rest client */
|
|
@@ -57,16 +60,19 @@ export declare class GuildMatch {
|
|
|
57
60
|
* @returns New Instance of the match
|
|
58
61
|
*/
|
|
59
62
|
fetch(): Promise<GuildMatch>;
|
|
60
|
-
addConfirmed(type: string, id: string): Promise<
|
|
63
|
+
addConfirmed(type: string, id: string | string[]): Promise<GuildMatch>;
|
|
61
64
|
setConfirmed(set: Confirm[]): Promise<GuildMatch>;
|
|
62
65
|
setStatus(status: BaseMatchStatus): Promise<GuildMatch>;
|
|
63
66
|
setWinners(players: Optional<APIPlayer>[] | Optional<APIPlayer>): Promise<GuildMatch>;
|
|
64
67
|
setLoser(players: Optional<APIPlayer>[] | Optional<APIPlayer>): Promise<GuildMatch>;
|
|
65
68
|
setMvps(...usersId: string[]): Promise<GuildMatch>;
|
|
66
69
|
setRoomCreatorId(userId: string): Promise<GuildMatch>;
|
|
70
|
+
setRoomAdminId(userId: string): Promise<GuildMatch>;
|
|
67
71
|
kick(player: Optional<APIPlayer>): Promise<this>;
|
|
68
72
|
update(data: Optional<APIGuildMatch>): Promise<GuildMatch>;
|
|
69
73
|
delete(): Promise<boolean>;
|
|
70
|
-
toJSON():
|
|
74
|
+
toJSON(): {
|
|
75
|
+
messages: APIMessage[];
|
|
76
|
+
};
|
|
71
77
|
_updateInternals(data: Optional<APIGuildMatch>): this;
|
|
72
78
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { GuildMediatorManager } from "../../managers/mediator/GuildMediatorManager";
|
|
2
|
+
import { REST } from "../../rest/REST";
|
|
3
|
+
import { Optional } from "../../types/api";
|
|
4
|
+
import { APIGuildMediator } from "../../types/api/APIGuildMediator";
|
|
5
|
+
import { Guild } from "../guild/Guild";
|
|
6
|
+
export declare class GuildMediator implements APIGuildMediator {
|
|
7
|
+
/** User's name */
|
|
8
|
+
id: string;
|
|
9
|
+
guild_id: string;
|
|
10
|
+
/** User's games */
|
|
11
|
+
games: number;
|
|
12
|
+
paypal: string;
|
|
13
|
+
revolut: string;
|
|
14
|
+
mbway: string;
|
|
15
|
+
external_links: string[];
|
|
16
|
+
/** Creation Date */
|
|
17
|
+
createdAt: Date;
|
|
18
|
+
/** Updated Date */
|
|
19
|
+
updatedAt: Date;
|
|
20
|
+
/** The given manager */
|
|
21
|
+
readonly manager: GuildMediatorManager;
|
|
22
|
+
/** The rest client */
|
|
23
|
+
readonly rest: REST;
|
|
24
|
+
readonly guild: Guild;
|
|
25
|
+
/**
|
|
26
|
+
* Bet user
|
|
27
|
+
* @param data The user's data
|
|
28
|
+
* @param manager The manager
|
|
29
|
+
* @param rest The rest client
|
|
30
|
+
*/
|
|
31
|
+
constructor(data: APIGuildMediator, manager: GuildMediatorManager);
|
|
32
|
+
/** String representation of this user */
|
|
33
|
+
toString(): string;
|
|
34
|
+
/**
|
|
35
|
+
* Fetches the user
|
|
36
|
+
* @returns New Instance of the user
|
|
37
|
+
*/
|
|
38
|
+
fetch(): Promise<GuildMediator>;
|
|
39
|
+
reset(): Promise<this>;
|
|
40
|
+
_updateInternals(data: Optional<APIGuildMediator>): this;
|
|
41
|
+
/**
|
|
42
|
+
* Update certain property
|
|
43
|
+
* @param data The new data to update with
|
|
44
|
+
* @returns
|
|
45
|
+
*/
|
|
46
|
+
update(data: Optional<APIGuildMediator>): Promise<this>;
|
|
47
|
+
setPaymentlink(type: string, link: string): Promise<this>;
|
|
48
|
+
delete(): Promise<boolean>;
|
|
49
|
+
toJSON(): Optional<APIGuildMediator>;
|
|
50
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GuildTicketManager } from "../../managers";
|
|
2
2
|
import { REST } from "../../rest";
|
|
3
|
-
import { APIGuildTicket,
|
|
3
|
+
import { APIGuildTicket, APIMessage, Optional } from "../../types";
|
|
4
4
|
import { Guild } from "../";
|
|
5
5
|
export declare class GuildTicket implements APIGuildTicket {
|
|
6
6
|
_id: string;
|
|
@@ -12,7 +12,7 @@ export declare class GuildTicket implements APIGuildTicket {
|
|
|
12
12
|
closed_by_id: string;
|
|
13
13
|
creator_id: string;
|
|
14
14
|
customer_rating: number;
|
|
15
|
-
messages:
|
|
15
|
+
messages: APIMessage[];
|
|
16
16
|
createdAt: Date;
|
|
17
17
|
updatedAt: Date;
|
|
18
18
|
readonly rest: REST;
|
|
@@ -25,6 +25,6 @@ export declare class GuildTicket implements APIGuildTicket {
|
|
|
25
25
|
setChannelId(id: string): Promise<GuildTicket>;
|
|
26
26
|
setClosedById(id: string): Promise<GuildTicket>;
|
|
27
27
|
setStatus(status: "on" | "off"): Promise<GuildTicket>;
|
|
28
|
-
addMessage(message: Optional<
|
|
28
|
+
addMessage(message: Optional<APIMessage>): Promise<GuildTicket>;
|
|
29
29
|
_updateInternals(data: Optional<APIGuildTicket>): this;
|
|
30
30
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseMatchModes, BaseMatchStatus, Confirm } from ".";
|
|
1
|
+
import { APIGuildBet, BaseMatchModes, BaseMatchStatus, Confirm } from ".";
|
|
2
2
|
import { APIBaseChannel } from "./APIBaseChannel";
|
|
3
3
|
import { APIMessage } from "./APIMessage";
|
|
4
4
|
import { APIPlayer } from "./APIPlayer";
|
|
@@ -16,6 +16,7 @@ export interface APIGuildMatch {
|
|
|
16
16
|
status: BaseMatchStatus;
|
|
17
17
|
/** Match's challenge */
|
|
18
18
|
challenge: boolean;
|
|
19
|
+
admin_id: string;
|
|
19
20
|
/** Match's players */
|
|
20
21
|
players: APIPlayer[];
|
|
21
22
|
/** Match's winners */
|
|
@@ -38,6 +39,7 @@ export interface APIGuildMatch {
|
|
|
38
39
|
creatorId: string;
|
|
39
40
|
/** Match's room creator id */
|
|
40
41
|
roomCreatorId: string;
|
|
42
|
+
bet: APIGuildBet;
|
|
41
43
|
/** Creation Date */
|
|
42
44
|
createdAt: Date;
|
|
43
45
|
/** Updated Date */
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
export interface APIGuildMediator extends APIPlayer {
|
|
1
|
+
export interface APIGuildMediator {
|
|
3
2
|
/** Mediator's id */
|
|
4
3
|
id: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
guild_id: string;
|
|
5
|
+
paypal: string;
|
|
6
|
+
revolut: string;
|
|
7
|
+
mbway: string;
|
|
8
|
+
external_links: string[];
|
|
9
|
+
games: number;
|
|
9
10
|
/** Creation Date */
|
|
10
11
|
createdAt: Date;
|
|
11
12
|
/** Updated Date */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { APIMessage } from "./APIMessage";
|
|
2
2
|
export interface APIGuildTicket {
|
|
3
3
|
/** Ticket's id */
|
|
4
4
|
_id: string;
|
|
@@ -10,7 +10,7 @@ export interface APIGuildTicket {
|
|
|
10
10
|
admin_id: string;
|
|
11
11
|
customer_rating: number;
|
|
12
12
|
closed_by_id: string;
|
|
13
|
-
messages:
|
|
13
|
+
messages: APIMessage[];
|
|
14
14
|
createdAt: Date;
|
|
15
15
|
updatedAt: Date;
|
|
16
16
|
}
|
|
@@ -5,7 +5,13 @@ export declare enum LogEntryTypes {
|
|
|
5
5
|
MatchUpdated = "match_updated",
|
|
6
6
|
MatchClosed = "match_closed",
|
|
7
7
|
UserUpdated = "user_updated",
|
|
8
|
-
UserManaged = "user_managed"
|
|
8
|
+
UserManaged = "user_managed",
|
|
9
|
+
BetManaged = "bet_managed",
|
|
10
|
+
BetMediador = "bet_mediador",
|
|
11
|
+
BetInitiated = "bet_initiated",
|
|
12
|
+
BetClosed = "bet_closed",
|
|
13
|
+
BetAwaitingConfirmation = "bet_awaiting_confirmation",
|
|
14
|
+
BetCanceled = "bet_canceled"
|
|
9
15
|
}
|
|
10
16
|
export interface APILogEntry {
|
|
11
17
|
_id: string;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
export interface APIMessage {
|
|
2
|
-
/** Message's content */
|
|
3
|
-
content?: string | object;
|
|
4
2
|
_id?: string;
|
|
5
|
-
|
|
3
|
+
author_id?: string;
|
|
6
4
|
extension?: string;
|
|
7
|
-
/** Message's
|
|
8
|
-
|
|
5
|
+
/** Message's content */
|
|
6
|
+
content?: string | object;
|
|
9
7
|
/** Creation Date */
|
|
10
8
|
createdAt?: Date;
|
|
11
9
|
/** Updated Date */
|
|
@@ -139,7 +139,6 @@ export interface StatusResponse {
|
|
|
139
139
|
export * from "./APIAdvert";
|
|
140
140
|
export * from "./APIBaseChannel";
|
|
141
141
|
export * from "./APIBetChannel";
|
|
142
|
-
export * from "./APIBetMessage";
|
|
143
142
|
export * from "./APICode";
|
|
144
143
|
export * from "./APIGiveaway";
|
|
145
144
|
export * from "./APIGuild";
|
|
@@ -155,7 +154,6 @@ export * from "./APIGuildShop";
|
|
|
155
154
|
export * from "./APIGuildTicket";
|
|
156
155
|
export * from "./APIGuildUser";
|
|
157
156
|
export * from "./APILogEntry";
|
|
158
|
-
export * from "./APILogMessage";
|
|
159
157
|
export * from "./APIMessage";
|
|
160
158
|
export * from "./APIMinesGame";
|
|
161
159
|
export * from "./APIPlayer";
|