discord.js 15.0.0-dev.1733745923-310563ba0 → 15.0.0-dev.1733789592-5d00332b8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "discord.js",
4
- "version": "15.0.0-dev.1733745923-310563ba0",
4
+ "version": "15.0.0-dev.1733789592-5d00332b8",
5
5
  "description": "A powerful library for interacting with the Discord API",
6
6
  "main": "./src/index.js",
7
7
  "types": "./typings/index.d.ts",
@@ -61,9 +61,9 @@
61
61
  "tslib": "^2.8.1",
62
62
  "undici": "6.21.0",
63
63
  "@discordjs/formatters": "^0.5.0",
64
- "@discordjs/util": "^1.1.1",
64
+ "@discordjs/rest": "^2.4.0",
65
65
  "@discordjs/ws": "^2.0.0",
66
- "@discordjs/rest": "^2.4.0"
66
+ "@discordjs/util": "^1.1.1"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@favware/cliff-jumper": "^4.1.0",
@@ -258,7 +258,6 @@ class ApplicationCommandManager extends CachedManager {
258
258
  type: command.type,
259
259
  options: command.options?.map(option => ApplicationCommand.transformOption(option)),
260
260
  default_member_permissions,
261
- dm_permission: command.dmPermission ?? command.dm_permission,
262
261
  integration_types: command.integrationTypes ?? command.integration_types,
263
262
  contexts: command.contexts,
264
263
  };
@@ -140,18 +140,6 @@ class ApplicationCommand extends Base {
140
140
  this.defaultMemberPermissions ??= null;
141
141
  }
142
142
 
143
- if ('dm_permission' in data) {
144
- /**
145
- * Whether the command can be used in DMs
146
- * <info>This property is always `null` on guild commands</info>
147
- * @type {?boolean}
148
- * @deprecated Use {@link ApplicationCommand#contexts} instead.
149
- */
150
- this.dmPermission = data.dm_permission;
151
- } else {
152
- this.dmPermission ??= null;
153
- }
154
-
155
143
  if ('integration_types' in data) {
156
144
  /**
157
145
  * Installation context(s) where the command is available
@@ -224,7 +212,6 @@ class ApplicationCommand extends Base {
224
212
  * @property {ApplicationCommandOptionData[]} [options] Options for the command
225
213
  * @property {?PermissionResolvable} [defaultMemberPermissions] The bitfield used to determine the default permissions
226
214
  * a member needs in order to run the command
227
- * @property {boolean} [dmPermission] Whether the command is enabled in DMs
228
215
  */
229
216
 
230
217
  /**
@@ -341,15 +328,6 @@ class ApplicationCommand extends Base {
341
328
  return this.edit({ defaultMemberPermissions });
342
329
  }
343
330
 
344
- /**
345
- * Edits the DM permission of this ApplicationCommand
346
- * @param {boolean} [dmPermission=true] Whether the command can be used in DMs
347
- * @returns {Promise<ApplicationCommand>}
348
- */
349
- setDMPermission(dmPermission = true) {
350
- return this.edit({ dmPermission });
351
- }
352
-
353
331
  /**
354
332
  * Edits the options of this ApplicationCommand
355
333
  * @param {ApplicationCommandOptionData[]} options The options to set for this command
@@ -386,7 +364,6 @@ class ApplicationCommand extends Base {
386
364
  if (command.id && this.id !== command.id) return false;
387
365
 
388
366
  let defaultMemberPermissions = null;
389
- let dmPermission = command.dmPermission ?? command.dm_permission;
390
367
 
391
368
  if ('default_member_permissions' in command) {
392
369
  defaultMemberPermissions = command.default_member_permissions
@@ -412,7 +389,6 @@ class ApplicationCommand extends Base {
412
389
  // TODO: remove ?? 0 on each when nullable
413
390
  (command.options?.length ?? 0) !== (this.options?.length ?? 0) ||
414
391
  defaultMemberPermissions !== (this.defaultMemberPermissions?.bitfield ?? null) ||
415
- (dmPermission !== undefined && dmPermission !== this.dmPermission) ||
416
392
  !isEqual(command.nameLocalizations ?? command.name_localizations ?? {}, this.nameLocalizations ?? {}) ||
417
393
  !isEqual(
418
394
  command.descriptionLocalizations ?? command.description_localizations ?? {},
@@ -413,33 +413,6 @@ class Message extends Base {
413
413
  this.interactionMetadata ??= null;
414
414
  }
415
415
 
416
- /**
417
- * Partial data of the interaction that a message is a reply to
418
- * @typedef {Object} MessageInteraction
419
- * @property {Snowflake} id The interaction's id
420
- * @property {InteractionType} type The type of the interaction
421
- * @property {string} commandName The name of the interaction's application command,
422
- * as well as the subcommand and subcommand group, where applicable
423
- * @property {User} user The user that invoked the interaction
424
- * @deprecated Use {@link Message#interactionMetadata} instead.
425
- */
426
-
427
- if (data.interaction) {
428
- /**
429
- * Partial data of the interaction that this message is a reply to
430
- * @type {?MessageInteraction}
431
- * @deprecated Use {@link Message#interactionMetadata} instead.
432
- */
433
- this.interaction = {
434
- id: data.interaction.id,
435
- type: data.interaction.type,
436
- commandName: data.interaction.name,
437
- user: this.client.users._add(data.interaction.user),
438
- };
439
- } else {
440
- this.interaction ??= null;
441
- }
442
-
443
416
  if (data.poll) {
444
417
  /**
445
418
  * The poll that was sent with the message
@@ -429,8 +429,6 @@ export class ApplicationCommand<PermissionsFetchType = {}> extends Base {
429
429
  public description: string;
430
430
  public descriptionLocalizations: LocalizationMap | null;
431
431
  public descriptionLocalized: string | null;
432
- /** @deprecated Use {@link ApplicationCommand.contexts} instead */
433
- public dmPermission: boolean | null;
434
432
  public guild: Guild | null;
435
433
  public guildId: Snowflake | null;
436
434
  public get manager(): ApplicationCommandManager;
@@ -460,7 +458,6 @@ export class ApplicationCommand<PermissionsFetchType = {}> extends Base {
460
458
  public setDefaultMemberPermissions(
461
459
  defaultMemberPermissions: PermissionResolvable | null,
462
460
  ): Promise<ApplicationCommand<PermissionsFetchType>>;
463
- public setDMPermission(dmPermission?: boolean): Promise<ApplicationCommand<PermissionsFetchType>>;
464
461
  public setOptions(
465
462
  options: readonly ApplicationCommandOptionData[],
466
463
  ): Promise<ApplicationCommand<PermissionsFetchType>>;
@@ -2207,8 +2204,6 @@ export class Message<InGuild extends boolean = boolean> extends Base {
2207
2204
  public get guild(): If<InGuild, Guild>;
2208
2205
  public get hasThread(): boolean;
2209
2206
  public id: Snowflake;
2210
- /** @deprecated Use {@link Message.interactionMetadata} instead. */
2211
- public interaction: MessageInteraction | null;
2212
2207
  public interactionMetadata: MessageInteractionMetadata | null;
2213
2208
  public get member(): GuildMember | null;
2214
2209
  public mentions: MessageMentions<InGuild>;
@@ -4694,7 +4689,6 @@ export type AllowedThreadTypeForTextChannel = ChannelType.PublicThread | Channel
4694
4689
  export interface BaseApplicationCommandData {
4695
4690
  name: string;
4696
4691
  nameLocalizations?: LocalizationMap;
4697
- dmPermission?: boolean;
4698
4692
  defaultMemberPermissions?: PermissionResolvable | null;
4699
4693
  nsfw?: boolean;
4700
4694
  contexts?: readonly InteractionContextType[];
@@ -6338,14 +6332,6 @@ export interface MessageInteractionMetadata {
6338
6332
  triggeringInteractionMetadata: MessageInteractionMetadata | null;
6339
6333
  }
6340
6334
 
6341
- /** @deprecated Use {@link MessageInteractionMetadata} instead. */
6342
- export interface MessageInteraction {
6343
- id: Snowflake;
6344
- type: InteractionType;
6345
- commandName: string;
6346
- user: User;
6347
- }
6348
-
6349
6335
  export interface MessageMentionsHasOptions {
6350
6336
  ignoreDirect?: boolean;
6351
6337
  ignoreRoles?: boolean;
@@ -429,8 +429,6 @@ export class ApplicationCommand<PermissionsFetchType = {}> extends Base {
429
429
  public description: string;
430
430
  public descriptionLocalizations: LocalizationMap | null;
431
431
  public descriptionLocalized: string | null;
432
- /** @deprecated Use {@link ApplicationCommand.contexts} instead */
433
- public dmPermission: boolean | null;
434
432
  public guild: Guild | null;
435
433
  public guildId: Snowflake | null;
436
434
  public get manager(): ApplicationCommandManager;
@@ -460,7 +458,6 @@ export class ApplicationCommand<PermissionsFetchType = {}> extends Base {
460
458
  public setDefaultMemberPermissions(
461
459
  defaultMemberPermissions: PermissionResolvable | null,
462
460
  ): Promise<ApplicationCommand<PermissionsFetchType>>;
463
- public setDMPermission(dmPermission?: boolean): Promise<ApplicationCommand<PermissionsFetchType>>;
464
461
  public setOptions(
465
462
  options: readonly ApplicationCommandOptionData[],
466
463
  ): Promise<ApplicationCommand<PermissionsFetchType>>;
@@ -2207,8 +2204,6 @@ export class Message<InGuild extends boolean = boolean> extends Base {
2207
2204
  public get guild(): If<InGuild, Guild>;
2208
2205
  public get hasThread(): boolean;
2209
2206
  public id: Snowflake;
2210
- /** @deprecated Use {@link Message.interactionMetadata} instead. */
2211
- public interaction: MessageInteraction | null;
2212
2207
  public interactionMetadata: MessageInteractionMetadata | null;
2213
2208
  public get member(): GuildMember | null;
2214
2209
  public mentions: MessageMentions<InGuild>;
@@ -4694,7 +4689,6 @@ export type AllowedThreadTypeForTextChannel = ChannelType.PublicThread | Channel
4694
4689
  export interface BaseApplicationCommandData {
4695
4690
  name: string;
4696
4691
  nameLocalizations?: LocalizationMap;
4697
- dmPermission?: boolean;
4698
4692
  defaultMemberPermissions?: PermissionResolvable | null;
4699
4693
  nsfw?: boolean;
4700
4694
  contexts?: readonly InteractionContextType[];
@@ -6338,14 +6332,6 @@ export interface MessageInteractionMetadata {
6338
6332
  triggeringInteractionMetadata: MessageInteractionMetadata | null;
6339
6333
  }
6340
6334
 
6341
- /** @deprecated Use {@link MessageInteractionMetadata} instead. */
6342
- export interface MessageInteraction {
6343
- id: Snowflake;
6344
- type: InteractionType;
6345
- commandName: string;
6346
- user: User;
6347
- }
6348
-
6349
6335
  export interface MessageMentionsHasOptions {
6350
6336
  ignoreDirect?: boolean;
6351
6337
  ignoreRoles?: boolean;
@@ -705,7 +705,6 @@ client.on('clientReady', async client => {
705
705
  await client.application?.commands.edit(globalCommandId, { defaultMemberPermissions: null });
706
706
  await globalCommand?.edit({ defaultMemberPermissions: null });
707
707
  await globalCommand?.setDefaultMemberPermissions(null);
708
- await guildCommandFromGlobal?.edit({ dmPermission: false });
709
708
 
710
709
  // @ts-expect-error
711
710
  await client.guilds.cache.get(testGuildId)?.commands.fetch(guildCommandId, { guildId: testGuildId });