discord.js 15.0.0-dev.1742688832-73f2ef9c8 → 15.0.0-dev.1743249921-646ecae47

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.1742688832-73f2ef9c8",
4
+ "version": "15.0.0-dev.1743249921-646ecae47",
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",
@@ -60,10 +60,10 @@
60
60
  "tslib": "^2.8.1",
61
61
  "undici": "6.21.1",
62
62
  "@discordjs/builders": "^1.9.0",
63
+ "@discordjs/collection": "^2.1.1",
63
64
  "@discordjs/formatters": "^0.5.0",
64
- "@discordjs/rest": "^2.4.0",
65
65
  "@discordjs/util": "^1.1.1",
66
- "@discordjs/collection": "^2.1.1",
66
+ "@discordjs/rest": "^2.4.0",
67
67
  "@discordjs/ws": "^2.0.0"
68
68
  },
69
69
  "devDependencies": {
@@ -82,8 +82,8 @@
82
82
  "turbo": "^2.3.3",
83
83
  "typescript": "~5.5.4",
84
84
  "@discordjs/api-extractor": "^7.38.1",
85
- "@discordjs/scripts": "^0.1.0",
86
- "@discordjs/docgen": "^0.12.1"
85
+ "@discordjs/docgen": "^0.12.1",
86
+ "@discordjs/scripts": "^0.1.0"
87
87
  },
88
88
  "engines": {
89
89
  "node": ">=22.12.0"
@@ -788,6 +788,7 @@ class Message extends Base {
788
788
  return Boolean(
789
789
  channel?.type === ChannelType.GuildAnnouncement &&
790
790
  !this.flags.has(MessageFlags.Crossposted) &&
791
+ this.reference?.type !== MessageReferenceType.Forward &&
791
792
  this.type === MessageType.Default &&
792
793
  !this.poll &&
793
794
  channel.viewable &&
@@ -43,10 +43,27 @@ class Poll extends Base {
43
43
 
44
44
  Object.defineProperty(this, 'message', { value: message });
45
45
 
46
+ /**
47
+ * The answers of this poll
48
+ * @type {Collection<number, PollAnswer|PartialPollAnswer>}
49
+ */
50
+ this.answers = new Collection();
51
+
46
52
  this._patch(data);
47
53
  }
48
54
 
49
55
  _patch(data) {
56
+ if (data.answers) {
57
+ for (const answer of data.answers) {
58
+ const existing = this.answers.get(answer.answer_id);
59
+ if (existing) {
60
+ existing._patch(answer);
61
+ } else {
62
+ this.answers.set(answer.answer_id, new PollAnswer(this.client, answer, this));
63
+ }
64
+ }
65
+ }
66
+
50
67
  if (data.results) {
51
68
  /**
52
69
  * Whether this poll's results have been precisely counted
@@ -111,23 +128,6 @@ class Poll extends Base {
111
128
  text: null,
112
129
  };
113
130
  }
114
-
115
- /**
116
- * The answers of this poll
117
- * @type {Collection<number, PollAnswer|PartialPollAnswer>}
118
- */
119
- this.answers ??= new Collection();
120
-
121
- if (data.answers) {
122
- for (const answer of data.answers) {
123
- const existing = this.answers.get(answer.answer_id);
124
- if (existing) {
125
- existing._patch(answer);
126
- } else {
127
- this.answers.set(answer.answer_id, new PollAnswer(this.client, answer, this));
128
- }
129
- }
130
- }
131
131
  }
132
132
 
133
133
  /**
@@ -39,7 +39,7 @@ class PollAnswer extends Base {
39
39
  * @type {?APIPartialEmoji}
40
40
  * @private
41
41
  */
42
- Object.defineProperty(this, '_emoji', { value: null });
42
+ Object.defineProperty(this, '_emoji', { value: null, writable: true });
43
43
 
44
44
  this._patch(data);
45
45
  }
@@ -63,7 +63,7 @@ class PollAnswer extends Base {
63
63
  this.text ??= data.poll_media?.text ?? null;
64
64
 
65
65
  if (data.poll_media?.emoji) {
66
- Object.defineProperty(this, '_emoji', { value: data.poll_media.emoji });
66
+ this._emoji = data.poll_media.emoji;
67
67
  }
68
68
  }
69
69