discord.js 15.0.0-dev.1733184845-bd7a99571 → 15.0.0-dev.1733400322-abf4b6103

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/README.md CHANGED
@@ -83,14 +83,15 @@ try {
83
83
  Afterwards we can create a quite simple example bot:
84
84
 
85
85
  ```js
86
- import { Client, GatewayIntentBits } from 'discord.js';
86
+ import { Client, Events, GatewayIntentBits } from 'discord.js';
87
+
87
88
  const client = new Client({ intents: [GatewayIntentBits.Guilds] });
88
89
 
89
- client.on('ready', () => {
90
- console.log(`Logged in as ${client.user.tag}!`);
90
+ client.on(Events.ClientReady, readyClient => {
91
+ console.log(`Logged in as ${readyClient.user.tag}!`);
91
92
  });
92
93
 
93
- client.on('interactionCreate', async interaction => {
94
+ client.on(Events.InteractionCreate, async interaction => {
94
95
  if (!interaction.isChatInputCommand()) return;
95
96
 
96
97
  if (interaction.commandName === 'ping') {
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.1733184845-bd7a99571",
4
+ "version": "15.0.0-dev.1733400322-abf4b6103",
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,8 +61,8 @@
61
61
  "tslib": "^2.8.1",
62
62
  "undici": "6.21.0",
63
63
  "@discordjs/formatters": "^0.5.0",
64
- "@discordjs/ws": "^2.0.0",
65
64
  "@discordjs/rest": "^2.4.0",
65
+ "@discordjs/ws": "^2.0.0",
66
66
  "@discordjs/util": "^1.1.1"
67
67
  },
68
68
  "devDependencies": {
@@ -80,8 +80,8 @@
80
80
  "tslint": "6.1.3",
81
81
  "turbo": "^2.3.0",
82
82
  "typescript": "~5.5.4",
83
- "@discordjs/api-extractor": "^7.38.1",
84
83
  "@discordjs/docgen": "^0.12.1",
84
+ "@discordjs/api-extractor": "^7.38.1",
85
85
  "@discordjs/scripts": "^0.1.0"
86
86
  },
87
87
  "engines": {
@@ -5,7 +5,7 @@ const { ChannelFlags, ChannelType, PermissionFlagsBits, Routes } = require('disc
5
5
  const { BaseChannel } = require('./BaseChannel');
6
6
  const getThreadOnlyChannel = lazy(() => require('./ThreadOnlyChannel'));
7
7
  const TextBasedChannel = require('./interfaces/TextBasedChannel');
8
- const { DiscordjsError, DiscordjsRangeError, ErrorCodes } = require('../errors');
8
+ const { DiscordjsRangeError, ErrorCodes } = require('../errors');
9
9
  const GuildMessageManager = require('../managers/GuildMessageManager');
10
10
  const ThreadMemberManager = require('../managers/ThreadMemberManager');
11
11
  const ChannelFlagsBitField = require('../util/ChannelFlagsBitField');
@@ -31,6 +31,12 @@ class ThreadChannel extends BaseChannel {
31
31
  */
32
32
  this.guildId = guild?.id ?? data.guild_id;
33
33
 
34
+ /**
35
+ * The id of the member who created this thread
36
+ * @type {Snowflake}
37
+ */
38
+ this.ownerId = data.owner_id;
39
+
34
40
  /**
35
41
  * A manager of the messages sent to this thread
36
42
  * @type {GuildMessageManager}
@@ -121,16 +127,6 @@ class ThreadChannel extends BaseChannel {
121
127
 
122
128
  this._createdTimestamp ??= this.type === ChannelType.PrivateThread ? super.createdTimestamp : null;
123
129
 
124
- if ('owner_id' in data) {
125
- /**
126
- * The id of the member who created this thread
127
- * @type {?Snowflake}
128
- */
129
- this.ownerId = data.owner_id;
130
- } else {
131
- this.ownerId ??= null;
132
- }
133
-
134
130
  if ('last_message_id' in data) {
135
131
  /**
136
132
  * The last message id sent in this thread, if one was sent
@@ -300,10 +296,6 @@ class ThreadChannel extends BaseChannel {
300
296
  * @returns {Promise<ThreadMember>}
301
297
  */
302
298
  async fetchOwner(options) {
303
- if (!this.ownerId) {
304
- throw new DiscordjsError(ErrorCodes.FetchOwnerId, 'thread');
305
- }
306
-
307
299
  const member = await this.members._fetchSingle({ ...options, member: this.ownerId });
308
300
  return member;
309
301
  }
@@ -12,7 +12,7 @@
12
12
  * @property {string} ChannelDelete channelDelete
13
13
  * @property {string} ChannelPinsUpdate channelPinsUpdate
14
14
  * @property {string} ChannelUpdate channelUpdate
15
- * @property {string} ClientReady ready
15
+ * @property {string} ClientReady clientReady
16
16
  * @property {string} Debug debug
17
17
  * @property {string} EntitlementCreate entitlementCreate
18
18
  * @property {string} EntitlementUpdate entitlementUpdate
@@ -3376,7 +3376,7 @@ export class ThreadChannel<ThreadOnly extends boolean = boolean> extends BaseCha
3376
3376
  public totalMessageSent: number | null;
3377
3377
  public members: ThreadMemberManager;
3378
3378
  public name: string;
3379
- public ownerId: Snowflake | null;
3379
+ public ownerId: Snowflake;
3380
3380
  public get parent(): If<ThreadOnly, ForumChannel | MediaChannel, TextChannel | AnnouncementChannel> | null;
3381
3381
  public parentId: Snowflake | null;
3382
3382
  public rateLimitPerUser: number | null;
@@ -3376,7 +3376,7 @@ export class ThreadChannel<ThreadOnly extends boolean = boolean> extends BaseCha
3376
3376
  public totalMessageSent: number | null;
3377
3377
  public members: ThreadMemberManager;
3378
3378
  public name: string;
3379
- public ownerId: Snowflake | null;
3379
+ public ownerId: Snowflake;
3380
3380
  public get parent(): If<ThreadOnly, ForumChannel | MediaChannel, TextChannel | AnnouncementChannel> | null;
3381
3381
  public parentId: Snowflake | null;
3382
3382
  public rateLimitPerUser: number | null;