discord.js 15.0.0-dev.1736899921-1fd587c93 → 15.0.0-dev.1736942697-6a42c5f92

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.1736899921-1fd587c93",
4
+ "version": "15.0.0-dev.1736942697-6a42c5f92",
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.0",
62
62
  "@discordjs/collection": "^2.1.1",
63
- "@discordjs/rest": "^2.4.0",
63
+ "@discordjs/formatters": "^0.5.0",
64
64
  "@discordjs/ws": "^2.0.0",
65
- "@discordjs/util": "^1.1.1",
66
- "@discordjs/formatters": "^0.5.0"
65
+ "@discordjs/rest": "^2.4.0",
66
+ "@discordjs/util": "^1.1.1"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@favware/cliff-jumper": "^4.1.0",
@@ -1,6 +1,8 @@
1
1
  'use strict';
2
2
 
3
+ const { Routes } = require('discord-api-types/v10');
3
4
  const MessageManager = require('./MessageManager');
5
+ const { DiscordjsTypeError, ErrorCodes } = require('../errors');
4
6
 
5
7
  /**
6
8
  * Manages API methods for messages in a guild and holds their cache.
@@ -12,6 +14,19 @@ class GuildMessageManager extends MessageManager {
12
14
  * @name GuildMessageManager#channel
13
15
  * @type {GuildTextBasedChannel}
14
16
  */
17
+
18
+ /**
19
+ * Publishes a message in an announcement channel to all channels following it, even if it's not cached.
20
+ * @param {MessageResolvable} message The message to publish
21
+ * @returns {Promise<Message>}
22
+ */
23
+ async crosspost(message) {
24
+ const messageId = this.resolveId(message);
25
+ if (!messageId) throw new DiscordjsTypeError(ErrorCodes.InvalidType, 'message', 'MessageResolvable');
26
+
27
+ const data = await this.client.rest.post(Routes.channelMessageCrosspost(this.channel.id, messageId));
28
+ return this.cache.get(data.id) ?? this._add(data);
29
+ }
15
30
  }
16
31
 
17
32
  module.exports = GuildMessageManager;
@@ -196,19 +196,6 @@ class MessageManager extends CachedManager {
196
196
  return this._add(d);
197
197
  }
198
198
 
199
- /**
200
- * Publishes a message in an announcement channel to all channels following it, even if it's not cached.
201
- * @param {MessageResolvable} message The message to publish
202
- * @returns {Promise<Message>}
203
- */
204
- async crosspost(message) {
205
- message = this.resolveId(message);
206
- if (!message) throw new DiscordjsTypeError(ErrorCodes.InvalidType, 'message', 'MessageResolvable');
207
-
208
- const data = await this.client.rest.post(Routes.channelMessageCrosspost(this.channel.id, message));
209
- return this.cache.get(data.id) ?? this._add(data);
210
- }
211
-
212
199
  /**
213
200
  * Pins a message to the channel's pinned messages, even if it's not cached.
214
201
  * @param {MessageResolvable} message The message to pin