@duque.edits/sdk 0.1.5 → 0.1.6

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 (118) hide show
  1. package/dist/index.js +4 -31
  2. package/dist/managers/base.js +26 -0
  3. package/dist/managers/buffer/BufferManager.js +2 -2
  4. package/dist/managers/guild/GuildManager.js +42 -25
  5. package/dist/managers/index.js +23 -0
  6. package/dist/managers/match/GuildMatchManager.js +42 -31
  7. package/dist/managers/message/MessagesManager.js +48 -0
  8. package/dist/managers/permission/GuildPermissionManager.js +29 -52
  9. package/dist/managers/ticket/TicketManager.js +77 -0
  10. package/dist/managers/user/GuildUserManager.js +73 -85
  11. package/dist/managers/vipmember/VipMemberManager.js +23 -23
  12. package/dist/rest/REST.js +40 -24
  13. package/dist/rest/Routes.js +15 -17
  14. package/dist/rest/index.js +19 -0
  15. package/dist/structures/Collection.js +1 -1
  16. package/dist/structures/guild/Guild.js +59 -94
  17. package/dist/structures/index.js +22 -0
  18. package/dist/structures/match/GuildMatch.js +64 -111
  19. package/dist/structures/ticket/Ticket.js +119 -0
  20. package/dist/structures/user/GuildUser.js +46 -40
  21. package/dist/structures/vipmember/VipMember.js +5 -5
  22. package/dist/types/api/APILogMessage.js +2 -0
  23. package/dist/types/api/index.js +36 -0
  24. package/dist/types/index.js +1 -22
  25. package/package.json +11 -18
  26. package/types/index.d.ts +4 -0
  27. package/types/managers/base.d.ts +17 -0
  28. package/{dist → types}/managers/buffer/BufferManager.d.ts +2 -1
  29. package/{dist → types}/managers/guild/GuildManager.d.ts +12 -4
  30. package/types/managers/index.d.ts +7 -0
  31. package/{dist → types}/managers/match/GuildMatchManager.d.ts +10 -12
  32. package/types/managers/message/MessagesManager.d.ts +17 -0
  33. package/types/managers/permission/GuildPermissionManager.d.ts +8 -0
  34. package/types/managers/ticket/TicketManager.d.ts +22 -0
  35. package/types/managers/user/GuildUserManager.d.ts +19 -0
  36. package/{dist → types}/managers/vipmember/VipMemberManager.d.ts +8 -8
  37. package/types/rest/APIEndpoints.d.ts +11 -0
  38. package/{dist → types}/rest/REST.d.ts +9 -18
  39. package/{dist → types}/rest/Routes.d.ts +2 -2
  40. package/types/rest/index.d.ts +3 -0
  41. package/{dist → types}/structures/guild/Guild.d.ts +12 -29
  42. package/types/structures/index.d.ts +6 -0
  43. package/{dist → types}/structures/match/GuildMatch.d.ts +12 -22
  44. package/types/structures/ticket/Ticket.d.ts +30 -0
  45. package/{dist → types}/structures/user/GuildUser.d.ts +5 -3
  46. package/{dist → types}/structures/vipmember/VipMember.d.ts +1 -1
  47. package/types/types/RestTypes.d.ts +34 -0
  48. package/{dist → types}/types/api/APIGuild.d.ts +9 -2
  49. package/{dist → types}/types/api/APIGuildMatch.d.ts +9 -7
  50. package/types/types/api/APIGuildTicket.d.ts +16 -0
  51. package/{dist → types}/types/api/APIGuildUser.d.ts +3 -1
  52. package/types/types/api/APILogMessage.d.ts +7 -0
  53. package/{dist → types}/types/api/APIMessage.d.ts +3 -4
  54. package/{dist → types}/types/api/APIPlayer.d.ts +1 -1
  55. package/{dist → types}/types/api/index.d.ts +23 -1
  56. package/types/types/index.d.ts +2 -0
  57. package/dist/index.d.ts +0 -31
  58. package/dist/managers/bet/GuildBetManager.d.ts +0 -35
  59. package/dist/managers/bet/GuildBetManager.js +0 -126
  60. package/dist/managers/betuser/GuildBetUserManager.d.ts +0 -36
  61. package/dist/managers/betuser/GuildBetUserManager.js +0 -151
  62. package/dist/managers/channel/ChannelManager.d.ts +0 -39
  63. package/dist/managers/channel/ChannelManager.js +0 -148
  64. package/dist/managers/giveaway/GiveawayManager.d.ts +0 -16
  65. package/dist/managers/giveaway/GiveawayManager.js +0 -57
  66. package/dist/managers/groupedchannel/GroupedChannelManager.d.ts +0 -34
  67. package/dist/managers/groupedchannel/GroupedChannelManager.js +0 -92
  68. package/dist/managers/mediator/GuildMediatorManager.d.ts +0 -32
  69. package/dist/managers/mediator/GuildMediatorManager.js +0 -98
  70. package/dist/managers/messages/MessagesManager.d.ts +0 -32
  71. package/dist/managers/messages/MessagesManager.js +0 -89
  72. package/dist/managers/permission/GuildPermissionManager.d.ts +0 -26
  73. package/dist/managers/product/GuildProductManager.d.ts +0 -32
  74. package/dist/managers/product/GuildProductManager.js +0 -103
  75. package/dist/managers/ticket/GuildTicketManager.d.ts +0 -32
  76. package/dist/managers/ticket/GuildTicketManager.js +0 -100
  77. package/dist/managers/user/GuildUserManager.d.ts +0 -33
  78. package/dist/rest/APIEndpoints.d.ts +0 -11
  79. package/dist/structures/bet/GuildBet.d.ts +0 -87
  80. package/dist/structures/bet/GuildBet.js +0 -286
  81. package/dist/structures/betuser/GuildBetUser.d.ts +0 -85
  82. package/dist/structures/betuser/GuildBetUser.js +0 -211
  83. package/dist/structures/channel/Channel.d.ts +0 -31
  84. package/dist/structures/channel/Channel.js +0 -57
  85. package/dist/structures/giveaway/Giveaway.d.ts +0 -37
  86. package/dist/structures/giveaway/Giveaway.js +0 -208
  87. package/dist/structures/groupedchannel/GroupedChannel.d.ts +0 -34
  88. package/dist/structures/groupedchannel/GroupedChannel.js +0 -121
  89. package/dist/structures/mediator/GuildMediator.d.ts +0 -41
  90. package/dist/structures/mediator/GuildMediator.js +0 -131
  91. package/dist/structures/product/GuildProduct.d.ts +0 -52
  92. package/dist/structures/product/GuildProduct.js +0 -175
  93. package/dist/structures/shop/GuildShop.d.ts +0 -34
  94. package/dist/structures/shop/GuildShop.js +0 -80
  95. package/dist/structures/ticket/GuildTicket.d.ts +0 -52
  96. package/dist/structures/ticket/GuildTicket.js +0 -172
  97. package/dist/types/api/APIGuildTicket.d.ts +0 -26
  98. package/dist/types/index.d.ts +0 -23
  99. /package/dist/types/{api/APIGuildMessage.js → RestTypes.js} +0 -0
  100. /package/{dist → types}/structures/Collection.d.ts +0 -0
  101. /package/{dist → types}/types/api/APIBaseChannel.d.ts +0 -0
  102. /package/{dist → types}/types/api/APIBetChannel.d.ts +0 -0
  103. /package/{dist → types}/types/api/APIBetMessage.d.ts +0 -0
  104. /package/{dist → types}/types/api/APIGiveaway.d.ts +0 -0
  105. /package/{dist → types}/types/api/APIGuildBet.d.ts +0 -0
  106. /package/{dist → types}/types/api/APIGuildBetUser.d.ts +0 -0
  107. /package/{dist → types}/types/api/APIGuildChannel.d.ts +0 -0
  108. /package/{dist → types}/types/api/APIGuildEmoji.d.ts +0 -0
  109. /package/{dist → types}/types/api/APIGuildGroupedChannel.d.ts +0 -0
  110. /package/{dist → types}/types/api/APIGuildMediator.d.ts +0 -0
  111. /package/{dist → types}/types/api/APIGuildMessage.d.ts +0 -0
  112. /package/{dist → types}/types/api/APIGuildPermissions.d.ts +0 -0
  113. /package/{dist → types}/types/api/APIGuildRole.d.ts +0 -0
  114. /package/{dist → types}/types/api/APIGuildShop.d.ts +0 -0
  115. /package/{dist → types}/types/api/APIProduct.d.ts +0 -0
  116. /package/{dist → types}/types/api/APIVipMember.d.ts +0 -0
  117. /package/{dist → types}/utils/Assertion.d.ts +0 -0
  118. /package/{dist → types}/utils/getRandomNumber.d.ts +0 -0
@@ -4,12 +4,12 @@ import { Collection } from "../../structures/Collection";
4
4
  import { Guild } from "../../structures/guild/Guild";
5
5
  import { APIVipMember } from "../../types/api/APIVipMember";
6
6
  import { Optional } from "../../types";
7
- export declare class VipMemberManager {
8
- /** A cache of vipmembers */
9
- cache: Collection<string, VipMember>;
10
- /** The rest client */
11
- readonly rest: REST;
12
- readonly guild: Guild;
7
+ import { BaseManager } from "../base";
8
+ type FecthOptions = {
9
+ cache?: boolean;
10
+ memberId?: string;
11
+ };
12
+ export declare class VipMemberManager extends BaseManager<VipMember> {
13
13
  /**
14
14
  * Manage vipmembers with the given client
15
15
  * @param vipmembers An array of vipmembers
@@ -22,8 +22,7 @@ export declare class VipMemberManager {
22
22
  * @param id Id of the member to fetch
23
23
  * @returns VipMember
24
24
  */
25
- fetch(id: string): Promise<VipMember>;
26
- fetchAll(): Promise<Collection<string, VipMember>>;
25
+ fetch(options?: FecthOptions): Promise<Collection<string, VipMember> | VipMember>;
27
26
  updateMember(id: string, data: Optional<APIVipMember>): Promise<VipMember>;
28
27
  set(data: APIVipMember): VipMember;
29
28
  setAll(data: APIVipMember[]): Collection<string, VipMember>;
@@ -31,3 +30,4 @@ export declare class VipMemberManager {
31
30
  delete(id: string): Promise<Collection<string, VipMember>>;
32
31
  deleteAll(): Promise<boolean>;
33
32
  }
33
+ export {};
@@ -0,0 +1,11 @@
1
+ declare class Guild {
2
+ id: string;
3
+ tickets: [];
4
+ }
5
+ export declare const APIEndpoints: {
6
+ readonly "guilds/get": {
7
+ readonly response: typeof Guild;
8
+ };
9
+ };
10
+ export type APIEndpoint = keyof typeof APIEndpoints;
11
+ export {};
@@ -1,20 +1,9 @@
1
1
  import EventEmitter from "events";
2
2
  import { GuildManager } from "../managers/guild/GuildManager";
3
- import { GuildBet } from "../structures/bet/GuildBet";
4
3
  import { Collection } from "../structures/Collection";
5
- import { GuildBetUser } from "../structures/betuser/GuildBetUser";
6
4
  import { GuildMatch } from "../structures/match/GuildMatch";
7
- import { GuildMediator } from "../structures/mediator/GuildMediator";
8
5
  import { GuildUser } from "../structures/user/GuildUser";
9
- import { GiveawayManager } from "../managers/giveaway/GiveawayManager";
10
- interface RequestOptions<Payload> {
11
- /** The request's method */
12
- method: string;
13
- /** The request's url */
14
- url: string;
15
- /** The request payload */
16
- payload?: Payload;
17
- }
6
+ import { RestEvents, RequestOptions } from "../types/RestTypes";
18
7
  /**
19
8
  * The main class of this package
20
9
  */
@@ -25,12 +14,8 @@ export declare class REST extends EventEmitter {
25
14
  key: string;
26
15
  /** The guild manager */
27
16
  guilds: GuildManager;
28
- giveaways: GiveawayManager;
29
- bets: Collection<string, GuildBet>;
30
- matches: Collection<string, GuildMatch>;
31
- betUsers: Collection<string, GuildBetUser>;
32
17
  users: Collection<string, GuildUser>;
33
- mediators: Collection<string, GuildMediator>;
18
+ matches: Collection<string, GuildMatch>;
34
19
  /**
35
20
  *
36
21
  * @param key The unique key for he client
@@ -43,11 +28,17 @@ export declare class REST extends EventEmitter {
43
28
  setKey(key: string): void;
44
29
  /** Initialize the caching sistem */
45
30
  init(): Promise<this>;
31
+ /**
32
+ * Ping the api
33
+ */
34
+ ping(): Promise<unknown>;
46
35
  /**
47
36
  * Request Data from a certain url
48
37
  * @param options
49
38
  * @returns
50
39
  */
51
40
  request<Expecting, Payload>(options: RequestOptions<Payload>): Promise<Expecting>;
41
+ emit<K extends keyof RestEvents>(event: K, ...args: RestEvents[K]): boolean;
42
+ on<K extends keyof RestEvents>(event: K, listener: (...args: RestEvents[K]) => void): this;
43
+ once<K extends keyof RestEvents>(event: K, listener: (...args: RestEvents[K]) => void): this;
52
44
  }
53
- export {};
@@ -1,4 +1,4 @@
1
- export declare const Route: <K>(route: string) => string;
1
+ import { APIGuildTicket } from "../types";
2
2
  export declare const Routes: {
3
3
  base: string;
4
4
  field: (field: string) => string;
@@ -54,7 +54,7 @@ export declare const Routes: {
54
54
  update: (guildId: string, ticketId: string) => string;
55
55
  delete: (guildId: string, ticketId: string) => string;
56
56
  deleteAll: (guildId: string) => string;
57
- resource: (guildId: string, ticketId: string, ...resources: string[]) => string;
57
+ resource: (guildId: string, ticketId: string, ...resources: (keyof APIGuildTicket)[]) => string;
58
58
  };
59
59
  mediators: {
60
60
  getAll: (guildId: string) => string;
@@ -0,0 +1,3 @@
1
+ export * from "./APIEndpoints";
2
+ export * from "./Routes";
3
+ export * from "./REST";
@@ -1,23 +1,15 @@
1
- import { GuildBetManager } from "../../managers/bet/GuildBetManager";
2
- import { GuildBetUserManager } from "../../managers/betuser/GuildBetUserManager";
1
+ import { GuildPermissionManager } from "../../managers/permission/GuildPermissionManager";
3
2
  import { BufferManager } from "../../managers/buffer/BufferManager";
4
- import { GroupedChannelManager } from "../../managers/groupedchannel/GroupedChannelManager";
5
3
  import { GuildMatchManager } from "../../managers/match/GuildMatchManager";
6
- import { GuildMediatorManager } from "../../managers/mediator/GuildMediatorManager";
7
- import { MessagesManager } from "../../managers/messages/MessagesManager";
8
- import { GuildPermissionManager } from "../../managers/permission/GuildPermissionManager";
9
- import { GuildTicketManager } from "../../managers/ticket/GuildTicketManager";
10
- import { GuildUserManager } from "../../managers/user/GuildUserManager";
11
4
  import { VipMemberManager } from "../../managers/vipmember/VipMemberManager";
12
5
  import { REST } from "../../rest/REST";
13
- import { Daily, GuildBlacklist } from "../../types/api";
14
- import { APIGuild, DailyCategories, GuildPrices, GuildScores, GuildStatus, GuildTicketConfiguration } from "../../types/api/APIGuild";
6
+ import { Daily, GuildBlacklist, Optional } from "../../types/api";
7
+ import { APIGuild, DailyCategories, GuildModes, GuildPrices, GuildScores, GuildStatus, GuildTicketConfiguration } from "../../types/api/APIGuild";
15
8
  import { APIGuildEmoji } from "../../types/api/APIGuildEmoji";
16
9
  import { APIGuildPermissions } from "../../types/api/APIGuildPermissions";
17
10
  import { APIGuildRole } from "../../types/api/APIGuildRole";
18
- import { GuildBetUser } from "../betuser/GuildBetUser";
19
- import { GuildShop } from "../shop/GuildShop";
20
- import { GuildUser } from "../user/GuildUser";
11
+ import { GuildUserManager } from "../../managers/user/GuildUserManager";
12
+ import { TicketManager } from "../../managers";
21
13
  /** The Guild */
22
14
  export declare class Guild {
23
15
  /** The data of this guild */
@@ -26,14 +18,14 @@ export declare class Guild {
26
18
  rest: REST;
27
19
  /** The guild's id */
28
20
  id: string;
21
+ modes: GuildModes;
29
22
  /** Guild's client key */
30
23
  clientKey: string;
31
24
  /** Guild Permissions */
32
25
  permissions: APIGuildPermissions;
33
26
  /** Guild Ticket */
34
- tickets: GuildTicketManager;
35
27
  /** Guild Ticket Configuration */
36
- ticketsConfiguration: GuildTicketConfiguration;
28
+ tickets_configuration: GuildTicketConfiguration;
37
29
  /** Guild Daily Categories */
38
30
  dailyCategories: DailyCategories[];
39
31
  /** Guild Scores */
@@ -41,9 +33,7 @@ export declare class Guild {
41
33
  /** Guild Status */
42
34
  status: GuildStatus;
43
35
  /** Guild Channel */
44
- channels: GroupedChannelManager;
45
36
  /** Guild Categories */
46
- categories: GroupedChannelManager;
47
37
  /** Guild Blacklist */
48
38
  blacklist: GuildBlacklist;
49
39
  /** Guild Prefix */
@@ -56,38 +46,31 @@ export declare class Guild {
56
46
  createdAt: Date;
57
47
  /** Guild Updated Date */
58
48
  updatedAt: Date;
59
- /** Guild Bets */
60
- bets: GuildBetManager;
61
49
  /** Guild Users */
62
- users: GuildUserManager;
63
50
  /** Guild Bet Users */
64
- betUsers: GuildBetUserManager;
65
51
  /** Guild Matches */
66
52
  matches: GuildMatchManager;
67
- /** Guild Mediators */
68
- mediators: GuildMediatorManager;
69
- /** Guild Messages */
70
- messages: MessagesManager;
71
53
  /** Guild Emojis */
72
54
  emojis: APIGuildEmoji[];
73
55
  /** Guild Roles */
74
56
  roles: APIGuildRole[];
75
57
  /** Guild Prices Used */
76
58
  prices: GuildPrices;
77
- /** Guild Shop */
78
- shop: GuildShop;
79
59
  permissionsManager: GuildPermissionManager;
80
60
  buffer: BufferManager;
81
61
  vipMembers: VipMemberManager;
62
+ users: GuildUserManager;
63
+ tickets: TicketManager;
82
64
  /**
83
65
  * The guild structure
84
66
  * @param data The guild's data
85
67
  * @param rest The rest client
86
68
  */
87
69
  constructor(data: APIGuild, rest: REST);
70
+ _updateInternals(data: Optional<APIGuild>): this;
88
71
  fetch(): Promise<Guild>;
89
- setBlacklist(value: boolean, user: GuildBetUser | GuildUser, adminId: string): Promise<this>;
90
- setStatus(key: keyof GuildStatus, status: string): Promise<this>;
72
+ update(data: Optional<APIGuild>): Promise<Guild>;
73
+ setStatus(key: keyof GuildStatus, status: "on" | "off"): Promise<this>;
91
74
  addPrice(price: number): Promise<this>;
92
75
  removePrice(price: number): Promise<this>;
93
76
  setPrefix(prefix: string): Promise<this>;
@@ -0,0 +1,6 @@
1
+ export * from "./guild/Guild";
2
+ export * from "./match/GuildMatch";
3
+ export * from "./user/GuildUser";
4
+ export * from "./vipmember/VipMember";
5
+ export * from "./ticket/Ticket";
6
+ export * from "./Collection";
@@ -1,43 +1,37 @@
1
1
  import { REST } from "../../rest/REST";
2
2
  import { Guild } from "../guild/Guild";
3
- import { APIGuildMatch } from "../../types/api/APIGuildMatch";
3
+ import { APIGuildMatch, MatchSelection } from "../../types/api/APIGuildMatch";
4
4
  import { APIPlayer } from "../../types/api/APIPlayer";
5
- import { APIBetChannel } from "../../types/api/APIBetChannel";
6
5
  import { BaseMatchModes, BaseMatchStatus, Confirm, Optional } from "../../types/api";
7
- import { ChannelManager } from "../../managers/channel/ChannelManager";
8
6
  import { GuildMatchManager } from "../../managers/match/GuildMatchManager";
9
- import { MessagesManager } from "../../managers/messages/MessagesManager";
7
+ import { APIBaseChannel } from "../../types";
8
+ import { MessagesManager } from "../../managers/message/MessagesManager";
10
9
  export declare class GuildMatch {
10
+ _id: string;
11
+ selections: MatchSelection[];
11
12
  /** Match's type */
12
13
  type: BaseMatchModes;
14
+ channels: APIBaseChannel[];
15
+ guild_id: string;
13
16
  /** Match's status */
14
17
  status: BaseMatchStatus;
15
18
  /** Match's challenge */
16
19
  challenge: boolean;
17
20
  /** Match's players */
18
21
  players: APIPlayer[];
22
+ teams: APIPlayer[][];
19
23
  /** Match's winners */
20
24
  winners: APIPlayer[];
21
25
  /** Match's losers */
22
26
  losers: APIPlayer[];
23
- /** Match;s messages */
24
- messages: MessagesManager;
25
- /** Matches channels */
26
- channels: ChannelManager<GuildMatch>;
27
27
  /** Match's maximum size */
28
28
  maximumSize: number;
29
29
  /** Match's kicked out */
30
30
  kickedOut: APIPlayer[];
31
- /** Match's team a */
32
- teamA: APIPlayer[];
33
- /** Match's team b */
34
- teamB: APIPlayer[];
35
31
  /** Match's confirmed */
36
32
  confirmed: Confirm[];
37
33
  /** Match's leaders */
38
34
  leaders: APIPlayer[];
39
- /** Match's mvp */
40
- mvpId: string;
41
35
  /** Match's creator id */
42
36
  creatorId: string;
43
37
  /** Match's room creator id */
@@ -46,8 +40,9 @@ export declare class GuildMatch {
46
40
  createdAt: Date;
47
41
  /** Updated Date */
48
42
  updatedAt: Date;
43
+ messages: MessagesManager<GuildMatch>;
49
44
  /** Match's id */
50
- _id: string;
45
+ mvps: [];
51
46
  manager: GuildMatchManager;
52
47
  /** The given guild */
53
48
  readonly guild: Guild;
@@ -60,25 +55,20 @@ export declare class GuildMatch {
60
55
  * @param guild The guild
61
56
  * @param rest The rest client
62
57
  */
63
- constructor(data: APIGuildMatch, guild: Guild, manager: GuildMatchManager, rest: REST);
58
+ constructor(data: APIGuildMatch, manager: GuildMatchManager);
64
59
  /**
65
60
  * Fetches the match
66
61
  * @returns New Instance of the match
67
62
  */
68
63
  fetch(): Promise<GuildMatch>;
69
- addMessage(id: string, type: string, content?: string): Promise<boolean>;
70
64
  addConfirmed(type: string, id: string): Promise<Confirm>;
71
65
  setConfirmed(set: Confirm[]): Promise<GuildMatch>;
72
66
  setStatus(status: BaseMatchStatus): Promise<GuildMatch>;
73
67
  setWinners(players: Optional<APIPlayer>[] | Optional<APIPlayer>): Promise<GuildMatch>;
74
68
  setLoser(players: Optional<APIPlayer>[] | Optional<APIPlayer>): Promise<GuildMatch>;
75
- setMvp(userId: string): Promise<GuildMatch>;
69
+ setMvps(...usersId: string[]): Promise<GuildMatch>;
76
70
  setRoomCreatorId(userId: string): Promise<GuildMatch>;
77
71
  kick(player: Optional<APIPlayer>): Promise<this>;
78
- addChannel(id: string, type: string): Promise<GuildMatch>;
79
- setChannels(channels: APIBetChannel[]): Promise<GuildMatch>;
80
- addPlayer(id: string, name: string): Promise<GuildMatch>;
81
- removePlayer(id: string, name: string): Promise<GuildMatch>;
82
72
  update(data: Optional<APIGuildMatch>): Promise<GuildMatch>;
83
73
  delete(): Promise<boolean>;
84
74
  toJSON(): Record<string, unknown>;
@@ -0,0 +1,30 @@
1
+ import { TicketManager } from "../../managers/ticket/TicketManager";
2
+ import { REST } from "../../rest";
3
+ import { APIGuildTicket, APILogMessage, Optional } from "../../types";
4
+ import { Guild } from "../guild/Guild";
5
+ export declare class GuildTicket implements APIGuildTicket {
6
+ _id: string;
7
+ guild_id: string;
8
+ type: string;
9
+ status: "on" | "off";
10
+ admin_id: string;
11
+ channel_id: string;
12
+ closed_by_id: string;
13
+ creator_id: string;
14
+ customer_rating: number;
15
+ messages: APILogMessage[];
16
+ createdAt: Date;
17
+ updatedAt: Date;
18
+ readonly rest: REST;
19
+ readonly guild: Guild;
20
+ readonly manager: TicketManager;
21
+ constructor(data: APIGuildTicket, manager: any);
22
+ fetch(): Promise<GuildTicket>;
23
+ setCustomerRating(rating: number): Promise<GuildTicket>;
24
+ setAdminId(id: string): Promise<GuildTicket>;
25
+ setChannelId(id: string): Promise<GuildTicket>;
26
+ setClosedById(id: string): Promise<GuildTicket>;
27
+ setStatus(status: "on" | "off"): Promise<GuildTicket>;
28
+ addMessage(message: Optional<APILogMessage>): Promise<GuildTicket>;
29
+ _updateInternals(data: Optional<APIGuildTicket>): this;
30
+ }
@@ -3,9 +3,9 @@ import { Accessory, Daily, Items, Optional, OriginalChannels } from "../../types
3
3
  import { APIGuildUser } from "../../types/api/APIGuildUser";
4
4
  import { GuildUserManager } from "../../managers/user/GuildUserManager";
5
5
  export declare class GuildUser implements APIGuildUser {
6
- #private;
7
6
  /** User's id */
8
7
  id: string;
8
+ guild_id: string;
9
9
  /** User name */
10
10
  name: string;
11
11
  /** User's daily */
@@ -25,7 +25,8 @@ export declare class GuildUser implements APIGuildUser {
25
25
  /** User's accessories such as double point */
26
26
  accessories: Accessory[];
27
27
  /** User's original channels */
28
- originalChannels: OriginalChannels;
28
+ original_channels: OriginalChannels;
29
+ creations: number;
29
30
  /** User's items */
30
31
  items: Items;
31
32
  /** Creation Date */
@@ -42,7 +43,7 @@ export declare class GuildUser implements APIGuildUser {
42
43
  * @param manager The manager
43
44
  * @param rest The rest client
44
45
  */
45
- constructor(data: APIGuildUser, manager: GuildUserManager, rest: REST);
46
+ constructor(data: APIGuildUser, manager: GuildUserManager);
46
47
  /** String representation of this user */
47
48
  toString(): string;
48
49
  /**
@@ -64,6 +65,7 @@ export declare class GuildUser implements APIGuildUser {
64
65
  */
65
66
  setBlacklist(value: boolean): Promise<this>;
66
67
  reset(): Promise<this>;
68
+ _updateInternals(data: Optional<APIGuildUser>): this;
67
69
  /**
68
70
  * Update certain property
69
71
  * @param data The new data to update with
@@ -34,7 +34,7 @@ export declare class VipMember implements APIVipMember {
34
34
  * @param manager The manager
35
35
  * @param rest The rest client
36
36
  */
37
- constructor(data: APIVipMember, manager: VipMemberManager, rest: REST);
37
+ constructor(data: APIVipMember, manager: VipMemberManager);
38
38
  /** String representation of this member */
39
39
  toString(): string;
40
40
  /**
@@ -0,0 +1,34 @@
1
+ import { Collection } from "../structures/Collection";
2
+ import { Guild } from "../structures/guild/Guild";
3
+ import { GuildMatch } from "../structures/match/GuildMatch";
4
+ import { GuildUser } from "../structures/user/GuildUser";
5
+ export interface RequestOptions<Payload> {
6
+ /** The request's method */
7
+ method: string;
8
+ /** The request's url */
9
+ url: string;
10
+ /** The request payload */
11
+ payload?: Payload;
12
+ }
13
+ export interface RestEvents {
14
+ request: [{
15
+ url: string;
16
+ method: string;
17
+ }];
18
+ response: [{
19
+ status: number;
20
+ body: unknown;
21
+ }];
22
+ error: [Error];
23
+ debug: [string];
24
+ matchCreate: [GuildMatch];
25
+ matchUpdate: [GuildMatch, GuildMatch];
26
+ matchDelete: [GuildMatch];
27
+ matchesDelete: [Collection<string, GuildMatch>];
28
+ guildUpdate: [Guild];
29
+ guildDelete: [Guild];
30
+ guildsDelete: [Collection<string, Guild>];
31
+ userDelete: [GuildUser];
32
+ userUpdate: [GuildUser];
33
+ usersDelete: [Collection<string, GuildUser>];
34
+ }
@@ -22,9 +22,15 @@ export interface GuildStatus {
22
22
  /** Bets status */
23
23
  bets: "on" | "off";
24
24
  /** Daily Ranking status */
25
- dailyRank: "on" | "off";
25
+ daily_rank: "on" | "off";
26
26
  /** Voice Channels for a bet */
27
27
  createVoiceChannels: "on" | "off";
28
+ two_mvps: "on" | "off";
29
+ ranking_name: "on" | "off";
30
+ }
31
+ export interface GuildModes {
32
+ on: string[];
33
+ off: string[];
28
34
  }
29
35
  export type DailyCategories = "coins" | "credit" | "wins" | "points" | "losses" | "mvps";
30
36
  export interface GuildPrices {
@@ -46,6 +52,7 @@ export interface GuildScores {
46
52
  export interface APIGuild {
47
53
  /** Guild's id */
48
54
  id: string;
55
+ modes: GuildModes;
49
56
  /** Guild's client key */
50
57
  clientKey: string;
51
58
  /** Guild Permissions */
@@ -53,7 +60,7 @@ export interface APIGuild {
53
60
  /** Guild Ticket */
54
61
  tickets: APIGuildTicket[];
55
62
  /** Guild Ticket Configuration */
56
- ticketsConfiguration: GuildTicketConfiguration;
63
+ tickets_configuration: GuildTicketConfiguration;
57
64
  /** Guild Daily Categories */
58
65
  dailyCategories: DailyCategories[];
59
66
  /** Guild Scores */
@@ -2,9 +2,16 @@ import { BaseMatchModes, BaseMatchStatus, Confirm } from ".";
2
2
  import { APIBaseChannel } from "./APIBaseChannel";
3
3
  import { APIMessage } from "./APIMessage";
4
4
  import { APIPlayer } from "./APIPlayer";
5
+ export type MatchSelection = {
6
+ type: "creator" | "mvps" | "winners";
7
+ selected: string[];
8
+ confirmed: string[];
9
+ };
5
10
  export interface APIGuildMatch {
11
+ selections: MatchSelection[];
6
12
  /** Match's type */
7
13
  type: BaseMatchModes;
14
+ guild_id: string;
8
15
  /** Match's status */
9
16
  status: BaseMatchStatus;
10
17
  /** Match's challenge */
@@ -23,17 +30,11 @@ export interface APIGuildMatch {
23
30
  maximumSize: number;
24
31
  /** Match's kicked out */
25
32
  kickedOut: APIPlayer[];
26
- /** Match's team a */
27
- teamA: APIPlayer[];
28
- /** Match's team b */
29
- teamB: APIPlayer[];
30
33
  /** Match's confirmed */
31
34
  confirmed: Confirm[];
32
35
  /** Match's leaders */
33
36
  leaders: APIPlayer[];
34
- /** Match's mvp */
35
- mvpId: string;
36
- /** Match's creator id */
37
+ teams: APIPlayer[][];
37
38
  creatorId: string;
38
39
  /** Match's room creator id */
39
40
  roomCreatorId: string;
@@ -43,4 +44,5 @@ export interface APIGuildMatch {
43
44
  updatedAt: Date;
44
45
  /** Match's id */
45
46
  _id: string;
47
+ mvps: [];
46
48
  }
@@ -0,0 +1,16 @@
1
+ import { APILogMessage } from "./APILogMessage";
2
+ export interface APIGuildTicket {
3
+ /** Ticket's id */
4
+ _id: string;
5
+ guild_id: string;
6
+ type: string;
7
+ status: "on" | "off";
8
+ creator_id: string;
9
+ channel_id: string;
10
+ admin_id: string;
11
+ customer_rating: number;
12
+ closed_by_id: string;
13
+ messages: APILogMessage[];
14
+ createdAt: Date;
15
+ updatedAt: Date;
16
+ }
@@ -2,12 +2,14 @@ import { Accessory, Daily, Items, OriginalChannels } from ".";
2
2
  export interface APIGuildUser {
3
3
  /** User's id */
4
4
  id: string;
5
+ guild_id: string;
5
6
  /** User name */
6
7
  name: string;
7
8
  /** User's daily */
8
9
  daily: Omit<Daily, "credit">;
9
10
  /** User's points */
10
11
  points: number;
12
+ creations: number;
11
13
  /** User's wins */
12
14
  wins: number;
13
15
  /** User's mvps */
@@ -21,7 +23,7 @@ export interface APIGuildUser {
21
23
  /** User's accessories such as double point */
22
24
  accessories: Accessory[];
23
25
  /** User's original channels */
24
- originalChannels: OriginalChannels;
26
+ original_channels: OriginalChannels;
25
27
  /** User's items */
26
28
  items: Items;
27
29
  /** Creation Date */
@@ -0,0 +1,7 @@
1
+ export interface APILogMessage {
2
+ type: string;
3
+ content: any;
4
+ user_id: string;
5
+ createdAt: Date;
6
+ updatedAt: Date;
7
+ }
@@ -1,10 +1,9 @@
1
1
  export interface APIMessage {
2
2
  /** Message's content */
3
- content: string | object;
4
- /** Message's creator id */
5
- userId: string;
3
+ content?: string | object;
4
+ _id: string;
6
5
  /** Message's type */
7
- type: "text" | "img" | ".png" | ".gif" | ".jpg";
6
+ type: string;
8
7
  /** Creation Date */
9
8
  createdAt?: Date;
10
9
  /** Updated Date */
@@ -2,7 +2,7 @@ export interface APIPlayer {
2
2
  /** The player's id */
3
3
  id: string;
4
4
  /** The player's name */
5
- name: string;
5
+ name?: string;
6
6
  /** When player was created */
7
7
  createdAt?: Date;
8
8
  /** Last time player was updated */
@@ -32,7 +32,7 @@ export interface LogMessage {
32
32
  updatedAt: Date;
33
33
  }
34
34
  /** Base match modes */
35
- export type BaseMatchModes = "1x1" | "2x2" | "3x3" | "4x4" | "5x5" | "6x6" | "1v1" | "2v2" | "3v3" | "4v4" | "5v5" | "6v6";
35
+ export type BaseMatchModes = "1v1" | "2v2" | "3v3" | "4v4" | "5v5" | "6v6";
36
36
  /** Base match status */
37
37
  export type BaseMatchStatus = "on" | "created" | "off" | "shutted";
38
38
  /** The logs of the structure */
@@ -132,3 +132,25 @@ export declare enum STATES {
132
132
  SHUTTED = "shutted",
133
133
  WAITING = "waiting"
134
134
  }
135
+ export * from "./APIBaseChannel";
136
+ export * from "./APIBetChannel";
137
+ export * from "./APIBetMessage";
138
+ export * from "./APIGuild";
139
+ export * from "./APIGuildBet";
140
+ export * from "./APIGuildBetUser";
141
+ export * from "./APIGuildChannel";
142
+ export * from "./APIGuildEmoji";
143
+ export * from "./APIGuildGroupedChannel";
144
+ export * from "./APIGuildMatch";
145
+ export * from "./APIGuildMediator";
146
+ export * from "./APIGuildPermissions";
147
+ export * from "./APIGuildRole";
148
+ export * from "./APIGuildShop";
149
+ export * from "./APIGuildTicket";
150
+ export * from "./APIGuildUser";
151
+ export * from "./APIMessage";
152
+ export * from "./APIPlayer";
153
+ export * from "./APIProduct";
154
+ export * from "./APIVipMember";
155
+ export * from "./APIGiveaway";
156
+ export * from "./APILogMessage";
@@ -0,0 +1,2 @@
1
+ export * from "./api/index";
2
+ export * from "./RestTypes";
package/dist/index.d.ts DELETED
@@ -1,31 +0,0 @@
1
- export * from "./managers/bet/GuildBetManager";
2
- export * from "./managers/betuser/GuildBetUserManager";
3
- export * from "./managers/channel/ChannelManager";
4
- export * from "./managers/groupedchannel/GroupedChannelManager";
5
- export * from "./managers/guild/GuildManager";
6
- export * from "./managers/match/GuildMatchManager";
7
- export * from "./managers/mediator/GuildMediatorManager";
8
- export * from "./managers/messages/MessagesManager";
9
- export * from "./managers/permission/GuildPermissionManager";
10
- export * from "./managers/product/GuildProductManager";
11
- export * from "./managers/ticket/GuildTicketManager";
12
- export * from "./managers/user/GuildUserManager";
13
- export * from "./managers/vipmember/VipMemberManager";
14
- export * from "./managers/giveaway/GiveawayManager";
15
- export * from "./structures/bet/GuildBet";
16
- export * from "./structures/betuser/GuildBetUser";
17
- export * from "./structures/channel/Channel";
18
- export * from "./structures/groupedchannel/GroupedChannel";
19
- export * from "./structures/guild/Guild";
20
- export * from "./structures/match/GuildMatch";
21
- export * from "./structures/mediator/GuildMediator";
22
- export * from "./structures/product/GuildProduct";
23
- export * from "./structures/shop/GuildShop";
24
- export * from "./structures/ticket/GuildTicket";
25
- export * from "./structures/user/GuildUser";
26
- export * from "./structures/vipmember/VipMember";
27
- export * from "./structures/giveaway/Giveaway";
28
- export * from "./structures/Collection";
29
- export * from "./rest/REST";
30
- export * from "./rest/Routes";
31
- export * from "./types/index";