discord.js 14.24.0 → 14.24.1

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": "14.24.0",
4
+ "version": "14.24.1",
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",
@@ -83,8 +83,8 @@
83
83
  "turbo": "^2.0.14",
84
84
  "typescript": "~5.5.4",
85
85
  "@discordjs/api-extractor": "^7.38.1",
86
- "@discordjs/scripts": "^0.1.0",
87
- "@discordjs/docgen": "^0.12.1"
86
+ "@discordjs/docgen": "^0.12.1",
87
+ "@discordjs/scripts": "^0.1.0"
88
88
  },
89
89
  "engines": {
90
90
  "node": ">=18"
@@ -781,17 +781,16 @@ class Message extends Base {
781
781
  */
782
782
  get pinnable() {
783
783
  const { channel } = this;
784
-
785
784
  if (this.system) return false;
786
785
  if (!this.guild) return true;
787
- if (!channel?.viewable) return false;
786
+ if (!channel || channel.isVoiceBased() || !channel.viewable) return false;
788
787
 
789
788
  const permissions = channel?.permissionsFor(this.client.user);
790
789
  if (!permissions) return false;
791
790
 
792
791
  return (
793
- permissions.has([PermissionFlagsBits.ReadMessageHistory, PermissionFlagsBits.PinMessages]) ||
794
- permissions.has([PermissionFlagsBits.ReadMessageHistory, PermissionFlagsBits.ManageMessages])
792
+ permissions.has(PermissionFlagsBits.ReadMessageHistory | PermissionFlagsBits.PinMessages) ||
793
+ permissions.has(PermissionFlagsBits.ReadMessageHistory | PermissionFlagsBits.ManageMessages)
795
794
  );
796
795
  }
797
796
 
@@ -20,8 +20,8 @@ const getAttachment = lazy(() => require('./Attachment'));
20
20
  /**
21
21
  * @typedef {BaseModalData} FileUploadModalData
22
22
  * @property {string} customId The custom id of the file upload
23
- * @property {string[]} values The values of the file upload
24
- * @property {Collection<string, Attachment>} [attachments] The resolved attachments
23
+ * @property {Snowflake[]} values The values of the file upload
24
+ * @property {Collection<Snowflake, Attachment>} [attachments] The resolved attachments
25
25
  */
26
26
 
27
27
  /**
@@ -34,10 +34,10 @@ const getAttachment = lazy(() => require('./Attachment'));
34
34
  * @typedef {BaseModalData} SelectMenuModalData
35
35
  * @property {string} customId The custom id of the field
36
36
  * @property {string[]} values The values of the field
37
- * @property {Collection<string, GuildMember|APIGuildMember>} [members] The resolved members
38
- * @property {Collection<string, User|APIUser>} [users] The resolved users
39
- * @property {Collection<string, Role|APIRole>} [roles] The resolved roles
40
- * @property {Collection<string, BaseChannel|APIChannel>} [channels] The resolved channels
37
+ * @property {Collection<Snowflake, GuildMember|APIGuildMember>} [members] The resolved members
38
+ * @property {Collection<Snowflake, User|APIUser>} [users] The resolved users
39
+ * @property {Collection<Snowflake, Role|APIRole>} [roles] The resolved roles
40
+ * @property {Collection<Snowflake, BaseChannel|APIChannel>} [channels] The resolved channels
41
41
  */
42
42
 
43
43
  /**
@@ -9,7 +9,8 @@ const BitField = require('./BitField');
9
9
  */
10
10
  class GuildMemberFlagsBitField extends BitField {
11
11
  /**
12
- * Numeric guild guild member flags.
12
+ * Numeric guild member flags.
13
+ *
13
14
  * @type {GuildMemberFlags}
14
15
  * @memberof GuildMemberFlagsBitField
15
16
  */
@@ -2826,13 +2826,14 @@ export interface SelectMenuModalData<Cached extends CacheType = CacheType>
2826
2826
 
2827
2827
  export interface FileUploadModalData extends BaseModalData<ComponentType.FileUpload> {
2828
2828
  customId: string;
2829
- files: readonly Attachment[];
2829
+ values: readonly Snowflake[];
2830
+ attachments: ReadonlyCollection<Snowflake, Attachment>;
2830
2831
  }
2831
2832
 
2832
2833
  export type ModalData = FileUploadModalData | SelectMenuModalData | TextInputModalData;
2833
2834
 
2834
2835
  export interface LabelModalData extends BaseModalData<ComponentType.Label> {
2835
- component: readonly ModalData[];
2836
+ component: ModalData;
2836
2837
  }
2837
2838
  export interface ActionRowModalData extends BaseModalData<ComponentType.ActionRow> {
2838
2839
  components: readonly TextInputModalData[];
@@ -7442,7 +7443,7 @@ export interface FileUploadComponentData extends BaseComponentData {
7442
7443
  customId: string;
7443
7444
  maxValues?: number;
7444
7445
  minValues?: number;
7445
- required?: number;
7446
+ required?: boolean;
7446
7447
  type: ComponentType.FileUpload;
7447
7448
  }
7448
7449
 
@@ -2826,13 +2826,14 @@ export interface SelectMenuModalData<Cached extends CacheType = CacheType>
2826
2826
 
2827
2827
  export interface FileUploadModalData extends BaseModalData<ComponentType.FileUpload> {
2828
2828
  customId: string;
2829
- files: readonly Attachment[];
2829
+ values: readonly Snowflake[];
2830
+ attachments: ReadonlyCollection<Snowflake, Attachment>;
2830
2831
  }
2831
2832
 
2832
2833
  export type ModalData = FileUploadModalData | SelectMenuModalData | TextInputModalData;
2833
2834
 
2834
2835
  export interface LabelModalData extends BaseModalData<ComponentType.Label> {
2835
- component: readonly ModalData[];
2836
+ component: ModalData;
2836
2837
  }
2837
2838
  export interface ActionRowModalData extends BaseModalData<ComponentType.ActionRow> {
2838
2839
  components: readonly TextInputModalData[];
@@ -7442,7 +7443,7 @@ export interface FileUploadComponentData extends BaseComponentData {
7442
7443
  customId: string;
7443
7444
  maxValues?: number;
7444
7445
  minValues?: number;
7445
- required?: number;
7446
+ required?: boolean;
7446
7447
  type: ComponentType.FileUpload;
7447
7448
  }
7448
7449