discord.js 15.0.0-dev.1761523318-4c0d66777 → 15.0.0-dev.1761868919-178c9cb34

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.1761523318-4c0d66777",
4
+ "version": "15.0.0-dev.1761868919-178c9cb34",
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,12 +61,12 @@
61
61
  "magic-bytes.js": "^1.12.1",
62
62
  "tslib": "^2.8.1",
63
63
  "undici": "7.16.0",
64
- "@discordjs/builders": "^2.0.0-dev.1761523318-4c0d66777",
65
- "@discordjs/collection": "^3.0.0-dev.1761523318-4c0d66777",
66
- "@discordjs/formatters": "^1.0.0-dev.1761523318-4c0d66777",
67
- "@discordjs/rest": "^3.0.0-dev.1761523318-4c0d66777",
68
- "@discordjs/ws": "^3.0.0-dev.1761523318-4c0d66777",
69
- "@discordjs/util": "^2.0.0-dev.1761523318-4c0d66777"
64
+ "@discordjs/builders": "^2.0.0-dev.1761868919-178c9cb34",
65
+ "@discordjs/formatters": "^1.0.0-dev.1761868919-178c9cb34",
66
+ "@discordjs/rest": "^3.0.0-dev.1761868919-178c9cb34",
67
+ "@discordjs/collection": "^3.0.0-dev.1761868919-178c9cb34",
68
+ "@discordjs/ws": "^3.0.0-dev.1761868919-178c9cb34",
69
+ "@discordjs/util": "^2.0.0-dev.1761868919-178c9cb34"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@favware/cliff-jumper": "^4.1.0",
@@ -82,9 +82,9 @@
82
82
  "tsd": "^0.33.0",
83
83
  "turbo": "^2.5.8",
84
84
  "typescript": "~5.9.3",
85
- "@discordjs/scripts": "^0.1.0",
86
85
  "@discordjs/api-extractor": "^7.52.7",
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": ">=22.12.0"
@@ -24,13 +24,6 @@ class GuildMember extends Base {
24
24
  */
25
25
  this.guild = guild;
26
26
 
27
- /**
28
- * The timestamp the member joined the guild at
29
- *
30
- * @type {?number}
31
- */
32
- this.joinedTimestamp = null;
33
-
34
27
  /**
35
28
  * The last timestamp this member started boosting the guild
36
29
  *
@@ -104,7 +97,17 @@ class GuildMember extends Base {
104
97
  this.banner ??= null;
105
98
  }
106
99
 
107
- if ('joined_at' in data) this.joinedTimestamp = Date.parse(data.joined_at);
100
+ if ('joined_at' in data) {
101
+ /**
102
+ * The timestamp the member joined the guild at
103
+ *
104
+ * @type {?number}
105
+ */
106
+ this.joinedTimestamp = data.joined_at && Date.parse(data.joined_at);
107
+ } else {
108
+ this.joinedTimestamp ??= null;
109
+ }
110
+
108
111
  if ('premium_since' in data) {
109
112
  this.premiumSinceTimestamp = data.premium_since ? Date.parse(data.premium_since) : null;
110
113
  }
@@ -799,12 +799,15 @@ class Message extends Base {
799
799
  */
800
800
  get pinnable() {
801
801
  const { channel } = this;
802
- return Boolean(
803
- !this.system &&
804
- (!this.guild ||
805
- (channel?.viewable &&
806
- channel?.permissionsFor(this.client.user)?.has(PermissionFlagsBits.ManageMessages, false))),
807
- );
802
+
803
+ if (this.system) return false;
804
+ if (!this.guild) return true;
805
+ if (!channel || channel.isVoiceBased() || !channel.viewable) return false;
806
+
807
+ const permissions = channel.permissionsFor(this.client.user);
808
+ if (!permissions) return false;
809
+
810
+ return permissions.has(PermissionFlagsBits.ReadMessageHistory | PermissionFlagsBits.PinMessages);
808
811
  }
809
812
 
810
813
  /**