@discordjs/core 3.0.0-dev.1733357587-d0dc86488 → 3.0.0-dev.1733443981-00dceb32b

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/dist/index.js CHANGED
@@ -922,14 +922,19 @@ var GuildsAPI = class {
922
922
  static {
923
923
  __name(this, "GuildsAPI");
924
924
  }
925
- async get(guildId, queryOrOptions = {}, options = {}) {
926
- const requestData = {
927
- signal: ("signal" in queryOrOptions ? queryOrOptions : options).signal
928
- };
929
- if ("with_counts" in queryOrOptions) {
930
- requestData.query = (0, import_rest3.makeURLSearchParams)(queryOrOptions);
931
- }
932
- return this.rest.get(import_v105.Routes.guild(guildId), requestData);
925
+ /**
926
+ * Fetches a guild
927
+ *
928
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild}
929
+ * @param guildId - The id of the guild
930
+ * @param query - The query options for fetching the guild
931
+ * @param options - The options for fetching the guild
932
+ */
933
+ async get(guildId, query = {}, { signal } = {}) {
934
+ return this.rest.get(import_v105.Routes.guild(guildId), {
935
+ query: (0, import_rest3.makeURLSearchParams)(query),
936
+ signal
937
+ });
933
938
  }
934
939
  /**
935
940
  * Fetches a guild preview
@@ -1944,11 +1949,7 @@ var InteractionsAPI = class {
1944
1949
  static {
1945
1950
  __name(this, "InteractionsAPI");
1946
1951
  }
1947
- async reply(interactionId, interactionToken, {
1948
- files,
1949
- with_response,
1950
- ...data
1951
- }, { signal } = {}) {
1952
+ async reply(interactionId, interactionToken, { files, with_response, ...data }, { signal } = {}) {
1952
1953
  const response = await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
1953
1954
  query: (0, import_rest4.makeURLSearchParams)({ with_response }),
1954
1955
  files,
@@ -1961,10 +1962,7 @@ var InteractionsAPI = class {
1961
1962
  });
1962
1963
  return with_response ? response : void 0;
1963
1964
  }
1964
- async defer(interactionId, interactionToken, {
1965
- with_response,
1966
- ...data
1967
- } = {}, { signal } = {}) {
1965
+ async defer(interactionId, interactionToken, { with_response, ...data } = {}, { signal } = {}) {
1968
1966
  const response = await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
1969
1967
  query: (0, import_rest4.makeURLSearchParams)({ with_response }),
1970
1968
  auth: false,
@@ -2045,11 +2043,7 @@ var InteractionsAPI = class {
2045
2043
  async deleteReply(applicationId, interactionToken, messageId, { signal } = {}) {
2046
2044
  await this.webhooks.deleteMessage(applicationId, interactionToken, messageId ?? "@original", {}, { signal });
2047
2045
  }
2048
- async updateMessage(interactionId, interactionToken, {
2049
- files,
2050
- with_response,
2051
- ...data
2052
- }, { signal } = {}) {
2046
+ async updateMessage(interactionId, interactionToken, { files, with_response, ...data }, { signal } = {}) {
2053
2047
  const response = await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
2054
2048
  files,
2055
2049
  auth: false,
@@ -2061,10 +2055,7 @@ var InteractionsAPI = class {
2061
2055
  });
2062
2056
  return with_response ? response : void 0;
2063
2057
  }
2064
- async createAutocompleteResponse(interactionId, interactionToken, {
2065
- with_response,
2066
- ...data
2067
- }, { signal } = {}) {
2058
+ async createAutocompleteResponse(interactionId, interactionToken, { with_response, ...data }, { signal } = {}) {
2068
2059
  const response = await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
2069
2060
  auth: false,
2070
2061
  body: {
@@ -2203,6 +2194,19 @@ var MonetizationAPI = class {
2203
2194
  query: (0, import_rest6.makeURLSearchParams)(query)
2204
2195
  });
2205
2196
  }
2197
+ /**
2198
+ * Fetches an entitlement for an application.
2199
+ *
2200
+ * @see {@link https://discord.com/developers/docs/resources/entitlement#get-entitlement}
2201
+ * @param applicationId - The application id to fetch the entitlement for
2202
+ * @param entitlementId - The entitlement id to fetch
2203
+ * @param options - The options for fetching the entitlement
2204
+ */
2205
+ async getEntitlement(applicationId, entitlementId, { signal } = {}) {
2206
+ return this.rest.get(import_v108.Routes.entitlement(applicationId, entitlementId), {
2207
+ signal
2208
+ });
2209
+ }
2206
2210
  /**
2207
2211
  * Creates a test entitlement for an application's SKU.
2208
2212
  *
@@ -2849,12 +2853,7 @@ var WebhooksAPI = class {
2849
2853
  * @param body - The data for executing the webhook
2850
2854
  * @param options - The options for executing the webhook
2851
2855
  */
2852
- async execute(id, token, {
2853
- wait,
2854
- thread_id,
2855
- files,
2856
- ...body
2857
- }, { signal } = {}) {
2856
+ async execute(id, token, { wait, thread_id, files, ...body }, { signal } = {}) {
2858
2857
  return this.rest.post(import_v1017.Routes.webhook(id, token), {
2859
2858
  query: (0, import_rest10.makeURLSearchParams)({ wait, thread_id }),
2860
2859
  files,
@@ -2927,11 +2926,7 @@ var WebhooksAPI = class {
2927
2926
  * @param body - The data for editing the message
2928
2927
  * @param options - The options for editing the message
2929
2928
  */
2930
- async editMessage(id, token, messageId, {
2931
- thread_id,
2932
- files,
2933
- ...body
2934
- }, { signal } = {}) {
2929
+ async editMessage(id, token, messageId, { thread_id, files, ...body }, { signal } = {}) {
2935
2930
  return this.rest.patch(import_v1017.Routes.webhookMessage(id, token, messageId), {
2936
2931
  query: (0, import_rest10.makeURLSearchParams)({ thread_id }),
2937
2932
  auth: false,
@@ -3168,7 +3163,7 @@ __name(withFiles, "withFiles");
3168
3163
 
3169
3164
  // src/index.ts
3170
3165
  __reExport(src_exports, require("discord-api-types/v10"), module.exports);
3171
- var version = "3.0.0-dev.1733357587-d0dc86488";
3166
+ var version = "3.0.0-dev.1733443981-00dceb32b";
3172
3167
  // Annotate the CommonJS export names for ESM import in node:
3173
3168
  0 && (module.exports = {
3174
3169
  API,