@duque.edits/sdk 0.1.4 → 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 (119) hide show
  1. package/dist/index.js +4 -27
  2. package/dist/managers/base.js +26 -0
  3. package/dist/managers/buffer/BufferManager.js +8 -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 -29
  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 +124 -0
  12. package/dist/rest/REST.js +40 -21
  13. package/dist/rest/Routes.js +31 -17
  14. package/dist/rest/index.js +19 -0
  15. package/dist/structures/Collection.js +1 -1
  16. package/dist/structures/guild/Guild.js +72 -90
  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 +48 -40
  21. package/dist/structures/vipmember/VipMember.js +137 -0
  22. package/dist/types/api/APIGiveaway.js +2 -0
  23. package/dist/types/api/APILogMessage.js +2 -0
  24. package/dist/types/api/APIVipMember.js +2 -0
  25. package/dist/types/api/index.js +36 -0
  26. package/dist/types/index.js +1 -20
  27. package/dist/utils/getRandomNumber.js +6 -0
  28. package/package.json +11 -18
  29. package/types/index.d.ts +4 -0
  30. package/types/managers/base.d.ts +17 -0
  31. package/types/managers/buffer/BufferManager.d.ts +19 -0
  32. package/{dist → types}/managers/guild/GuildManager.d.ts +12 -4
  33. package/types/managers/index.d.ts +7 -0
  34. package/{dist → types}/managers/match/GuildMatchManager.d.ts +10 -12
  35. package/types/managers/message/MessagesManager.d.ts +17 -0
  36. package/types/managers/permission/GuildPermissionManager.d.ts +8 -0
  37. package/types/managers/ticket/TicketManager.d.ts +22 -0
  38. package/types/managers/user/GuildUserManager.d.ts +19 -0
  39. package/types/managers/vipmember/VipMemberManager.d.ts +33 -0
  40. package/types/rest/APIEndpoints.d.ts +11 -0
  41. package/{dist → types}/rest/REST.d.ts +9 -16
  42. package/{dist → types}/rest/Routes.d.ts +18 -2
  43. package/types/rest/index.d.ts +3 -0
  44. package/{dist → types}/structures/guild/Guild.d.ts +17 -29
  45. package/types/structures/index.d.ts +6 -0
  46. package/{dist → types}/structures/match/GuildMatch.d.ts +12 -22
  47. package/types/structures/ticket/Ticket.d.ts +30 -0
  48. package/{dist → types}/structures/user/GuildUser.d.ts +5 -3
  49. package/types/structures/vipmember/VipMember.d.ts +54 -0
  50. package/types/types/RestTypes.d.ts +34 -0
  51. package/types/types/api/APIGiveaway.d.ts +27 -0
  52. package/{dist → types}/types/api/APIGuild.d.ts +9 -2
  53. package/{dist → types}/types/api/APIGuildMatch.d.ts +9 -7
  54. package/types/types/api/APIGuildTicket.d.ts +16 -0
  55. package/{dist → types}/types/api/APIGuildUser.d.ts +3 -1
  56. package/types/types/api/APILogMessage.d.ts +7 -0
  57. package/types/types/api/APIMessage.d.ts +11 -0
  58. package/{dist → types}/types/api/APIPlayer.d.ts +1 -1
  59. package/types/types/api/APIVipMember.d.ts +20 -0
  60. package/{dist → types}/types/api/index.d.ts +23 -1
  61. package/types/types/index.d.ts +2 -0
  62. package/types/utils/getRandomNumber.d.ts +1 -0
  63. package/dist/index.d.ts +0 -27
  64. package/dist/managers/bet/GuildBetManager.d.ts +0 -35
  65. package/dist/managers/bet/GuildBetManager.js +0 -126
  66. package/dist/managers/betuser/GuildBetUserManager.d.ts +0 -36
  67. package/dist/managers/betuser/GuildBetUserManager.js +0 -151
  68. package/dist/managers/buffer/BufferManager.d.ts +0 -14
  69. package/dist/managers/channel/ChannelManager.d.ts +0 -39
  70. package/dist/managers/channel/ChannelManager.js +0 -148
  71. package/dist/managers/groupedchannel/GroupedChannelManager.d.ts +0 -34
  72. package/dist/managers/groupedchannel/GroupedChannelManager.js +0 -92
  73. package/dist/managers/mediator/GuildMediatorManager.d.ts +0 -32
  74. package/dist/managers/mediator/GuildMediatorManager.js +0 -98
  75. package/dist/managers/messages/MessagesManager.d.ts +0 -32
  76. package/dist/managers/messages/MessagesManager.js +0 -89
  77. package/dist/managers/permission/GuildPermissionManager.d.ts +0 -26
  78. package/dist/managers/product/GuildProductManager.d.ts +0 -32
  79. package/dist/managers/product/GuildProductManager.js +0 -103
  80. package/dist/managers/ticket/GuildTicketManager.d.ts +0 -32
  81. package/dist/managers/ticket/GuildTicketManager.js +0 -100
  82. package/dist/managers/user/GuildUserManager.d.ts +0 -33
  83. package/dist/rest/APIEndpoints.d.ts +0 -11
  84. package/dist/structures/bet/GuildBet.d.ts +0 -87
  85. package/dist/structures/bet/GuildBet.js +0 -284
  86. package/dist/structures/betuser/GuildBetUser.d.ts +0 -85
  87. package/dist/structures/betuser/GuildBetUser.js +0 -211
  88. package/dist/structures/channel/Channel.d.ts +0 -31
  89. package/dist/structures/channel/Channel.js +0 -57
  90. package/dist/structures/groupedchannel/GroupedChannel.d.ts +0 -34
  91. package/dist/structures/groupedchannel/GroupedChannel.js +0 -121
  92. package/dist/structures/mediator/GuildMediator.d.ts +0 -41
  93. package/dist/structures/mediator/GuildMediator.js +0 -131
  94. package/dist/structures/product/GuildProduct.d.ts +0 -52
  95. package/dist/structures/product/GuildProduct.js +0 -175
  96. package/dist/structures/shop/GuildShop.d.ts +0 -34
  97. package/dist/structures/shop/GuildShop.js +0 -80
  98. package/dist/structures/ticket/GuildTicket.d.ts +0 -52
  99. package/dist/structures/ticket/GuildTicket.js +0 -172
  100. package/dist/types/api/APIGuildTicket.d.ts +0 -26
  101. package/dist/types/api/APIMessage.d.ts +0 -12
  102. package/dist/types/index.d.ts +0 -21
  103. /package/dist/types/{api/APIGuildMessage.js → RestTypes.js} +0 -0
  104. /package/{dist → types}/structures/Collection.d.ts +0 -0
  105. /package/{dist → types}/types/api/APIBaseChannel.d.ts +0 -0
  106. /package/{dist → types}/types/api/APIBetChannel.d.ts +0 -0
  107. /package/{dist → types}/types/api/APIBetMessage.d.ts +0 -0
  108. /package/{dist → types}/types/api/APIGuildBet.d.ts +0 -0
  109. /package/{dist → types}/types/api/APIGuildBetUser.d.ts +0 -0
  110. /package/{dist → types}/types/api/APIGuildChannel.d.ts +0 -0
  111. /package/{dist → types}/types/api/APIGuildEmoji.d.ts +0 -0
  112. /package/{dist → types}/types/api/APIGuildGroupedChannel.d.ts +0 -0
  113. /package/{dist → types}/types/api/APIGuildMediator.d.ts +0 -0
  114. /package/{dist → types}/types/api/APIGuildMessage.d.ts +0 -0
  115. /package/{dist → types}/types/api/APIGuildPermissions.d.ts +0 -0
  116. /package/{dist → types}/types/api/APIGuildRole.d.ts +0 -0
  117. /package/{dist → types}/types/api/APIGuildShop.d.ts +0 -0
  118. /package/{dist → types}/types/api/APIProduct.d.ts +0 -0
  119. /package/{dist → types}/utils/Assertion.d.ts +0 -0
@@ -1,32 +1,30 @@
1
- import { REST } from "../../rest/REST";
2
1
  import { GuildMatch } from "../../structures/match/GuildMatch";
3
2
  import { Collection } from "../../structures/Collection";
4
3
  import { Guild } from "../../structures/guild/Guild";
5
4
  import { APIGuildMatch } from "../../types/api/APIGuildMatch";
6
5
  import { Optional } from "../../types/api";
7
- export declare class GuildMatchManager {
8
- /** A cache of users */
9
- cache: Collection<string, GuildMatch>;
10
- /** The rest client */
11
- rest: REST;
12
- /** GuildMatch match guild */
13
- guild: Guild;
6
+ import { BaseManager } from "../base";
7
+ type FetchOptions = {
8
+ cache: boolean;
9
+ matchId: string;
10
+ };
11
+ export declare class GuildMatchManager extends BaseManager<GuildMatch> {
14
12
  /**
15
13
  * Manage users with the given client
16
14
  * @param users An array of users
17
15
  * @param rest The rest client
18
16
  */
19
- constructor(guild: Guild, rest: REST);
17
+ constructor(guild: Guild);
20
18
  /**
21
19
  * Fetch a match
22
20
  * @param id Id of the match to fetch
23
21
  * @returns APIBetUser
24
22
  */
25
- fetch(id: string): Promise<GuildMatch>;
23
+ fetch(options?: Optional<FetchOptions>): Promise<GuildMatch | Collection<string, GuildMatch>>;
26
24
  fetchAll(): Promise<Collection<string, GuildMatch>>;
27
- set(data: APIGuildMatch): GuildMatch;
28
- setAll(data: APIGuildMatch[]): Collection<string, GuildMatch>;
25
+ set(data: APIGuildMatch | APIGuildMatch[]): GuildMatch | Collection<string, GuildMatch>;
29
26
  create(payload: Optional<APIGuildMatch>): Promise<GuildMatch>;
30
27
  delete(id: string): Promise<Collection<string, GuildMatch>>;
31
28
  deleteAll(): Promise<boolean>;
32
29
  }
30
+ export {};
@@ -0,0 +1,17 @@
1
+ import { REST } from "../../rest";
2
+ import { Collection } from "../../structures/Collection";
3
+ import { APIMessage, Optional } from "../../types";
4
+ type T<e> = e & {
5
+ rest: REST;
6
+ messages: MessagesManager<e>;
7
+ };
8
+ export declare class MessagesManager<Structure> {
9
+ cache: Collection<string, APIMessage>;
10
+ readonly base_url: string;
11
+ readonly rest: REST;
12
+ constructor(structure: T<Structure>, base_url: string);
13
+ fetch(): Promise<APIMessage>;
14
+ create(data: Optional<APIMessage> | Optional<APIMessage>[]): Promise<APIMessage[]>;
15
+ setAll(data: APIMessage | APIMessage[]): Collection<string, APIMessage>;
16
+ }
17
+ export {};
@@ -0,0 +1,8 @@
1
+ import { Guild } from "../../structures/guild/Guild";
2
+ import { APIGuild, APIGuildPermissions } from "../../types";
3
+ import { BaseManager } from "../base";
4
+ export declare class GuildPermissionManager extends BaseManager<APIGuildPermissions> {
5
+ constructor(guild: Guild);
6
+ addRole(permissionId: keyof APIGuildPermissions, roleId: string): Promise<APIGuild | Guild>;
7
+ removeRole(permissionId: keyof APIGuildPermissions, roleId: string): Promise<APIGuild | Guild>;
8
+ }
@@ -0,0 +1,22 @@
1
+ import { REST } from "../../rest";
2
+ import { Guild, GuildTicket } from "../../structures";
3
+ import { Collection } from "../../structures/Collection";
4
+ import { APIGuildTicket, Optional } from "../../types";
5
+ type FecthOptions = {
6
+ ticketId?: string;
7
+ cache?: boolean;
8
+ };
9
+ type DeleteOptions = {
10
+ ticketId?: string;
11
+ };
12
+ export declare class TicketManager {
13
+ cache: Collection<string, GuildTicket>;
14
+ readonly guild: Guild;
15
+ readonly rest: REST;
16
+ constructor(guild: Guild);
17
+ fetch(options?: FecthOptions): Promise<GuildTicket | Collection<string, GuildTicket>>;
18
+ create(data: Optional<APIGuildTicket>): Promise<GuildTicket>;
19
+ delete(options?: DeleteOptions): Promise<boolean>;
20
+ set(data: APIGuildTicket | APIGuildTicket[]): GuildTicket | Collection<string, GuildTicket>;
21
+ }
22
+ export {};
@@ -0,0 +1,19 @@
1
+ import { Collection } from "../../structures/Collection";
2
+ import { Guild } from "../../structures/guild/Guild";
3
+ import { GuildUser } from "../../structures/user/GuildUser";
4
+ import { APIGuildUser } from "../../types";
5
+ import { BaseManager } from "../base";
6
+ type FetchOptions = {
7
+ userId?: string;
8
+ cache?: boolean;
9
+ };
10
+ export declare class GuildUserManager extends BaseManager<GuildUser> {
11
+ constructor(guild: Guild);
12
+ fetch(options?: FetchOptions): Promise<Collection<string, GuildUser> | GuildUser>;
13
+ updateMany(users: APIGuildUser[] | GuildUser[]): Promise<Collection<string, GuildUser>>;
14
+ deleteAll(): Promise<void>;
15
+ resetAll(): Promise<Collection<string, GuildUser>>;
16
+ _setUsers(data: (APIGuildUser | GuildUser) | (APIGuildUser[] | GuildUser[])): void;
17
+ set(data: APIGuildUser | APIGuildUser[]): GuildUser | Collection<string, GuildUser>;
18
+ }
19
+ export {};
@@ -0,0 +1,33 @@
1
+ import { REST } from "../../rest/REST";
2
+ import { VipMember } from "../../structures/vipmember/VipMember";
3
+ import { Collection } from "../../structures/Collection";
4
+ import { Guild } from "../../structures/guild/Guild";
5
+ import { APIVipMember } from "../../types/api/APIVipMember";
6
+ import { Optional } from "../../types";
7
+ import { BaseManager } from "../base";
8
+ type FecthOptions = {
9
+ cache?: boolean;
10
+ memberId?: string;
11
+ };
12
+ export declare class VipMemberManager extends BaseManager<VipMember> {
13
+ /**
14
+ * Manage vipmembers with the given client
15
+ * @param vipmembers An array of vipmembers
16
+ * @param rest The rest client
17
+ */
18
+ constructor(guild: Guild, rest: REST);
19
+ create(data: Optional<APIVipMember>): Promise<VipMember>;
20
+ /**
21
+ * Fetch a member
22
+ * @param id Id of the member to fetch
23
+ * @returns VipMember
24
+ */
25
+ fetch(options?: FecthOptions): Promise<Collection<string, VipMember> | VipMember>;
26
+ updateMember(id: string, data: Optional<APIVipMember>): Promise<VipMember>;
27
+ set(data: APIVipMember): VipMember;
28
+ setAll(data: APIVipMember[]): Collection<string, VipMember>;
29
+ resetAll(): Promise<Collection<string, VipMember>>;
30
+ delete(id: string): Promise<Collection<string, VipMember>>;
31
+ deleteAll(): Promise<boolean>;
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,19 +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
- interface RequestOptions<Payload> {
10
- /** The request's method */
11
- method: string;
12
- /** The request's url */
13
- url: string;
14
- /** The request payload */
15
- payload?: Payload;
16
- }
6
+ import { RestEvents, RequestOptions } from "../types/RestTypes";
17
7
  /**
18
8
  * The main class of this package
19
9
  */
@@ -24,11 +14,8 @@ export declare class REST extends EventEmitter {
24
14
  key: string;
25
15
  /** The guild manager */
26
16
  guilds: GuildManager;
27
- bets: Collection<string, GuildBet>;
28
- matches: Collection<string, GuildMatch>;
29
- betUsers: Collection<string, GuildBetUser>;
30
17
  users: Collection<string, GuildUser>;
31
- mediators: Collection<string, GuildMediator>;
18
+ matches: Collection<string, GuildMatch>;
32
19
  /**
33
20
  *
34
21
  * @param key The unique key for he client
@@ -41,11 +28,17 @@ export declare class REST extends EventEmitter {
41
28
  setKey(key: string): void;
42
29
  /** Initialize the caching sistem */
43
30
  init(): Promise<this>;
31
+ /**
32
+ * Ping the api
33
+ */
34
+ ping(): Promise<unknown>;
44
35
  /**
45
36
  * Request Data from a certain url
46
37
  * @param options
47
38
  * @returns
48
39
  */
49
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;
50
44
  }
51
- 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;
@@ -81,4 +81,20 @@ export declare const Routes: {
81
81
  };
82
82
  };
83
83
  };
84
+ vipmembers: {
85
+ get: (guildId: string, memberId: string) => string;
86
+ getAll: (guildId: string) => string;
87
+ deleteAll: (guildId: string) => string;
88
+ create: (guildId: string) => string;
89
+ update: (guildId: string, memberId: string) => string;
90
+ delete: (guildId: string, memberId: string) => string;
91
+ };
92
+ giveaways: {
93
+ get: (giveawayId: string) => string;
94
+ getAll: () => string;
95
+ deleteAll: () => string;
96
+ create: () => string;
97
+ update: (giveawayId: string) => string;
98
+ delete: (giveawayId: string) => string;
99
+ };
84
100
  };
@@ -0,0 +1,3 @@
1
+ export * from "./APIEndpoints";
2
+ export * from "./Routes";
3
+ export * from "./REST";
@@ -1,22 +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";
4
+ import { VipMemberManager } from "../../managers/vipmember/VipMemberManager";
11
5
  import { REST } from "../../rest/REST";
12
- import { Daily, GuildBlacklist } from "../../types/api";
13
- 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";
14
8
  import { APIGuildEmoji } from "../../types/api/APIGuildEmoji";
15
9
  import { APIGuildPermissions } from "../../types/api/APIGuildPermissions";
16
10
  import { APIGuildRole } from "../../types/api/APIGuildRole";
17
- import { GuildBetUser } from "../betuser/GuildBetUser";
18
- import { GuildShop } from "../shop/GuildShop";
19
- import { GuildUser } from "../user/GuildUser";
11
+ import { GuildUserManager } from "../../managers/user/GuildUserManager";
12
+ import { TicketManager } from "../../managers";
20
13
  /** The Guild */
21
14
  export declare class Guild {
22
15
  /** The data of this guild */
@@ -25,14 +18,14 @@ export declare class Guild {
25
18
  rest: REST;
26
19
  /** The guild's id */
27
20
  id: string;
21
+ modes: GuildModes;
28
22
  /** Guild's client key */
29
23
  clientKey: string;
30
24
  /** Guild Permissions */
31
25
  permissions: APIGuildPermissions;
32
26
  /** Guild Ticket */
33
- tickets: GuildTicketManager;
34
27
  /** Guild Ticket Configuration */
35
- ticketsConfiguration: GuildTicketConfiguration;
28
+ tickets_configuration: GuildTicketConfiguration;
36
29
  /** Guild Daily Categories */
37
30
  dailyCategories: DailyCategories[];
38
31
  /** Guild Scores */
@@ -40,9 +33,7 @@ export declare class Guild {
40
33
  /** Guild Status */
41
34
  status: GuildStatus;
42
35
  /** Guild Channel */
43
- channels: GroupedChannelManager;
44
36
  /** Guild Categories */
45
- categories: GroupedChannelManager;
46
37
  /** Guild Blacklist */
47
38
  blacklist: GuildBlacklist;
48
39
  /** Guild Prefix */
@@ -55,40 +46,37 @@ export declare class Guild {
55
46
  createdAt: Date;
56
47
  /** Guild Updated Date */
57
48
  updatedAt: Date;
58
- /** Guild Bets */
59
- bets: GuildBetManager;
60
49
  /** Guild Users */
61
- users: GuildUserManager;
62
50
  /** Guild Bet Users */
63
- betUsers: GuildBetUserManager;
64
51
  /** Guild Matches */
65
52
  matches: GuildMatchManager;
66
- /** Guild Mediators */
67
- mediators: GuildMediatorManager;
68
- /** Guild Messages */
69
- messages: MessagesManager;
70
53
  /** Guild Emojis */
71
54
  emojis: APIGuildEmoji[];
72
55
  /** Guild Roles */
73
56
  roles: APIGuildRole[];
74
57
  /** Guild Prices Used */
75
58
  prices: GuildPrices;
76
- /** Guild Shop */
77
- shop: GuildShop;
78
59
  permissionsManager: GuildPermissionManager;
79
60
  buffer: BufferManager;
61
+ vipMembers: VipMemberManager;
62
+ users: GuildUserManager;
63
+ tickets: TicketManager;
80
64
  /**
81
65
  * The guild structure
82
66
  * @param data The guild's data
83
67
  * @param rest The rest client
84
68
  */
85
69
  constructor(data: APIGuild, rest: REST);
70
+ _updateInternals(data: Optional<APIGuild>): this;
86
71
  fetch(): Promise<Guild>;
87
- setBlacklist(value: boolean, user: GuildBetUser | GuildUser, adminId: string): Promise<this>;
88
- 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>;
89
74
  addPrice(price: number): Promise<this>;
90
75
  removePrice(price: number): Promise<this>;
91
76
  setPrefix(prefix: string): Promise<this>;
92
77
  addDailyCategory(category: keyof Daily): Promise<this>;
93
78
  removeDailyCategory(category: keyof Daily): Promise<this>;
79
+ setScore(name: AvailableScores, amount: number): Promise<this>;
94
80
  }
81
+ type AvailableScores = "win" | "loss" | "mvp" | "creator" | "coin";
82
+ export {};
@@ -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
@@ -0,0 +1,54 @@
1
+ import { REST } from "../../rest/REST";
2
+ import { Optional } from "../../types/api";
3
+ import { APIVipMember } from "../../types/api/APIVipMember";
4
+ import { VipMemberManager } from "../../managers/vipmember/VipMemberManager";
5
+ import { Guild } from "../guild/Guild";
6
+ export declare class VipMember implements APIVipMember {
7
+ #private;
8
+ /** member's id */
9
+ id: string;
10
+ /** member name */
11
+ name: string;
12
+ /** Members's roleId */
13
+ roleId: string;
14
+ /** Members's voiceChannelId */
15
+ voiceChannelId: string;
16
+ /** Vip's type */
17
+ type: "both" | "role" | "channel";
18
+ /** Member's Guild Id */
19
+ guild_id: string;
20
+ duration: Date;
21
+ status: "on" | "off";
22
+ /** member's daily */
23
+ createdAt: Date;
24
+ /** Updated Date */
25
+ updatedAt: Date;
26
+ /** The given manager */
27
+ readonly manager: VipMemberManager;
28
+ /** The rest client */
29
+ readonly rest: REST;
30
+ readonly guild: Guild;
31
+ /**
32
+ * Bet member
33
+ * @param data The member's data
34
+ * @param manager The manager
35
+ * @param rest The rest client
36
+ */
37
+ constructor(data: APIVipMember, manager: VipMemberManager);
38
+ /** String representation of this member */
39
+ toString(): string;
40
+ /**
41
+ * Fetches the member
42
+ * @returns New Instance of the member
43
+ */
44
+ fetch(): Promise<VipMember>;
45
+ reset(): Promise<this>;
46
+ /**
47
+ * Update certain property
48
+ * @param data The new data to update with
49
+ * @returns
50
+ */
51
+ update(data: Optional<APIVipMember>): Promise<this>;
52
+ delete(): Promise<boolean>;
53
+ toJSON(): Record<keyof APIVipMember, unknown>;
54
+ }
@@ -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
+ }
@@ -0,0 +1,27 @@
1
+ export interface GiveawayMessage {
2
+ id: string;
3
+ content: string;
4
+ type: "embed" | "text";
5
+ }
6
+ export interface GiveawayWinners {
7
+ count: number;
8
+ selected: string[];
9
+ }
10
+ export interface APIGiveaway {
11
+ _id: string;
12
+ host_id: string;
13
+ channel_id: string;
14
+ guild_id: string;
15
+ /** Duration of giveaway in sec */
16
+ duration: number;
17
+ prizes: string[];
18
+ participants: string[];
19
+ allowed_roles: string[];
20
+ blacklisted_roles: string[];
21
+ message: GiveawayMessage;
22
+ winners: GiveawayWinners;
23
+ rerolls: string[];
24
+ status: "created" | "off" | "on";
25
+ createdAt: Date;
26
+ updatedAt: Date;
27
+ }