disgroove 2.0.1 → 2.1.0-dev.c430b6f

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 (185) hide show
  1. package/dist/lib/Client.d.ts +10 -1
  2. package/dist/lib/Client.js +15 -1
  3. package/dist/lib/constants.d.ts +14 -2
  4. package/dist/lib/constants.js +15 -3
  5. package/dist/lib/gateway/Shard.js +6 -1
  6. package/dist/lib/gateway/ShardManager.js +0 -1
  7. package/dist/lib/gateway/index.js +0 -1
  8. package/dist/lib/index.js +0 -1
  9. package/dist/lib/rest/CDN.js +0 -1
  10. package/dist/lib/rest/Endpoints.d.ts +3 -1
  11. package/dist/lib/rest/Endpoints.js +5 -2
  12. package/dist/lib/rest/RequestManager.d.ts +0 -1
  13. package/dist/lib/rest/RequestManager.js +0 -1
  14. package/dist/lib/rest/index.js +0 -1
  15. package/dist/lib/types/application-command.js +0 -1
  16. package/dist/lib/types/application-role-connection-metadata.js +0 -1
  17. package/dist/lib/types/application.js +0 -1
  18. package/dist/lib/types/audit-log.js +0 -1
  19. package/dist/lib/types/auto-moderation.js +0 -1
  20. package/dist/lib/types/channel.d.ts +4 -0
  21. package/dist/lib/types/channel.js +0 -1
  22. package/dist/lib/types/emoji.js +0 -1
  23. package/dist/lib/types/entitlements.js +0 -1
  24. package/dist/lib/types/gateway-events.d.ts +28 -0
  25. package/dist/lib/types/gateway-events.js +0 -1
  26. package/dist/lib/types/guild-scheduled-event.js +0 -1
  27. package/dist/lib/types/guild-template.js +0 -1
  28. package/dist/lib/types/guild.js +0 -1
  29. package/dist/lib/types/index.js +0 -1
  30. package/dist/lib/types/interaction.d.ts +3 -0
  31. package/dist/lib/types/interaction.js +0 -1
  32. package/dist/lib/types/invite.js +0 -1
  33. package/dist/lib/types/message-components.js +0 -1
  34. package/dist/lib/types/poll.d.ts +52 -0
  35. package/dist/lib/types/poll.js +2 -0
  36. package/dist/lib/types/role.js +0 -1
  37. package/dist/lib/types/sku.js +0 -1
  38. package/dist/lib/types/stage-instance.js +0 -1
  39. package/dist/lib/types/sticker.js +0 -1
  40. package/dist/lib/types/team.js +0 -1
  41. package/dist/lib/types/user.js +0 -1
  42. package/dist/lib/types/voice.js +0 -1
  43. package/dist/lib/types/webhook.d.ts +3 -0
  44. package/dist/lib/types/webhook.js +0 -1
  45. package/dist/lib/utils/Util.js +0 -1
  46. package/dist/lib/utils/errors.js +0 -1
  47. package/dist/lib/utils/index.js +0 -1
  48. package/dist/package.json +3 -2
  49. package/package.json +3 -2
  50. package/dist/lib/Client.js.map +0 -1
  51. package/dist/lib/constants.js.map +0 -1
  52. package/dist/lib/gateway/Shard.js.map +0 -1
  53. package/dist/lib/gateway/ShardManager.js.map +0 -1
  54. package/dist/lib/gateway/ShardsManager.d.ts +0 -6
  55. package/dist/lib/gateway/ShardsManager.js +0 -14
  56. package/dist/lib/gateway/ShardsManager.js.map +0 -1
  57. package/dist/lib/gateway/index.js.map +0 -1
  58. package/dist/lib/index.js.map +0 -1
  59. package/dist/lib/rest/CDN.js.map +0 -1
  60. package/dist/lib/rest/Endpoints.js.map +0 -1
  61. package/dist/lib/rest/REST.d.ts +0 -17
  62. package/dist/lib/rest/REST.js +0 -35
  63. package/dist/lib/rest/REST.js.map +0 -1
  64. package/dist/lib/rest/RequestManager.js.map +0 -1
  65. package/dist/lib/rest/RequestsManager.d.ts +0 -22
  66. package/dist/lib/rest/RequestsManager.js +0 -123
  67. package/dist/lib/rest/RequestsManager.js.map +0 -1
  68. package/dist/lib/rest/index.js.map +0 -1
  69. package/dist/lib/structures/Application.d.ts +0 -174
  70. package/dist/lib/structures/Application.js +0 -328
  71. package/dist/lib/structures/Application.js.map +0 -1
  72. package/dist/lib/structures/ApplicationCommand.d.ts +0 -45
  73. package/dist/lib/structures/ApplicationCommand.js +0 -127
  74. package/dist/lib/structures/ApplicationCommand.js.map +0 -1
  75. package/dist/lib/structures/AuditLog.d.ts +0 -19
  76. package/dist/lib/structures/AuditLog.js +0 -101
  77. package/dist/lib/structures/AuditLog.js.map +0 -1
  78. package/dist/lib/structures/AutoModerationRule.d.ts +0 -34
  79. package/dist/lib/structures/AutoModerationRule.js +0 -96
  80. package/dist/lib/structures/AutoModerationRule.js.map +0 -1
  81. package/dist/lib/structures/Base.d.ts +0 -10
  82. package/dist/lib/structures/Base.js +0 -23
  83. package/dist/lib/structures/Base.js.map +0 -1
  84. package/dist/lib/structures/Channel.d.ts +0 -254
  85. package/dist/lib/structures/Channel.js +0 -592
  86. package/dist/lib/structures/Channel.js.map +0 -1
  87. package/dist/lib/structures/ClientApplication.d.ts +0 -150
  88. package/dist/lib/structures/ClientApplication.js +0 -241
  89. package/dist/lib/structures/ClientApplication.js.map +0 -1
  90. package/dist/lib/structures/Emoji.d.ts +0 -26
  91. package/dist/lib/structures/Emoji.js +0 -75
  92. package/dist/lib/structures/Emoji.js.map +0 -1
  93. package/dist/lib/structures/Entitlement.d.ts +0 -24
  94. package/dist/lib/structures/Entitlement.js +0 -68
  95. package/dist/lib/structures/Entitlement.js.map +0 -1
  96. package/dist/lib/structures/Guild.d.ts +0 -474
  97. package/dist/lib/structures/Guild.js +0 -1141
  98. package/dist/lib/structures/Guild.js.map +0 -1
  99. package/dist/lib/structures/GuildMember.d.ts +0 -49
  100. package/dist/lib/structures/GuildMember.js +0 -146
  101. package/dist/lib/structures/GuildMember.js.map +0 -1
  102. package/dist/lib/structures/GuildScheduledEvent.d.ts +0 -49
  103. package/dist/lib/structures/GuildScheduledEvent.js +0 -118
  104. package/dist/lib/structures/GuildScheduledEvent.js.map +0 -1
  105. package/dist/lib/structures/GuildTemplate.d.ts +0 -30
  106. package/dist/lib/structures/GuildTemplate.js +0 -72
  107. package/dist/lib/structures/GuildTemplate.js.map +0 -1
  108. package/dist/lib/structures/IdentifiableBase.d.ts +0 -15
  109. package/dist/lib/structures/IdentifiableBase.js +0 -25
  110. package/dist/lib/structures/IdentifiableBase.js.map +0 -1
  111. package/dist/lib/structures/Integration.d.ts +0 -31
  112. package/dist/lib/structures/Integration.js +0 -103
  113. package/dist/lib/structures/Integration.js.map +0 -1
  114. package/dist/lib/structures/Interaction.d.ts +0 -76
  115. package/dist/lib/structures/Interaction.js +0 -346
  116. package/dist/lib/structures/Interaction.js.map +0 -1
  117. package/dist/lib/structures/Invite.d.ts +0 -26
  118. package/dist/lib/structures/Invite.js +0 -82
  119. package/dist/lib/structures/Invite.js.map +0 -1
  120. package/dist/lib/structures/Message.d.ts +0 -86
  121. package/dist/lib/structures/Message.js +0 -303
  122. package/dist/lib/structures/Message.js.map +0 -1
  123. package/dist/lib/structures/Role.d.ts +0 -37
  124. package/dist/lib/structures/Role.js +0 -90
  125. package/dist/lib/structures/Role.js.map +0 -1
  126. package/dist/lib/structures/SKU.d.ts +0 -23
  127. package/dist/lib/structures/SKU.js +0 -63
  128. package/dist/lib/structures/SKU.js.map +0 -1
  129. package/dist/lib/structures/StageInstance.d.ts +0 -24
  130. package/dist/lib/structures/StageInstance.js +0 -57
  131. package/dist/lib/structures/StageInstance.js.map +0 -1
  132. package/dist/lib/structures/Sticker.d.ts +0 -31
  133. package/dist/lib/structures/Sticker.js +0 -86
  134. package/dist/lib/structures/Sticker.js.map +0 -1
  135. package/dist/lib/structures/Team.d.ts +0 -14
  136. package/dist/lib/structures/Team.js +0 -39
  137. package/dist/lib/structures/Team.js.map +0 -1
  138. package/dist/lib/structures/TestEntitlement.d.ts +0 -23
  139. package/dist/lib/structures/TestEntitlement.js +0 -61
  140. package/dist/lib/structures/TestEntitlement.js.map +0 -1
  141. package/dist/lib/structures/UnavailableGuild.d.ts +0 -11
  142. package/dist/lib/structures/UnavailableGuild.js +0 -25
  143. package/dist/lib/structures/UnavailableGuild.js.map +0 -1
  144. package/dist/lib/structures/User.d.ts +0 -63
  145. package/dist/lib/structures/User.js +0 -177
  146. package/dist/lib/structures/User.js.map +0 -1
  147. package/dist/lib/structures/VoiceState.d.ts +0 -24
  148. package/dist/lib/structures/VoiceState.js +0 -66
  149. package/dist/lib/structures/VoiceState.js.map +0 -1
  150. package/dist/lib/structures/Webhook.d.ts +0 -82
  151. package/dist/lib/structures/Webhook.js +0 -223
  152. package/dist/lib/structures/Webhook.js.map +0 -1
  153. package/dist/lib/structures/index.d.ts +0 -28
  154. package/dist/lib/structures/index.js +0 -45
  155. package/dist/lib/structures/index.js.map +0 -1
  156. package/dist/lib/types/application-command.js.map +0 -1
  157. package/dist/lib/types/application-role-connection-metadata.js.map +0 -1
  158. package/dist/lib/types/application.js.map +0 -1
  159. package/dist/lib/types/audit-log.js.map +0 -1
  160. package/dist/lib/types/auto-moderation.js.map +0 -1
  161. package/dist/lib/types/channel.js.map +0 -1
  162. package/dist/lib/types/emoji.js.map +0 -1
  163. package/dist/lib/types/entitlements.js.map +0 -1
  164. package/dist/lib/types/gateway-events.js.map +0 -1
  165. package/dist/lib/types/guild-scheduled-event.js.map +0 -1
  166. package/dist/lib/types/guild-template.js.map +0 -1
  167. package/dist/lib/types/guild.js.map +0 -1
  168. package/dist/lib/types/index.js.map +0 -1
  169. package/dist/lib/types/interaction.js.map +0 -1
  170. package/dist/lib/types/invite.js.map +0 -1
  171. package/dist/lib/types/message-components.js.map +0 -1
  172. package/dist/lib/types/role.js.map +0 -1
  173. package/dist/lib/types/sku.js.map +0 -1
  174. package/dist/lib/types/stage-instance.js.map +0 -1
  175. package/dist/lib/types/sticker.js.map +0 -1
  176. package/dist/lib/types/team.js.map +0 -1
  177. package/dist/lib/types/user.js.map +0 -1
  178. package/dist/lib/types/voice.js.map +0 -1
  179. package/dist/lib/types/webhook.js.map +0 -1
  180. package/dist/lib/utils/Collection.d.ts +0 -24
  181. package/dist/lib/utils/Collection.js +0 -65
  182. package/dist/lib/utils/Collection.js.map +0 -1
  183. package/dist/lib/utils/Util.js.map +0 -1
  184. package/dist/lib/utils/errors.js.map +0 -1
  185. package/dist/lib/utils/index.js.map +0 -1
@@ -1,150 +0,0 @@
1
- import { IdentifiableBase, ApplicationCommand, Application, SKU, Entitlement, TestEntitlement } from ".";
2
- import type { JSONGuildApplicationCommandPermissions, RawApplication, JSONApplication, JSONApplicationRoleConnectionMetadata, JSONInstallParams, JSONApplicationCommandOption } from "../types";
3
- import type { Client } from "../Client";
4
- import type { ApplicationCommandTypes, ApplicationFlags, Locales } from "../constants";
5
- export declare class ClientApplication extends IdentifiableBase {
6
- protected raw: Pick<RawApplication, "id" | "flags">;
7
- flags?: ApplicationFlags;
8
- constructor(data: Pick<RawApplication, "id" | "flags">, client: Client);
9
- protected patch(data: Pick<RawApplication, "id" | "flags">): void;
10
- /** https://discord.com/developers/docs/interactions/application-commands#create-global-application-command */
11
- createGlobalApplicationCommand(options: {
12
- name: string;
13
- nameLocalizations?: Partial<Record<Locales, string>> | null;
14
- description?: string;
15
- descriptionLocalizations?: Partial<Record<Locales, string>> | null;
16
- options?: Array<JSONApplicationCommandOption>;
17
- defaultMemberPermissions?: string | null;
18
- dmPermission?: boolean;
19
- defaultPermission?: boolean | null;
20
- type?: ApplicationCommandTypes;
21
- nsfw?: boolean;
22
- }): Promise<ApplicationCommand>;
23
- /** https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command */
24
- createGuildApplicationCommand(guildId: string, options: {
25
- name?: string;
26
- nameLocalizations?: Partial<Record<Locales, string>> | null;
27
- description?: string;
28
- descriptionLocalizations?: Partial<Record<Locales, string>> | null;
29
- options?: Array<JSONApplicationCommandOption>;
30
- defaultMemberPermissions?: string | null;
31
- dmPermission?: boolean;
32
- defaultPermission?: boolean | null;
33
- type?: ApplicationCommandTypes;
34
- nsfw?: boolean;
35
- }): Promise<ApplicationCommand>;
36
- /** https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement */
37
- createTestEntitlement(options: {
38
- skuId: string;
39
- ownerId: string;
40
- ownerType: number;
41
- }): Promise<TestEntitlement>;
42
- /** https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command */
43
- deleteGlobalApplicationCommand(commandId: string): void;
44
- /** https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command */
45
- deleteGuildApplicationCommand(guildId: string, commandId: string): void;
46
- /** https://discord.com/developers/docs/monetization/entitlements#delete-test-entitlement */
47
- deleteTestEntitlement(entitlementId: string): void;
48
- /** https://discord.com/developers/docs/resources/application#edit-current-application */
49
- edit(options: {
50
- customInstallURL?: string;
51
- description?: string;
52
- roleConnectionsVerificationURL?: string;
53
- installParams?: JSONInstallParams;
54
- flags?: ApplicationFlags;
55
- icon?: string;
56
- coverImage?: string;
57
- interactionsEndpointURL?: string;
58
- tags?: Array<string>;
59
- }): Promise<Application>;
60
- /** https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions */
61
- editApplicationCommandPermissions(guildId: string, commandId: string, options: {
62
- permissions: Array<JSONGuildApplicationCommandPermissions>;
63
- }): Promise<JSONGuildApplicationCommandPermissions>;
64
- /** https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command */
65
- editGlobalApplicationCommand(commandId: string, options: {
66
- name?: string;
67
- nameLocalizations?: Partial<Record<Locales, string>> | null;
68
- description?: string;
69
- descriptionLocalizations?: Partial<Record<Locales, string>> | null;
70
- options?: Array<JSONApplicationCommandOption>;
71
- defaultMemberPermissions?: string | null;
72
- defaultPermission?: boolean | null;
73
- dmPermission?: boolean;
74
- nsfw?: boolean;
75
- }): Promise<ApplicationCommand>;
76
- /** https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command */
77
- editGuildApplicationCommand(guildId: string, commandId: string, options: {
78
- name?: string;
79
- nameLocalizations?: Partial<Record<Locales, string>> | null;
80
- description?: string;
81
- descriptionLocalizations?: Partial<Record<Locales, string>> | null;
82
- options?: Array<JSONApplicationCommandOption>;
83
- defaultMemberPermissions?: string | null;
84
- defaultPermission?: boolean | null;
85
- dmPermission?: boolean;
86
- nsfw?: boolean;
87
- }): Promise<ApplicationCommand>;
88
- /** https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions */
89
- getApplicationCommandPermissions(guildId: string, commandId: string): Promise<Array<JSONGuildApplicationCommandPermissions>>;
90
- /** https://discord.com/developers/docs/monetization/entitlements#list-entitlements */
91
- getEntitlements(options?: {
92
- userId?: string;
93
- skuIds?: Array<string>;
94
- before?: string;
95
- after?: string;
96
- limit?: number;
97
- guildId?: string;
98
- excludeEnded?: boolean;
99
- }): Promise<Array<Entitlement>>;
100
- /** https://discord.com/developers/docs/interactions/application-commands#get-global-application-command */
101
- getGlobalApplicationCommand(commandId: string): Promise<ApplicationCommand>;
102
- /** https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands */
103
- getGlobalApplicationCommands(options: {
104
- withLocalizations?: boolean;
105
- }): Promise<Array<ApplicationCommand>>;
106
- /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command */
107
- getGuildApplicationCommand(guildId: string, commandId: string): Promise<ApplicationCommand>;
108
- /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands */
109
- getGuildApplicationCommands(guildId: string, options?: {
110
- withLocalizations?: boolean;
111
- }): Promise<Array<ApplicationCommand>>;
112
- /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions */
113
- getGuildApplicationCommandPermissions(guildId: string): Promise<Array<JSONGuildApplicationCommandPermissions>>;
114
- /** https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records */
115
- getApplicationRoleConnectionMetadataRecords(): Promise<Array<JSONApplicationRoleConnectionMetadata>>;
116
- /** https://discord.com/developers/docs/monetization/skus#list-skus */
117
- getSKUs(): Promise<Array<SKU>>;
118
- /** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands */
119
- setGlobalApplicationCommands(commands: Array<{
120
- id?: string;
121
- name: string;
122
- nameLocalizations?: Partial<Record<Locales, string>> | null;
123
- description?: string;
124
- descriptionLocalizations?: Partial<Record<Locales, string>> | null;
125
- options?: Array<JSONApplicationCommandOption>;
126
- defaultMemberPermissions?: string | null;
127
- dmPermission?: boolean;
128
- defaultPermission?: boolean | null;
129
- type?: ApplicationCommandTypes;
130
- nsfw?: boolean;
131
- }>): Promise<Array<ApplicationCommand>>;
132
- /** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands */
133
- setGuildApplicationCommands(guildId: string, commands: Array<{
134
- id?: string;
135
- name?: string;
136
- nameLocalizations?: Partial<Record<Locales, string>> | null;
137
- description?: string;
138
- descriptionLocalizations?: Partial<Record<Locales, string>> | null;
139
- options?: Array<JSONApplicationCommandOption>;
140
- defaultMemberPermissions?: string | null;
141
- dmPermission?: boolean;
142
- defaultPermission?: boolean | null;
143
- type: ApplicationCommandTypes;
144
- nsfw?: boolean;
145
- }>): Promise<Array<ApplicationCommand>>;
146
- /** https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records */
147
- updateApplicationRoleConnectionMetadataRecords(): Promise<Array<JSONApplicationRoleConnectionMetadata>>;
148
- toRaw(): Pick<RawApplication, "id" | "flags">;
149
- toJSON(): Pick<JSONApplication, "id" | "flags">;
150
- }
@@ -1,241 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ClientApplication = void 0;
4
- const _1 = require(".");
5
- const rest_1 = require("../rest");
6
- class ClientApplication extends _1.IdentifiableBase {
7
- raw;
8
- flags;
9
- constructor(data, client) {
10
- super(data.id, client);
11
- this.raw = data;
12
- this.patch(data);
13
- }
14
- patch(data) {
15
- if (data.flags !== undefined)
16
- this.flags = data.flags;
17
- }
18
- /** https://discord.com/developers/docs/interactions/application-commands#create-global-application-command */
19
- async createGlobalApplicationCommand(options) {
20
- return new _1.ApplicationCommand(await this.client.rest.post(rest_1.Endpoints.applicationCommands(this.id), {
21
- json: this.client.util.applicationCommandToRaw(options),
22
- }), this.client);
23
- }
24
- /** https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command */
25
- async createGuildApplicationCommand(guildId, options) {
26
- return new _1.ApplicationCommand(await this.client.rest.post(rest_1.Endpoints.applicationGuildCommands(this.id, guildId), {
27
- json: this.client.util.applicationCommandToRaw(options),
28
- }), this.client);
29
- }
30
- /** https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement */
31
- async createTestEntitlement(options) {
32
- return new _1.TestEntitlement(await this.client.rest.post(rest_1.Endpoints.applicationEntitlements(this.id), {
33
- json: {
34
- sku_id: options.skuId,
35
- owner_id: options.ownerId,
36
- owner_type: options.ownerType,
37
- },
38
- }), this.client);
39
- }
40
- /** https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command */
41
- deleteGlobalApplicationCommand(commandId) {
42
- this.client.rest.delete(rest_1.Endpoints.applicationCommand(this.id, commandId));
43
- }
44
- /** https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command */
45
- deleteGuildApplicationCommand(guildId, commandId) {
46
- this.client.rest.delete(rest_1.Endpoints.applicationGuildCommand(this.id, guildId, commandId));
47
- }
48
- /** https://discord.com/developers/docs/monetization/entitlements#delete-test-entitlement */
49
- deleteTestEntitlement(entitlementId) {
50
- this.client.rest.delete(rest_1.Endpoints.applicationEntitlement(this.id, entitlementId));
51
- }
52
- /** https://discord.com/developers/docs/resources/application#edit-current-application */
53
- async edit(options) {
54
- return new _1.Application(await this.client.rest.patch(rest_1.Endpoints.applicationCurrentUser(), {
55
- json: {
56
- custom_install_url: options.customInstallURL,
57
- description: options.description,
58
- role_connections_verification_url: options.roleConnectionsVerificationURL,
59
- install_params: options.installParams,
60
- flags: options.flags,
61
- icon: options.icon,
62
- cover_image: options.coverImage,
63
- interactions_endpoint_url: options.interactionsEndpointURL,
64
- tags: options.tags,
65
- },
66
- }), this.client);
67
- }
68
- /** https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions */
69
- async editApplicationCommandPermissions(guildId, commandId, options) {
70
- return this.client.rest
71
- .put(rest_1.Endpoints.applicationCommandPermissions(this.id, guildId, commandId), {
72
- json: {
73
- permissions: options.permissions.map((option) => ({
74
- id: option.id,
75
- application_id: option.applicationId,
76
- guild_id: option.guildId,
77
- permissions: option.permissions.map((permission) => ({
78
- id: permission.id,
79
- type: permission.type,
80
- permission: permission.permission,
81
- })),
82
- })),
83
- },
84
- })
85
- .then((response) => ({
86
- id: response.id,
87
- applicationId: response.application_id,
88
- guildId: response.guild_id,
89
- permissions: response.permissions.map((permission) => ({
90
- id: permission.id,
91
- type: permission.type,
92
- permission: permission.permission,
93
- })),
94
- }));
95
- }
96
- /** https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command */
97
- async editGlobalApplicationCommand(commandId, options) {
98
- return new _1.ApplicationCommand(await this.client.rest.patch(rest_1.Endpoints.applicationCommand(this.id, commandId), {
99
- json: this.client.util.applicationCommandToRaw(options),
100
- }), this.client);
101
- }
102
- /** https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command */
103
- async editGuildApplicationCommand(guildId, commandId, options) {
104
- return new _1.ApplicationCommand(await this.client.rest.patch(rest_1.Endpoints.applicationGuildCommand(this.id, guildId, commandId), {
105
- json: this.client.util.applicationCommandToRaw(options),
106
- }), this.client);
107
- }
108
- /** https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions */
109
- async getApplicationCommandPermissions(guildId, commandId) {
110
- return this.client.rest
111
- .get(rest_1.Endpoints.applicationCommandPermissions(this.id, guildId, commandId))
112
- .then((response) => response.map((permissions) => ({
113
- id: permissions.id,
114
- applicationId: permissions.application_id,
115
- guildId: permissions.guild_id,
116
- permissions: permissions.permissions.map((permission) => ({
117
- id: permission.id,
118
- type: permission.type,
119
- permission: permission.permission,
120
- })),
121
- })));
122
- }
123
- /** https://discord.com/developers/docs/monetization/entitlements#list-entitlements */
124
- async getEntitlements(options) {
125
- return this.client.rest
126
- .get(rest_1.Endpoints.applicationEntitlements(this.id), {
127
- query: {
128
- user_id: options?.userId,
129
- sku_ids: options?.skuIds,
130
- before: options?.before,
131
- after: options?.after,
132
- limit: options?.limit,
133
- guild_id: options?.guildId,
134
- exclude_ended: options?.excludeEnded,
135
- },
136
- })
137
- .then((response) => response.map((data) => new _1.Entitlement(data, this.client)));
138
- }
139
- /** https://discord.com/developers/docs/interactions/application-commands#get-global-application-command */
140
- async getGlobalApplicationCommand(commandId) {
141
- return new _1.ApplicationCommand(await this.client.rest.get(rest_1.Endpoints.applicationCommand(this.id, commandId)), this.client);
142
- }
143
- /** https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands */
144
- async getGlobalApplicationCommands(options) {
145
- return this.client.rest
146
- .get(rest_1.Endpoints.applicationCommands(this.id), {
147
- query: {
148
- with_localizations: options.withLocalizations,
149
- },
150
- })
151
- .then((response) => response.map((data) => new _1.ApplicationCommand(data, this.client)));
152
- }
153
- /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command */
154
- async getGuildApplicationCommand(guildId, commandId) {
155
- return new _1.ApplicationCommand(await this.client.rest.get(rest_1.Endpoints.applicationGuildCommand(this.id, guildId, commandId)), this.client);
156
- }
157
- /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands */
158
- async getGuildApplicationCommands(guildId, options) {
159
- return this.client.rest
160
- .get(rest_1.Endpoints.applicationGuildCommands(this.id, guildId), {
161
- query: {
162
- with_localizations: options?.withLocalizations,
163
- },
164
- })
165
- .then((response) => response.map((data) => new _1.ApplicationCommand(data, this.client)));
166
- }
167
- /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions */
168
- async getGuildApplicationCommandPermissions(guildId) {
169
- return this.client.rest
170
- .get(rest_1.Endpoints.guildApplicationCommandsPermissions(this.id, guildId))
171
- .then((response) => response.map((permissions) => ({
172
- id: permissions.id,
173
- applicationId: permissions.application_id,
174
- guildId: permissions.guild_id,
175
- permissions: permissions.permissions.map((permission) => ({
176
- id: permission.id,
177
- type: permission.type,
178
- permission: permission.permission,
179
- })),
180
- })));
181
- }
182
- /** https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records */
183
- async getApplicationRoleConnectionMetadataRecords() {
184
- return this.client.rest
185
- .get(rest_1.Endpoints.applicationRoleConnectionMetadata(this.id))
186
- .then((response) => response.map((data) => ({
187
- type: data.type,
188
- key: data.key,
189
- name: data.name,
190
- nameLocalizations: data.name_localizations,
191
- description: data.description,
192
- descriptionLocalizations: data.description_localizations,
193
- })));
194
- }
195
- /** https://discord.com/developers/docs/monetization/skus#list-skus */
196
- async getSKUs() {
197
- return this.client.rest
198
- .get(rest_1.Endpoints.applicationSKUs(this.id))
199
- .then((response) => response.map((data) => new _1.SKU(data, this.client)));
200
- }
201
- /** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands */
202
- async setGlobalApplicationCommands(commands) {
203
- return this.client.rest
204
- .put(rest_1.Endpoints.applicationCommands(this.id), {
205
- json: commands.map((command) => this.client.util.applicationCommandToRaw(command)),
206
- })
207
- .then((response) => response.map((data) => new _1.ApplicationCommand(data, this.client)));
208
- }
209
- /** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands */
210
- async setGuildApplicationCommands(guildId, commands) {
211
- return this.client.rest
212
- .put(rest_1.Endpoints.applicationGuildCommands(this.id, guildId), {
213
- json: commands.map((command) => this.client.util.applicationCommandToRaw(command)),
214
- })
215
- .then((response) => response.map((data) => new _1.ApplicationCommand(data, this.client)));
216
- }
217
- /** https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records */
218
- async updateApplicationRoleConnectionMetadataRecords() {
219
- return this.client.rest
220
- .put(rest_1.Endpoints.applicationRoleConnectionMetadata(this.id))
221
- .then((response) => response.map((data) => ({
222
- type: data.type,
223
- key: data.key,
224
- name: data.name,
225
- nameLocalizations: data.name_localizations,
226
- description: data.description,
227
- descriptionLocalizations: data.description_localizations,
228
- })));
229
- }
230
- toRaw() {
231
- return this.raw;
232
- }
233
- toJSON() {
234
- return {
235
- ...super.toJSON(),
236
- flags: this.flags,
237
- };
238
- }
239
- }
240
- exports.ClientApplication = ClientApplication;
241
- //# sourceMappingURL=ClientApplication.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ClientApplication.js","sourceRoot":"","sources":["../../../lib/structures/ClientApplication.ts"],"names":[],"mappings":";;;AAAA,wBAO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I,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAClE,CAAC;IACN,CAAC;IAED,6IAA6I;IAC7I,KAAK,CAAC,8CAA8C;QAGlD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI;aACpB,GAAG,CACF,gBAAS,CAAC,iCAAiC,CAAC,IAAI,CAAC,EAAE,CAAC,CACrD;aACA,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CACjB,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACtB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,iBAAiB,EAAE,IAAI,CAAC,kBAAkB;YAC1C,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,wBAAwB,EAAE,IAAI,CAAC,yBAAyB;SACzD,CAAC,CAAC,CACJ,CAAC;IACN,CAAC;IAEQ,KAAK;QACZ,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IAEQ,MAAM;QACb,OAAO;YACL,GAAG,KAAK,CAAC,MAAM,EAAE;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC;IACJ,CAAC;CACF;AAteD,8CAseC"}
@@ -1,26 +0,0 @@
1
- import { Base, User } from ".";
2
- import type { Client } from "../Client";
3
- import type { JSONEmoji, RawEmoji } from "../types";
4
- /** https://discord.com/developers/docs/resources/emoji */
5
- export declare class Emoji extends Base {
6
- protected raw: RawEmoji;
7
- id: string | null;
8
- name: string | null;
9
- roles?: Array<string>;
10
- user?: User;
11
- requireColons?: boolean;
12
- managed?: boolean;
13
- animated?: boolean;
14
- available?: boolean;
15
- constructor(data: RawEmoji, client: Client);
16
- protected patch(data: RawEmoji): void;
17
- /** https://discord.com/developers/docs/resources/emoji#delete-guild-emoji */
18
- delete(guildId: string, reason?: string): void;
19
- /** https://discord.com/developers/docs/resources/emoji#modify-guild-emoji */
20
- edit(guildId: string, options: {
21
- name?: string;
22
- roles?: Array<string> | null;
23
- }, reason?: string): Promise<Emoji>;
24
- toRaw(): RawEmoji;
25
- toJSON(): JSONEmoji;
26
- }
@@ -1,75 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Emoji = void 0;
4
- const _1 = require(".");
5
- const rest_1 = require("../rest");
6
- /** https://discord.com/developers/docs/resources/emoji */
7
- class Emoji extends _1.Base {
8
- raw;
9
- id;
10
- name;
11
- roles;
12
- user;
13
- requireColons;
14
- managed;
15
- animated;
16
- available;
17
- constructor(data, client) {
18
- super(client);
19
- this.raw = data;
20
- this.id = data.id;
21
- this.name = data.name;
22
- this.patch(data);
23
- }
24
- patch(data) {
25
- if (data.roles !== undefined)
26
- this.roles = data.roles;
27
- if (data.user !== undefined)
28
- this.user = new _1.User(data.user, this.client);
29
- if (data.require_colons !== undefined)
30
- this.requireColons = data.require_colons;
31
- if (data.managed !== undefined)
32
- this.managed = data.managed;
33
- if (data.animated !== undefined)
34
- this.animated = data.animated;
35
- if (data.available !== undefined)
36
- this.available = data.available;
37
- }
38
- /** https://discord.com/developers/docs/resources/emoji#delete-guild-emoji */
39
- delete(guildId, reason) {
40
- if (!this.id)
41
- throw new Error("[disgroove] Cannot delete a default Discord emoji");
42
- this.client.rest.delete(rest_1.Endpoints.guildEmoji(guildId, this.id), {
43
- reason,
44
- });
45
- }
46
- /** https://discord.com/developers/docs/resources/emoji#modify-guild-emoji */
47
- async edit(guildId, options, reason) {
48
- if (!this.id)
49
- throw new Error("[disgroove] Cannot edit a default Discord emoji");
50
- return new Emoji(await this.client.rest.patch(rest_1.Endpoints.guildEmoji(guildId, this.id), {
51
- json: {
52
- name: options.name,
53
- roles: options.roles,
54
- },
55
- reason,
56
- }), this.client);
57
- }
58
- toRaw() {
59
- return this.raw;
60
- }
61
- toJSON() {
62
- return {
63
- id: this.id,
64
- name: this.name,
65
- roles: this.roles,
66
- user: this.user?.toJSON(),
67
- requireColons: this.requireColons,
68
- managed: this.managed,
69
- animated: this.animated,
70
- available: this.available,
71
- };
72
- }
73
- }
74
- exports.Emoji = Emoji;
75
- //# sourceMappingURL=Emoji.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Emoji.js","sourceRoot":"","sources":["../../../lib/structures/Emoji.ts"],"names":[],"mappings":";;;AAAA,wBAA+B;AAE/B,kCAAoC;AAGpC,0DAA0D;AAC1D,MAAa,KAAM,SAAQ,OAAI;IACV,GAAG,CAAW;IAEjC,EAAE,CAAgB;IAClB,IAAI,CAAgB;IACpB,KAAK,CAAiB;IACtB,IAAI,CAAQ;IACZ,aAAa,CAAW;IACxB,OAAO,CAAW;IAClB,QAAQ,CAAW;IACnB,SAAS,CAAW;IAEpB,YAAY,IAAc,EAAE,MAAc;QACxC,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAEtB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;IAEkB,KAAK,CAAC,IAAc;QACrC,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS;YAAE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACtD,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS;YAAE,IAAI,CAAC,IAAI,GAAG,IAAI,OAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1E,IAAI,IAAI,CAAC,cAAc,KAAK,SAAS;YACnC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC;QAC3C,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS;YAAE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5D,IAAI,IAAI,CAAC,QA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Aa;YACjC,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAC;IACJ,CAAC;CACF;AArFD,sBAqFC"}
@@ -1,24 +0,0 @@
1
- import type { Client } from "../Client";
2
- import type { JSONEntitlement, RawEntitlement } from "../types";
3
- import { IdentifiableBase } from ".";
4
- import type { EntitlementTypes } from "../constants";
5
- /** https://discord.com/developers/docs/monetization/entitlements */
6
- export declare class Entitlement extends IdentifiableBase {
7
- protected raw: RawEntitlement;
8
- skuId: string;
9
- applicationId: string;
10
- userId?: string;
11
- promotionId?: string | null;
12
- type: EntitlementTypes;
13
- deleted: boolean;
14
- giftCodeFlags?: number;
15
- consumed?: boolean;
16
- startsAt?: string;
17
- endsAt?: string;
18
- guildId?: string;
19
- subscriptionId?: string;
20
- constructor(data: RawEntitlement, client: Client);
21
- protected patch(data: RawEntitlement): void;
22
- toRaw(): RawEntitlement;
23
- toJSON(): JSONEntitlement;
24
- }
@@ -1,68 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Entitlement = void 0;
4
- const _1 = require(".");
5
- /** https://discord.com/developers/docs/monetization/entitlements */
6
- class Entitlement extends _1.IdentifiableBase {
7
- raw;
8
- skuId;
9
- applicationId;
10
- userId;
11
- promotionId; // Undocumented
12
- type;
13
- deleted;
14
- giftCodeFlags; // Undocumented
15
- consumed; // Undocumented
16
- startsAt;
17
- endsAt;
18
- guildId;
19
- subscriptionId; // Undocumented
20
- constructor(data, client) {
21
- super(data.id, client);
22
- this.raw = data;
23
- this.skuId = data.sku_id;
24
- this.applicationId = data.application_id;
25
- this.type = data.type;
26
- this.deleted = data.deleted;
27
- }
28
- patch(data) {
29
- if (data.user_id !== undefined)
30
- this.userId = data.user_id;
31
- if (data.promotion_id !== undefined)
32
- this.promotionId = data.promotion_id;
33
- if (data.gift_code_flags !== undefined)
34
- this.giftCodeFlags = data.gift_code_flags;
35
- if (data.consumed !== undefined)
36
- this.consumed = data.consumed;
37
- if (data.starts_at !== undefined)
38
- this.startsAt = data.starts_at;
39
- if (data.ends_at !== undefined)
40
- this.endsAt = data.ends_at;
41
- if (data.guild_id !== undefined)
42
- this.guildId = data.guild_id;
43
- if (data.subscription_id !== undefined)
44
- this.subscriptionId;
45
- }
46
- toRaw() {
47
- return this.raw;
48
- }
49
- toJSON() {
50
- return {
51
- id: this.id,
52
- skuId: this.skuId,
53
- applicationId: this.applicationId,
54
- userId: this.userId,
55
- promotionId: this.promotionId,
56
- type: this.type,
57
- deleted: this.deleted,
58
- giftCodeFlags: this.giftCodeFlags,
59
- consumed: this.consumed,
60
- startsAt: this.startsAt,
61
- endsAt: this.endsAt,
62
- guildId: this.guildId,
63
- subscriptionId: this.subscriptionId,
64
- };
65
- }
66
- }
67
- exports.Entitlement = Entitlement;
68
- //# sourceMappingURL=Entitlement.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Entitlement.js","sourceRoot":"","sources":["../../../lib/structures/Entitlement.ts"],"names":[],"mappings":";;;AAEA,wBAAqC;AAGrC,oEAAoE;AACpE,MAAa,WAAY,SAAQ,mBAAgB;IAC5B,GAAG,CAAiB;IAEvC,KAAK,CAAS;IACd,aAAa,CAAS;IACtB,MAAM,CAAU;IAChB,WAAW,CAAiB,CAAC,eAAe;IAC5C,IAAI,CAAmB;IACvB,OAAO,CAAU;IACjB,aAAa,CAAU,CAAC,eAAe;IACvC,QAAQ,CAAW,CAAC,eAAe;IACnC,QAAQ,CAAU;IAClB,MAAM,CAAU;IAChB,OAAO,CAAU;IACjB,cAAc,CAAU,CAAC,eAAe;IAExC,YAAY,IAAoB,EAAE,MAAc;QAC9C,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAEvB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;QACz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