disgroove 1.2.9 → 1.3.0-dev.3af784e

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 (108) hide show
  1. package/dist/Client.d.ts +43 -43
  2. package/dist/Client.js +76 -76
  3. package/dist/Client.js.map +1 -1
  4. package/dist/gateway/Shard.js +32 -36
  5. package/dist/gateway/Shard.js.map +1 -1
  6. package/dist/index.d.ts +1 -0
  7. package/dist/index.js +1 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/rest/Endpoints.d.ts +1 -1
  10. package/dist/rest/Endpoints.js +3 -3
  11. package/dist/rest/RequestsManager.js +1 -1
  12. package/dist/rest/RequestsManager.js.map +1 -1
  13. package/dist/structures/Application.d.ts +72 -72
  14. package/dist/structures/Application.js +128 -155
  15. package/dist/structures/Application.js.map +1 -1
  16. package/dist/structures/ApplicationCommand.d.ts +4 -4
  17. package/dist/structures/ApplicationCommand.js +19 -19
  18. package/dist/structures/ApplicationCommand.js.map +1 -1
  19. package/dist/structures/AuditLog.d.ts +20 -0
  20. package/dist/structures/AuditLog.js +76 -0
  21. package/dist/structures/AuditLog.js.map +1 -0
  22. package/dist/structures/AutoModerationRule.d.ts +7 -7
  23. package/dist/structures/AutoModerationRule.js +7 -7
  24. package/dist/structures/AutoModerationRule.js.map +1 -1
  25. package/dist/structures/Channel.d.ts +134 -134
  26. package/dist/structures/Channel.js +263 -263
  27. package/dist/structures/Channel.js.map +1 -1
  28. package/dist/structures/ClientApplication.d.ts +324 -0
  29. package/dist/structures/ClientApplication.js +241 -0
  30. package/dist/structures/ClientApplication.js.map +1 -0
  31. package/dist/structures/Emoji.d.ts +2 -2
  32. package/dist/structures/Emoji.js +9 -9
  33. package/dist/structures/Emoji.js.map +1 -1
  34. package/dist/structures/Entitlement.d.ts +24 -0
  35. package/dist/structures/Entitlement.js +68 -0
  36. package/dist/structures/Entitlement.js.map +1 -0
  37. package/dist/structures/Guild.d.ts +311 -311
  38. package/dist/structures/Guild.js +615 -661
  39. package/dist/structures/Guild.js.map +1 -1
  40. package/dist/structures/GuildMember.d.ts +10 -10
  41. package/dist/structures/GuildMember.js +30 -30
  42. package/dist/structures/GuildMember.js.map +1 -1
  43. package/dist/structures/GuildScheduledEvent.d.ts +2 -2
  44. package/dist/structures/GuildScheduledEvent.js +7 -7
  45. package/dist/structures/GuildScheduledEvent.js.map +1 -1
  46. package/dist/structures/GuildTemplate.d.ts +4 -4
  47. package/dist/structures/GuildTemplate.js +7 -9
  48. package/dist/structures/GuildTemplate.js.map +1 -1
  49. package/dist/structures/Integration.d.ts +1 -1
  50. package/dist/structures/Integration.js +2 -2
  51. package/dist/structures/Integration.js.map +1 -1
  52. package/dist/structures/Interaction.d.ts +27 -42
  53. package/dist/structures/Interaction.js +97 -130
  54. package/dist/structures/Interaction.js.map +1 -1
  55. package/dist/structures/Invite.d.ts +2 -1
  56. package/dist/structures/Invite.js +1 -1
  57. package/dist/structures/Invite.js.map +1 -1
  58. package/dist/structures/Message.d.ts +23 -20
  59. package/dist/structures/Message.js +71 -206
  60. package/dist/structures/Message.js.map +1 -1
  61. package/dist/structures/PartialApplication.d.ts +70 -70
  62. package/dist/structures/PartialApplication.js +128 -155
  63. package/dist/structures/PartialApplication.js.map +1 -1
  64. package/dist/structures/Role.d.ts +2 -2
  65. package/dist/structures/Role.js +7 -7
  66. package/dist/structures/Role.js.map +1 -1
  67. package/dist/structures/SKU.d.ts +23 -0
  68. package/dist/structures/SKU.js +63 -0
  69. package/dist/structures/SKU.js.map +1 -0
  70. package/dist/structures/StageInstance.d.ts +3 -3
  71. package/dist/structures/StageInstance.js +7 -7
  72. package/dist/structures/StageInstance.js.map +1 -1
  73. package/dist/structures/Sticker.d.ts +2 -2
  74. package/dist/structures/Sticker.js +9 -9
  75. package/dist/structures/Sticker.js.map +1 -1
  76. package/dist/structures/Team.js +2 -2
  77. package/dist/structures/Team.js.map +1 -1
  78. package/dist/structures/TestEntitlement.d.ts +23 -0
  79. package/dist/structures/TestEntitlement.js +61 -0
  80. package/dist/structures/TestEntitlement.js.map +1 -0
  81. package/dist/structures/UnavailableGuild.d.ts +2 -487
  82. package/dist/structures/UnavailableGuild.js +1 -917
  83. package/dist/structures/UnavailableGuild.js.map +1 -1
  84. package/dist/structures/User.d.ts +13 -13
  85. package/dist/structures/User.js +35 -34
  86. package/dist/structures/User.js.map +1 -1
  87. package/dist/structures/Webhook.d.ts +26 -26
  88. package/dist/structures/Webhook.js +116 -148
  89. package/dist/structures/Webhook.js.map +1 -1
  90. package/dist/structures/index.d.ts +5 -1
  91. package/dist/structures/index.js +5 -1
  92. package/dist/structures/index.js.map +1 -1
  93. package/dist/types/application.d.ts +3 -3
  94. package/dist/types/auto-moderation.d.ts +3 -3
  95. package/dist/types/channel.d.ts +36 -21
  96. package/dist/types/gateway-events.d.ts +12 -12
  97. package/dist/types/guild.d.ts +5 -5
  98. package/dist/types/interaction.d.ts +57 -40
  99. package/dist/types/invite.d.ts +3 -2
  100. package/dist/types/message-components.d.ts +4 -4
  101. package/dist/types/sku.d.ts +1 -1
  102. package/dist/types/stage-instance.d.ts +3 -2
  103. package/dist/types/team.d.ts +1 -1
  104. package/dist/types/user.d.ts +3 -3
  105. package/dist/utils/Util.d.ts +11 -482
  106. package/dist/utils/Util.js +329 -151
  107. package/dist/utils/Util.js.map +1 -1
  108. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.channelPermission = exports.channelBulkDelete = exports.channelMessageAllReactions = exports.channelMessageReaction = exports.channelMessageCrosspost = exports.channelMessage = exports.channelMessages = exports.channel = exports.guildScheduledEventUsers = exports.guildScheduledEvent = exports.guildScheduledEvents = exports.guildSticker = exports.guildStickers = exports.guildWelcomeScreen = exports.guildVoiceState = exports.guildMemberVerification = exports.guildWebhooks = exports.guildActiveThreads = exports.guildTemplate = exports.guildTemplates = exports.template = exports.guildOnboarding = exports.guildWidgetImage = exports.guildVanityUrl = exports.guildWidgetJSON = exports.guildWidgetSettings = exports.guildIntegration = exports.guildIntegrations = exports.guildInvites = exports.guildVoiceRegions = exports.guildPrune = exports.guildRole = exports.guildRoles = exports.guildBan = exports.guildBans = exports.guildMFA = exports.guildMemberRole = exports.guildCurrentMemberNickname = exports.guildMembersSearch = exports.guildMembers = exports.guildMember = exports.guildChannels = exports.guildPreview = exports.guild = exports.guilds = exports.guildEmoji = exports.guildEmojis = exports.guildAuditLog = exports.guildAutoModerationRule = exports.guildAutoModerationRules = void 0;
3
+ exports.channelPermission = exports.channelBulkDelete = exports.channelMessageAllReactions = exports.channelMessageReaction = exports.channelMessageCrosspost = exports.channelMessage = exports.channelMessages = exports.channel = exports.guildScheduledEventUsers = exports.guildScheduledEvent = exports.guildScheduledEvents = exports.guildSticker = exports.guildStickers = exports.guildWelcomeScreen = exports.guildVoiceState = exports.guildMemberVerification = exports.guildWebhooks = exports.guildActiveThreads = exports.guildTemplate = exports.guildTemplates = exports.template = exports.guildOnboarding = exports.guildWidgetImage = exports.guildVanityURL = exports.guildWidgetJSON = exports.guildWidgetSettings = exports.guildIntegration = exports.guildIntegrations = exports.guildInvites = exports.guildVoiceRegions = exports.guildPrune = exports.guildRole = exports.guildRoles = exports.guildBan = exports.guildBans = exports.guildMFA = exports.guildMemberRole = exports.guildCurrentMemberNickname = exports.guildMembersSearch = exports.guildMembers = exports.guildMember = exports.guildChannels = exports.guildPreview = exports.guild = exports.guilds = exports.guildEmoji = exports.guildEmojis = exports.guildAuditLog = exports.guildAutoModerationRule = exports.guildAutoModerationRules = void 0;
4
4
  exports.stickerPacks = exports.sticker = exports.stageInstance = exports.stageInstances = exports.interactionCallback = exports.voiceRegions = exports.invite = exports.oauth2TokenRevocation = exports.oauth2TokenExchange = exports.oauth2Authorization = exports.oauth2CurrentAuthorization = exports.oauth2CurrentApplication = exports.gatewayBot = exports.gateway = exports.webhookPlatform = exports.webhookMessage = exports.webhook = exports.applicationEntitlement = exports.applicationEntitlements = exports.applicationSKUs = exports.applicationCurrentUser = exports.applicationCommandPermissions = exports.guildApplicationCommandsPermissions = exports.applicationGuildCommand = exports.applicationGuildCommands = exports.applicationCommand = exports.applicationCommands = exports.applicationRoleConnectionMetadata = exports.userConnections = exports.userChannels = exports.userGuild = exports.userGuilds = exports.userApplicationRoleConnection = exports.user = exports.channelWebhooks = exports.threadMembers = exports.channelThreads = exports.threads = exports.channelRecipient = exports.channelPin = exports.channelPins = exports.channelTyping = exports.channelFollowers = exports.channelInvites = void 0;
5
5
  // Guilds
6
6
  const guildAutoModerationRules = (guildId) => `guilds/${guildId}/auto-moderation/rules`;
@@ -55,8 +55,8 @@ const guildWidgetSettings = (guildId) => `guilds/${guildId}/widget`;
55
55
  exports.guildWidgetSettings = guildWidgetSettings;
56
56
  const guildWidgetJSON = (guildId) => `guilds/${guildId}/widget.json`;
57
57
  exports.guildWidgetJSON = guildWidgetJSON;
58
- const guildVanityUrl = (guildId) => `guilds/${guildId}/vanity-url`;
59
- exports.guildVanityUrl = guildVanityUrl;
58
+ const guildVanityURL = (guildId) => `guilds/${guildId}/vanity-url`;
59
+ exports.guildVanityURL = guildVanityURL;
60
60
  const guildWidgetImage = (guildId) => `guilds/${guildId}/widget.png`;
61
61
  exports.guildWidgetImage = guildWidgetImage;
62
62
  const guildOnboarding = (guildId) => `guilds/${guildId}/onboarding`;
@@ -24,7 +24,7 @@ class RequestsManager {
24
24
  url.searchParams.set(key, String(value));
25
25
  }
26
26
  let headers = {
27
- "User-Agent": `DiscordBot (https://github.com/XenKys/disgroove, 1.2.9)`,
27
+ "User-Agent": `DiscordBot (https://github.com/XenKys/disgroove, 1.3.0-dev.3af784e)`,
28
28
  Authorization: `${this.auth} ${this.token}`,
29
29
  };
30
30
  let body;
@@ -1 +1 @@
1
- {"version":3,"file":"RequestsManager.js","sourceRoot":"","sources":["../../src/rest/RequestsManager.ts"],"names":[],"mappings":";;;AAAA,wBAAsC;AACtC,mCAA6D;AAC7D,4CAAiD;AACjD,oCAA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AY,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;wBAE3C,MAAM,CACJ,YAAY;4BACV,OAAO,YAAY,KAAK,QAAQ;4BAChC,MAAM,IAAI,YAAY;4BACtB,SAAS,IAAI,YAAY;4BACzB,YAAY,CAAC,IAAI,KAAK,CAAC;4BACvB,CAAC,CAAC,IAAI,iBAAS,CACX,IAAI,YAAY,CAAC,IAAI,KAAK,YAAY,CAAC,OAAO,EAAE,CACjD;4BACH,CAAC,CAAC,IAAI,iBAAS,CAAC,IAAI,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,UAAU,EAAE,CAAC,CACjE,CAAC;qBACH;iBACF;qBAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,6BAAiB,CAAC,SAAS,EAAE;oBAC1D,OAAO,CAAC,IAAS,CAAC,CAAC;iBACpB;qBAAM;oBACL,OAAO,CAAC,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAM,CAAC,CAAC;iBACvC;aACF;YAAC,OAAO,GAAG,EAAE;gBACZ,MAAM,CAAC,GAAG,CAAC,CAAC;aACb;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAvHD,0CAuHC"}
@@ -1,7 +1,7 @@
1
- import { Base, User, ApplicationCommand, Team, Guild } from ".";
2
- import type { JSONInstallParams, JSONGuildApplicationCommandPermissions, RawApplication, JSONApplication, JSONApplicationCommandOptionChoice, JSONApplicationRoleConnectionMetadata, JSONSKU, JSONEntitlement } from "../types";
1
+ import { Base, User, ApplicationCommand, Team, Guild, TestEntitlement, Entitlement, SKU } from ".";
2
+ import type { JSONInstallParams, JSONGuildApplicationCommandPermissions, RawApplication, JSONApplication, JSONApplicationCommandOptionChoice, JSONApplicationRoleConnectionMetadata } from "../types";
3
3
  import type { Client } from "../Client";
4
- import type { ApplicationCommandOptionType, ApplicationCommandTypes, ChannelTypes, Locale } from "../constants";
4
+ import type { ApplicationCommandOptionType, ApplicationCommandTypes, ApplicationFlags, ChannelTypes, Locale } from "../constants";
5
5
  /** https://discord.com/developers/docs/resources/application */
6
6
  export declare class Application extends Base {
7
7
  protected raw: RawApplication;
@@ -21,7 +21,7 @@ export declare class Application extends Base {
21
21
  primarySKUId?: string;
22
22
  slug?: string;
23
23
  coverImage?: string;
24
- flags?: number;
24
+ flags?: ApplicationFlags;
25
25
  approximateGuildCount?: number;
26
26
  redirectURIs?: Array<string>;
27
27
  interactionsEndpointURL?: string;
@@ -31,24 +31,9 @@ export declare class Application extends Base {
31
31
  customInstallURL?: string;
32
32
  constructor(data: RawApplication, client: Client);
33
33
  protected patch(data: RawApplication): void;
34
- /** https://discord.com/developers/docs/resources/application#edit-current-application */
35
- edit(options: {
36
- customInstallURL?: string;
37
- description?: string;
38
- roleConnectionsVerificationURL?: string;
39
- installParams?: JSONInstallParams;
40
- flags?: number;
41
- icon?: string;
42
- coverImage?: string;
43
- interactionsEndpointURL?: string;
44
- tags?: Array<string>;
45
- }): Promise<Application>;
46
- /** https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands */
47
- getGlobalApplicationCommands(options: {
48
- withLocalizations?: boolean;
49
- }): Promise<Array<ApplicationCommand>>;
50
- /** https://discord.com/developers/docs/interactions/application-commands#create-global-application-command */
51
- createGlobalApplicationCommand(options: {
34
+ /** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands */
35
+ bulkEditGlobalApplicationCommands(commands: Array<{
36
+ id?: string;
52
37
  name: string;
53
38
  nameLocalizations?: Partial<Record<Locale, string>> | null;
54
39
  description?: string;
@@ -88,11 +73,10 @@ export declare class Application extends Base {
88
73
  defaultPermission?: boolean | null;
89
74
  type?: ApplicationCommandTypes;
90
75
  nsfw?: boolean;
91
- }): Promise<ApplicationCommand>;
92
- /** https://discord.com/developers/docs/interactions/application-commands#get-global-application-command */
93
- getGlobalApplicationCommand(commandId: string): Promise<ApplicationCommand>;
94
- /** https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command */
95
- editGlobalApplicationCommand(commandId: string, options: {
76
+ }>): Promise<Array<ApplicationCommand>>;
77
+ /** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands */
78
+ bulkEditGuildApplicationCommands(guildId: string, commands: Array<{
79
+ id?: string;
96
80
  name?: string;
97
81
  nameLocalizations?: Partial<Record<Locale, string>> | null;
98
82
  description?: string;
@@ -128,15 +112,13 @@ export declare class Application extends Base {
128
112
  autocomplete?: boolean;
129
113
  }>;
130
114
  defaultMemberPermissions?: string | null;
131
- defaultPermission?: boolean | null;
132
115
  dmPermission?: boolean;
116
+ defaultPermission?: boolean | null;
117
+ type: ApplicationCommandTypes;
133
118
  nsfw?: boolean;
134
- }): Promise<ApplicationCommand>;
135
- /** https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command */
136
- deleteGlobalApplicationCommand(commandId: string): void;
137
- /** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands */
138
- bulkOverwriteGlobalApplicationCommands(commands: Array<{
139
- id?: string;
119
+ }>): Promise<Array<ApplicationCommand>>;
120
+ /** https://discord.com/developers/docs/interactions/application-commands#create-global-application-command */
121
+ createGlobalApplicationCommand(options: {
140
122
  name: string;
141
123
  nameLocalizations?: Partial<Record<Locale, string>> | null;
142
124
  description?: string;
@@ -176,11 +158,7 @@ export declare class Application extends Base {
176
158
  defaultPermission?: boolean | null;
177
159
  type?: ApplicationCommandTypes;
178
160
  nsfw?: boolean;
179
- }>): Promise<Array<ApplicationCommand>>;
180
- /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands */
181
- getGuildApplicationCommands(guildId: string, options?: {
182
- withLocalizations?: boolean;
183
- }): Promise<Array<ApplicationCommand>>;
161
+ }): Promise<ApplicationCommand>;
184
162
  /** https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command */
185
163
  createGuildApplicationCommand(guildId: string, options: {
186
164
  name?: string;
@@ -223,10 +201,36 @@ export declare class Application extends Base {
223
201
  type?: ApplicationCommandTypes;
224
202
  nsfw?: boolean;
225
203
  }): Promise<ApplicationCommand>;
226
- /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command */
227
- getGuildApplicationCommand(guildId: string, commandId: string): Promise<ApplicationCommand>;
228
- /** https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command */
229
- editGuildApplicationCommand(guildId: string, commandId: string, options: {
204
+ /** https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement */
205
+ createTestEntitlement(options: {
206
+ skuId: string;
207
+ ownerId: string;
208
+ ownerType: number;
209
+ }): Promise<TestEntitlement>;
210
+ /** https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command */
211
+ deleteGlobalApplicationCommand(commandId: string): void;
212
+ /** https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command */
213
+ deleteGuildApplicationCommand(guildId: string, commandId: string): void;
214
+ /** https://discord.com/developers/docs/monetization/entitlements#delete-test-entitlement */
215
+ deleteTestEntitlement(entitlementId: string): void;
216
+ /** https://discord.com/developers/docs/resources/application#edit-current-application */
217
+ edit(options: {
218
+ customInstallURL?: string;
219
+ description?: string;
220
+ roleConnectionsVerificationURL?: string;
221
+ installParams?: JSONInstallParams;
222
+ flags?: ApplicationFlags;
223
+ icon?: string;
224
+ coverImage?: string;
225
+ interactionsEndpointURL?: string;
226
+ tags?: Array<string>;
227
+ }): Promise<Application>;
228
+ /** https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions */
229
+ editApplicationCommandPermissions(guildId: string, commandId: string, options: {
230
+ permissions: Array<JSONGuildApplicationCommandPermissions>;
231
+ }): Promise<JSONGuildApplicationCommandPermissions>;
232
+ /** https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command */
233
+ editGlobalApplicationCommand(commandId: string, options: {
230
234
  name?: string;
231
235
  nameLocalizations?: Partial<Record<Locale, string>> | null;
232
236
  description?: string;
@@ -266,11 +270,8 @@ export declare class Application extends Base {
266
270
  dmPermission?: boolean;
267
271
  nsfw?: boolean;
268
272
  }): Promise<ApplicationCommand>;
269
- /** https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command */
270
- deleteGuildApplicationCommand(guildId: string, commandId: string): void;
271
- /** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands */
272
- bulkOverwriteGuildApplicationCommands(guildId: string, commands: Array<{
273
- id?: string;
273
+ /** https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command */
274
+ editGuildApplicationCommand(guildId: string, commandId: string, options: {
274
275
  name?: string;
275
276
  nameLocalizations?: Partial<Record<Locale, string>> | null;
276
277
  description?: string;
@@ -306,25 +307,12 @@ export declare class Application extends Base {
306
307
  autocomplete?: boolean;
307
308
  }>;
308
309
  defaultMemberPermissions?: string | null;
309
- dmPermission?: boolean;
310
310
  defaultPermission?: boolean | null;
311
- type: ApplicationCommandTypes;
311
+ dmPermission?: boolean;
312
312
  nsfw?: boolean;
313
- }>): Promise<Array<ApplicationCommand>>;
314
- /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions */
315
- getGuildApplicationCommandPermissions(guildId: string): Promise<Array<JSONGuildApplicationCommandPermissions>>;
313
+ }): Promise<ApplicationCommand>;
316
314
  /** https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions */
317
315
  getApplicationCommandPermissions(guildId: string, commandId: string): Promise<Array<JSONGuildApplicationCommandPermissions>>;
318
- /** https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions */
319
- editApplicationCommandPermissions(guildId: string, commandId: string, options: {
320
- permissions: Array<JSONGuildApplicationCommandPermissions>;
321
- }): Promise<JSONGuildApplicationCommandPermissions>;
322
- /** https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records */
323
- getApplicationRoleConnectionMetadataRecords(): Promise<Array<JSONApplicationRoleConnectionMetadata>>;
324
- /** https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records */
325
- updateApplicationRoleConnectionMetadataRecords(): Promise<Array<JSONApplicationRoleConnectionMetadata>>;
326
- /** https://discord.com/developers/docs/monetization/skus#list-skus */
327
- getSKUs(): Promise<Array<JSONSKU>>;
328
316
  /** https://discord.com/developers/docs/monetization/entitlements#list-entitlements */
329
317
  getEntitlements(options?: {
330
318
  userId?: string;
@@ -334,15 +322,27 @@ export declare class Application extends Base {
334
322
  limit?: number;
335
323
  guildId?: string;
336
324
  excludeEnded?: boolean;
337
- }): Promise<Array<JSONEntitlement>>;
338
- /** https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement */
339
- createTestEntitlement(options: {
340
- skuId: string;
341
- ownerId: string;
342
- ownerType: number;
343
- }): Promise<Pick<JSONEntitlement, "id" | "applicationId" | "deleted" | "guildId" | "skuId" | "type" | "userId">>;
344
- /** https://discord.com/developers/docs/monetization/entitlements#delete-test-entitlement */
345
- deleteTestEntitlement(entitlementId: string): void;
325
+ }): Promise<Array<Entitlement>>;
326
+ /** https://discord.com/developers/docs/interactions/application-commands#get-global-application-command */
327
+ getGlobalApplicationCommand(commandId: string): Promise<ApplicationCommand>;
328
+ /** https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands */
329
+ getGlobalApplicationCommands(options: {
330
+ withLocalizations?: boolean;
331
+ }): Promise<Array<ApplicationCommand>>;
332
+ /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command */
333
+ getGuildApplicationCommand(guildId: string, commandId: string): Promise<ApplicationCommand>;
334
+ /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands */
335
+ getGuildApplicationCommands(guildId: string, options?: {
336
+ withLocalizations?: boolean;
337
+ }): Promise<Array<ApplicationCommand>>;
338
+ /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions */
339
+ getGuildApplicationCommandPermissions(guildId: string): Promise<Array<JSONGuildApplicationCommandPermissions>>;
340
+ /** https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records */
341
+ getApplicationRoleConnectionMetadataRecords(): Promise<Array<JSONApplicationRoleConnectionMetadata>>;
342
+ /** https://discord.com/developers/docs/monetization/skus#list-skus */
343
+ getSKUs(): Promise<Array<SKU>>;
344
+ /** https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records */
345
+ updateApplicationRoleConnectionMetadataRecords(): Promise<Array<JSONApplicationRoleConnectionMetadata>>;
346
346
  toRaw(): RawApplication;
347
347
  toJSON(): JSONApplication;
348
348
  }
@@ -79,6 +79,56 @@ class Application extends _1.Base {
79
79
  if (data.custom_install_url !== undefined)
80
80
  this.customInstallURL = data.custom_install_url;
81
81
  }
82
+ /** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands */
83
+ async bulkEditGlobalApplicationCommands(commands) {
84
+ return this.client.rest
85
+ .put(rest_1.Endpoints.applicationCommands(this.id), {
86
+ json: commands.map((command) => this.client.util.applicationCommandToRaw(command)),
87
+ })
88
+ .then((response) => response.map((data) => new _1.ApplicationCommand(data, this.client)));
89
+ }
90
+ /** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands */
91
+ async bulkEditGuildApplicationCommands(guildId, commands) {
92
+ return this.client.rest
93
+ .put(rest_1.Endpoints.applicationGuildCommands(this.id, guildId), {
94
+ json: commands.map((command) => this.client.util.applicationCommandToRaw(command)),
95
+ })
96
+ .then((response) => response.map((data) => new _1.ApplicationCommand(data, this.client)));
97
+ }
98
+ /** https://discord.com/developers/docs/interactions/application-commands#create-global-application-command */
99
+ async createGlobalApplicationCommand(options) {
100
+ return new _1.ApplicationCommand(await this.client.rest.post(rest_1.Endpoints.applicationCommands(this.id), {
101
+ json: this.client.util.applicationCommandToRaw(options),
102
+ }), this.client);
103
+ }
104
+ /** https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command */
105
+ async createGuildApplicationCommand(guildId, options) {
106
+ return new _1.ApplicationCommand(await this.client.rest.post(rest_1.Endpoints.applicationGuildCommands(this.id, guildId), {
107
+ json: this.client.util.applicationCommandToRaw(options),
108
+ }), this.client);
109
+ }
110
+ /** https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement */
111
+ async createTestEntitlement(options) {
112
+ return new _1.TestEntitlement(await this.client.rest.post(rest_1.Endpoints.applicationEntitlements(this.id), {
113
+ json: {
114
+ sku_id: options.skuId,
115
+ owner_id: options.ownerId,
116
+ owner_type: options.ownerType,
117
+ },
118
+ }), this.client);
119
+ }
120
+ /** https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command */
121
+ deleteGlobalApplicationCommand(commandId) {
122
+ this.client.rest.delete(rest_1.Endpoints.applicationCommand(this.id, commandId));
123
+ }
124
+ /** https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command */
125
+ deleteGuildApplicationCommand(guildId, commandId) {
126
+ this.client.rest.delete(rest_1.Endpoints.applicationGuildCommand(this.id, guildId, commandId));
127
+ }
128
+ /** https://discord.com/developers/docs/monetization/entitlements#delete-test-entitlement */
129
+ deleteTestEntitlement(entitlementId) {
130
+ this.client.rest.delete(rest_1.Endpoints.applicationEntitlement(this.id, entitlementId));
131
+ }
82
132
  /** https://discord.com/developers/docs/resources/application#edit-current-application */
83
133
  async edit(options) {
84
134
  return new Application(await this.client.rest.patch(rest_1.Endpoints.applicationCurrentUser(), {
@@ -95,25 +145,33 @@ class Application extends _1.Base {
95
145
  },
96
146
  }), this.client);
97
147
  }
98
- /** https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands */
99
- async getGlobalApplicationCommands(options) {
148
+ /** https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions */
149
+ async editApplicationCommandPermissions(guildId, commandId, options) {
100
150
  return this.client.rest
101
- .get(rest_1.Endpoints.applicationCommands(this.id), {
102
- query: {
103
- with_localizations: options.withLocalizations,
151
+ .put(rest_1.Endpoints.applicationCommandPermissions(this.id, guildId, commandId), {
152
+ json: {
153
+ permissions: options.permissions.map((option) => ({
154
+ id: option.id,
155
+ application_id: option.applicationId,
156
+ guild_id: option.guildId,
157
+ permissions: option.permissions.map((permission) => ({
158
+ id: permission.id,
159
+ type: permission.type,
160
+ permission: permission.permission,
161
+ })),
162
+ })),
104
163
  },
105
164
  })
106
- .then((response) => response.map((data) => new _1.ApplicationCommand(data, this.client)));
107
- }
108
- /** https://discord.com/developers/docs/interactions/application-commands#create-global-application-command */
109
- async createGlobalApplicationCommand(options) {
110
- return new _1.ApplicationCommand(await this.client.rest.post(rest_1.Endpoints.applicationCommands(this.id), {
111
- json: this.client.util.applicationCommandToRaw(options),
112
- }), this.client);
113
- }
114
- /** https://discord.com/developers/docs/interactions/application-commands#get-global-application-command */
115
- async getGlobalApplicationCommand(commandId) {
116
- return new _1.ApplicationCommand(await this.client.rest.get(rest_1.Endpoints.applicationCommand(this.id, commandId)), this.client);
165
+ .then((response) => ({
166
+ id: response.id,
167
+ applicationId: response.application_id,
168
+ guildId: response.guild_id,
169
+ permissions: response.permissions.map((permission) => ({
170
+ id: permission.id,
171
+ type: permission.type,
172
+ permission: permission.permission,
173
+ })),
174
+ }));
117
175
  }
118
176
  /** https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command */
119
177
  async editGlobalApplicationCommand(commandId, options) {
@@ -121,53 +179,68 @@ class Application extends _1.Base {
121
179
  json: this.client.util.applicationCommandToRaw(options),
122
180
  }), this.client);
123
181
  }
124
- /** https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command */
125
- deleteGlobalApplicationCommand(commandId) {
126
- this.client.rest.delete(rest_1.Endpoints.applicationCommand(this.id, commandId));
182
+ /** https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command */
183
+ async editGuildApplicationCommand(guildId, commandId, options) {
184
+ return new _1.ApplicationCommand(await this.client.rest.patch(rest_1.Endpoints.applicationGuildCommand(this.id, guildId, commandId), {
185
+ json: this.client.util.applicationCommandToRaw(options),
186
+ }), this.client);
127
187
  }
128
- /** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands */
129
- async bulkOverwriteGlobalApplicationCommands(commands) {
188
+ /** https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions */
189
+ async getApplicationCommandPermissions(guildId, commandId) {
130
190
  return this.client.rest
131
- .put(rest_1.Endpoints.applicationCommands(this.id), {
132
- json: commands.map((command) => this.client.util.applicationCommandToRaw(command)),
191
+ .get(rest_1.Endpoints.applicationCommandPermissions(this.id, guildId, commandId))
192
+ .then((response) => response.map((permissions) => ({
193
+ id: permissions.id,
194
+ applicationId: permissions.application_id,
195
+ guildId: permissions.guild_id,
196
+ permissions: permissions.permissions.map((permission) => ({
197
+ id: permission.id,
198
+ type: permission.type,
199
+ permission: permission.permission,
200
+ })),
201
+ })));
202
+ }
203
+ /** https://discord.com/developers/docs/monetization/entitlements#list-entitlements */
204
+ async getEntitlements(options) {
205
+ return this.client.rest
206
+ .get(rest_1.Endpoints.applicationEntitlements(this.id), {
207
+ query: {
208
+ user_id: options?.userId,
209
+ sku_ids: options?.skuIds,
210
+ before: options?.before,
211
+ after: options?.after,
212
+ limit: options?.limit,
213
+ guild_id: options?.guildId,
214
+ exclude_ended: options?.excludeEnded,
215
+ },
133
216
  })
134
- .then((response) => response.map((data) => new _1.ApplicationCommand(data, this.client)));
217
+ .then((response) => response.map((data) => new _1.Entitlement(data, this.client)));
135
218
  }
136
- /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands */
137
- async getGuildApplicationCommands(guildId, options) {
219
+ /** https://discord.com/developers/docs/interactions/application-commands#get-global-application-command */
220
+ async getGlobalApplicationCommand(commandId) {
221
+ return new _1.ApplicationCommand(await this.client.rest.get(rest_1.Endpoints.applicationCommand(this.id, commandId)), this.client);
222
+ }
223
+ /** https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands */
224
+ async getGlobalApplicationCommands(options) {
138
225
  return this.client.rest
139
- .get(rest_1.Endpoints.applicationGuildCommands(this.id, guildId), {
226
+ .get(rest_1.Endpoints.applicationCommands(this.id), {
140
227
  query: {
141
- with_localizations: options?.withLocalizations,
228
+ with_localizations: options.withLocalizations,
142
229
  },
143
230
  })
144
231
  .then((response) => response.map((data) => new _1.ApplicationCommand(data, this.client)));
145
232
  }
146
- /** https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command */
147
- async createGuildApplicationCommand(guildId, options) {
148
- return new _1.ApplicationCommand(await this.client.rest.post(rest_1.Endpoints.applicationGuildCommands(this.id, guildId), {
149
- json: this.client.util.applicationCommandToRaw(options),
150
- }), this.client);
151
- }
152
233
  /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command */
153
234
  async getGuildApplicationCommand(guildId, commandId) {
154
235
  return new _1.ApplicationCommand(await this.client.rest.get(rest_1.Endpoints.applicationGuildCommand(this.id, guildId, commandId)), this.client);
155
236
  }
156
- /** https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command */
157
- async editGuildApplicationCommand(guildId, commandId, options) {
158
- return new _1.ApplicationCommand(await this.client.rest.patch(rest_1.Endpoints.applicationGuildCommand(this.id, guildId, commandId), {
159
- json: this.client.util.applicationCommandToRaw(options),
160
- }), this.client);
161
- }
162
- /** https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command */
163
- deleteGuildApplicationCommand(guildId, commandId) {
164
- this.client.rest.delete(rest_1.Endpoints.applicationGuildCommand(this.id, guildId, commandId));
165
- }
166
- /** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands */
167
- async bulkOverwriteGuildApplicationCommands(guildId, commands) {
237
+ /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands */
238
+ async getGuildApplicationCommands(guildId, options) {
168
239
  return this.client.rest
169
- .put(rest_1.Endpoints.applicationGuildCommands(this.id, guildId), {
170
- json: commands.map((command) => this.client.util.applicationCommandToRaw(command)),
240
+ .get(rest_1.Endpoints.applicationGuildCommands(this.id, guildId), {
241
+ query: {
242
+ with_localizations: options?.withLocalizations,
243
+ },
171
244
  })
172
245
  .then((response) => response.map((data) => new _1.ApplicationCommand(data, this.client)));
173
246
  }
@@ -186,49 +259,6 @@ class Application extends _1.Base {
186
259
  })),
187
260
  })));
188
261
  }
189
- /** https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions */
190
- async getApplicationCommandPermissions(guildId, commandId) {
191
- return this.client.rest
192
- .get(rest_1.Endpoints.applicationCommandPermissions(this.id, guildId, commandId))
193
- .then((response) => response.map((permissions) => ({
194
- id: permissions.id,
195
- applicationId: permissions.application_id,
196
- guildId: permissions.guild_id,
197
- permissions: permissions.permissions.map((permission) => ({
198
- id: permission.id,
199
- type: permission.type,
200
- permission: permission.permission,
201
- })),
202
- })));
203
- }
204
- /** https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions */
205
- async editApplicationCommandPermissions(guildId, commandId, options) {
206
- return this.client.rest
207
- .put(rest_1.Endpoints.applicationCommandPermissions(this.id, guildId, commandId), {
208
- json: {
209
- permissions: options.permissions.map((option) => ({
210
- id: option.id,
211
- application_id: option.applicationId,
212
- guild_id: option.guildId,
213
- permissions: option.permissions.map((permission) => ({
214
- id: permission.id,
215
- type: permission.type,
216
- permission: permission.permission,
217
- })),
218
- })),
219
- },
220
- })
221
- .then((response) => ({
222
- id: response.id,
223
- applicationId: response.application_id,
224
- guildId: response.guild_id,
225
- permissions: response.permissions.map((permission) => ({
226
- id: permission.id,
227
- type: permission.type,
228
- permission: permission.permission,
229
- })),
230
- }));
231
- }
232
262
  /** https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records */
233
263
  async getApplicationRoleConnectionMetadataRecords() {
234
264
  return this.client.rest
@@ -242,6 +272,12 @@ class Application extends _1.Base {
242
272
  descriptionLocalizations: data.description_localizations,
243
273
  })));
244
274
  }
275
+ /** https://discord.com/developers/docs/monetization/skus#list-skus */
276
+ async getSKUs() {
277
+ return this.client.rest
278
+ .get(rest_1.Endpoints.applicationSKUs(this.id))
279
+ .then((response) => response.map((data) => new _1.SKU(data, this.client)));
280
+ }
245
281
  /** https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records */
246
282
  async updateApplicationRoleConnectionMetadataRecords() {
247
283
  return this.client.rest
@@ -255,75 +291,12 @@ class Application extends _1.Base {
255
291
  descriptionLocalizations: data.description_localizations,
256
292
  })));
257
293
  }
258
- /** https://discord.com/developers/docs/monetization/skus#list-skus */
259
- async getSKUs() {
260
- return this.client.rest
261
- .get(rest_1.Endpoints.applicationSKUs(this.id))
262
- .then((response) => response.map((data) => ({
263
- id: data.id,
264
- type: data.type,
265
- applicationId: data.application_id,
266
- name: data.name,
267
- slug: data.slug,
268
- flags: data.flags,
269
- })));
270
- }
271
- /** https://discord.com/developers/docs/monetization/entitlements#list-entitlements */
272
- async getEntitlements(options) {
273
- return this.client.rest
274
- .get(rest_1.Endpoints.applicationEntitlements(this.id), {
275
- query: {
276
- user_id: options?.userId,
277
- sku_ids: options?.skuIds,
278
- before: options?.before,
279
- after: options?.after,
280
- limit: options?.limit,
281
- guild_id: options?.guildId,
282
- exclude_ended: options?.excludeEnded,
283
- },
284
- })
285
- .then((response) => response.map((data) => ({
286
- id: data.id,
287
- applicationId: data.application_id,
288
- deleted: data.deleted,
289
- guildId: data.guild_id,
290
- skuId: data.sku_id,
291
- type: data.type,
292
- userId: data.user_id,
293
- startsAt: data.starts_at,
294
- endsAt: data.ends_at,
295
- })));
296
- }
297
- /** https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement */
298
- async createTestEntitlement(options) {
299
- return this.client.rest
300
- .post(rest_1.Endpoints.applicationEntitlements(this.id), {
301
- json: {
302
- sku_id: options.skuId,
303
- owner_id: options.ownerId,
304
- owner_type: options.ownerType,
305
- },
306
- })
307
- .then((response) => ({
308
- id: response.id,
309
- applicationId: response.application_id,
310
- deleted: response.deleted,
311
- guildId: response.guild_id,
312
- skuId: response.sku_id,
313
- type: response.type,
314
- userId: response.user_id,
315
- }));
316
- }
317
- /** https://discord.com/developers/docs/monetization/entitlements#delete-test-entitlement */
318
- deleteTestEntitlement(entitlementId) {
319
- this.client.rest.delete(rest_1.Endpoints.applicationEntitlement(this.id, entitlementId));
320
- }
321
294
  toRaw() {
322
295
  return this.raw;
323
296
  }
324
297
  toJSON() {
325
298
  return {
326
- id: this.id,
299
+ ...super.toJSON(),
327
300
  name: this.name,
328
301
  icon: this.icon,
329
302
  description: this.description,