discord.js 15.0.0-dev.1734135151-35ebcc7d5 → 15.0.0-dev.1734826392-c484e3de2

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.1734135151-35ebcc7d5",
4
+ "version": "15.0.0-dev.1734826392-c484e3de2",
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
  "lodash.snakecase": "4.1.1",
61
61
  "tslib": "^2.8.1",
62
62
  "undici": "6.21.0",
63
- "@discordjs/formatters": "^0.5.0",
64
- "@discordjs/rest": "^2.4.0",
65
63
  "@discordjs/util": "^1.1.1",
66
- "@discordjs/ws": "^2.0.0"
64
+ "@discordjs/rest": "^2.4.0",
65
+ "@discordjs/ws": "^2.0.0",
66
+ "@discordjs/formatters": "^0.5.0"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@favware/cliff-jumper": "^4.1.0",
@@ -149,15 +149,12 @@ class MessagePayload {
149
149
 
150
150
  let flags;
151
151
  if (
152
- this.options.flags !== undefined ||
152
+ // eslint-disable-next-line eqeqeq
153
+ this.options.flags != null ||
153
154
  (this.isMessage && this.options.reply === undefined) ||
154
155
  this.isMessageManager
155
156
  ) {
156
- flags =
157
- // eslint-disable-next-line eqeqeq
158
- this.options.flags != null
159
- ? new MessageFlagsBitField(this.options.flags).bitfield
160
- : this.target.flags?.bitfield;
157
+ flags = new MessageFlagsBitField(this.options.flags).bitfield;
161
158
  }
162
159
 
163
160
  let allowedMentions =
@@ -56,6 +56,14 @@ class Subscription extends Base {
56
56
  */
57
57
  this.status = data.status;
58
58
 
59
+ if ('renewal_sku_ids' in data) {
60
+ /**
61
+ * The SKU ids that this user will be subscribed to at renewal
62
+ * @type {?Snowflake[]}
63
+ */
64
+ this.renewalSkuIds = data.renewal_sku_ids;
65
+ }
66
+
59
67
  if ('canceled_at' in data) {
60
68
  /**
61
69
  * The timestamp of when the subscription was canceled
@@ -4,6 +4,7 @@ const { makeURLSearchParams } = require('@discordjs/rest');
4
4
  const { isJSONEncodable } = require('@discordjs/util');
5
5
  const { InteractionResponseType, MessageFlags, Routes, InteractionType } = require('discord-api-types/v10');
6
6
  const { DiscordjsError, ErrorCodes } = require('../../errors');
7
+ const MessageFlagsBitField = require('../../util/MessageFlagsBitField');
7
8
  const InteractionCallbackResponse = require('../InteractionCallbackResponse');
8
9
  const InteractionCollector = require('../InteractionCollector');
9
10
  const InteractionResponse = require('../InteractionResponse');
@@ -75,11 +76,13 @@ class InteractionResponses {
75
76
  async deferReply(options = {}) {
76
77
  if (this.deferred || this.replied) throw new DiscordjsError(ErrorCodes.InteractionAlreadyReplied);
77
78
 
79
+ const resolvedFlags = new MessageFlagsBitField(options.flags);
80
+
78
81
  const response = await this.client.rest.post(Routes.interactionCallback(this.id, this.token), {
79
82
  body: {
80
83
  type: InteractionResponseType.DeferredChannelMessageWithSource,
81
84
  data: {
82
- flags: options.flags,
85
+ flags: resolvedFlags.bitfield,
83
86
  },
84
87
  },
85
88
  auth: false,
@@ -87,7 +90,7 @@ class InteractionResponses {
87
90
  });
88
91
 
89
92
  this.deferred = true;
90
- this.ephemeral = Boolean(options.flags & MessageFlags.Ephemeral);
93
+ this.ephemeral = resolvedFlags.has(MessageFlags.Ephemeral);
91
94
 
92
95
  return options.withResponse
93
96
  ? new InteractionCallbackResponse(this.client, response)
@@ -131,7 +134,7 @@ class InteractionResponses {
131
134
  query: makeURLSearchParams({ with_response: options.withResponse ?? false }),
132
135
  });
133
136
 
134
- this.ephemeral = Boolean(options.flags & MessageFlags.Ephemeral);
137
+ this.ephemeral = Boolean(data.flags & MessageFlags.Ephemeral);
135
138
  this.replied = true;
136
139
 
137
140
  return options.withResponse
@@ -3132,6 +3132,7 @@ export class Subscription extends Base {
3132
3132
  public userId: Snowflake;
3133
3133
  public skuIds: Snowflake[];
3134
3134
  public entitlementIds: Snowflake[];
3135
+ public renewalSkuIds: Snowflake[] | null;
3135
3136
  public currentPeriodStartTimestamp: number;
3136
3137
  public currentPeriodEndTimestamp: number;
3137
3138
  public status: SubscriptionStatus;
@@ -3132,6 +3132,7 @@ export class Subscription extends Base {
3132
3132
  public userId: Snowflake;
3133
3133
  public skuIds: Snowflake[];
3134
3134
  public entitlementIds: Snowflake[];
3135
+ public renewalSkuIds: Snowflake[] | null;
3135
3136
  public currentPeriodStartTimestamp: number;
3136
3137
  public currentPeriodEndTimestamp: number;
3137
3138
  public status: SubscriptionStatus;