@discordjs/core 2.3.0 → 2.4.0

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/http-only.js CHANGED
@@ -34,6 +34,7 @@ __export(http_only_exports, {
34
34
  OAuth2API: () => OAuth2API,
35
35
  PollAPI: () => PollAPI,
36
36
  RoleConnectionsAPI: () => RoleConnectionsAPI,
37
+ SoundboardSoundsAPI: () => SoundboardSoundsAPI,
37
38
  StageInstancesAPI: () => StageInstancesAPI,
38
39
  StickersAPI: () => StickersAPI,
39
40
  ThreadsAPI: () => ThreadsAPI,
@@ -791,6 +792,20 @@ var ChannelsAPI = class {
791
792
  signal
792
793
  });
793
794
  }
795
+ /**
796
+ * Sends a soundboard sound in a channel
797
+ *
798
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound}
799
+ * @param channelId - The id of the channel to send the soundboard sound in
800
+ * @param body - The data for sending the soundboard sound
801
+ * @param options - The options for sending the soundboard sound
802
+ */
803
+ async sendSoundboardSound(channelId, body, { signal } = {}) {
804
+ return this.rest.post(import_v103.Routes.sendSoundboardSound(channelId), {
805
+ body,
806
+ signal
807
+ });
808
+ }
794
809
  /**
795
810
  * Adds a recipient to a group DM channel
796
811
  *
@@ -1011,7 +1026,7 @@ var GuildsAPI = class {
1011
1026
  });
1012
1027
  }
1013
1028
  /**
1014
- * Fetches all the members of a guild
1029
+ * Fetches members of a guild.
1015
1030
  *
1016
1031
  * @see {@link https://discord.com/developers/docs/resources/guild#list-guild-members}
1017
1032
  * @param guildId - The id of the guild
@@ -1882,6 +1897,73 @@ var GuildsAPI = class {
1882
1897
  signal
1883
1898
  });
1884
1899
  }
1900
+ /**
1901
+ * Fetches all the soundboard sounds for a guild
1902
+ *
1903
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#list-guild-soundboard-sounds}
1904
+ * @param guildId - The id of the guild to fetch the soundboard sounds for
1905
+ * @param options - The options for fetching the soundboard sounds
1906
+ */
1907
+ async getSoundboardSounds(guildId, { signal } = {}) {
1908
+ return this.rest.get(import_v106.Routes.guildSoundboardSounds(guildId), {
1909
+ signal
1910
+ });
1911
+ }
1912
+ /**
1913
+ * Fetches a soundboard sound for a guild
1914
+ *
1915
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#get-guild-soundboard-sound}
1916
+ * @param guildId - The id of the guild to fetch the soundboard sound for
1917
+ * @param soundId - The id of the soundboard sound to fetch
1918
+ * @param options - The options for fetching the soundboard sound
1919
+ */
1920
+ async getSoundboardSound(guildId, soundId, { signal } = {}) {
1921
+ return this.rest.get(import_v106.Routes.guildSoundboardSound(guildId, soundId), {
1922
+ signal
1923
+ });
1924
+ }
1925
+ /**
1926
+ * Creates a new soundboard sound for a guild
1927
+ *
1928
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound}
1929
+ * @param guildId - The id of the guild to create the soundboard sound for
1930
+ * @param body - The data for creating the soundboard sound
1931
+ * @param options - The options for creating the soundboard sound
1932
+ */
1933
+ async createSoundboardSound(guildId, body, { reason, signal } = {}) {
1934
+ return this.rest.post(import_v106.Routes.guildSoundboardSounds(guildId), {
1935
+ body,
1936
+ reason,
1937
+ signal
1938
+ });
1939
+ }
1940
+ /**
1941
+ * Edits a soundboard sound for a guild
1942
+ *
1943
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound}
1944
+ * @param guildId - The id of the guild to edit the soundboard sound for
1945
+ * @param soundId - The id of the soundboard sound to edit
1946
+ * @param body - The data for editing the soundboard sound
1947
+ * @param options - The options for editing the soundboard sound
1948
+ */
1949
+ async editSoundboardSound(guildId, soundId, body, { reason, signal } = {}) {
1950
+ return this.rest.patch(import_v106.Routes.guildSoundboardSound(guildId, soundId), {
1951
+ body,
1952
+ reason,
1953
+ signal
1954
+ });
1955
+ }
1956
+ /**
1957
+ * Deletes a soundboard sound for a guild
1958
+ *
1959
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound}
1960
+ * @param guildId - The id of the guild to delete the soundboard sound for
1961
+ * @param soundId - The id of the soundboard sound to delete
1962
+ * @param options - The options for deleting the soundboard sound
1963
+ */
1964
+ async deleteSoundboardSound(guildId, soundId, { reason, signal } = {}) {
1965
+ await this.rest.delete(import_v106.Routes.guildSoundboardSound(guildId, soundId), { reason, signal });
1966
+ }
1885
1967
  /**
1886
1968
  * Modifies incident actions for a guild.
1887
1969
  *
@@ -1899,6 +1981,7 @@ var GuildsAPI = class {
1899
1981
  };
1900
1982
 
1901
1983
  // src/api/interactions.ts
1984
+ var import_rest4 = require("@discordjs/rest");
1902
1985
  var import_v107 = require("discord-api-types/v10");
1903
1986
  var InteractionsAPI = class {
1904
1987
  constructor(rest, webhooks) {
@@ -1908,17 +1991,9 @@ var InteractionsAPI = class {
1908
1991
  static {
1909
1992
  __name(this, "InteractionsAPI");
1910
1993
  }
1911
- /**
1912
- * Replies to an interaction
1913
- *
1914
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1915
- * @param interactionId - The id of the interaction
1916
- * @param interactionToken - The token of the interaction
1917
- * @param body - The callback data for replying
1918
- * @param options - The options for replying
1919
- */
1920
- async reply(interactionId, interactionToken, { files, ...data }, { signal } = {}) {
1921
- await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
1994
+ async reply(interactionId, interactionToken, { files, with_response, ...data }, { signal } = {}) {
1995
+ const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
1996
+ query: (0, import_rest4.makeURLSearchParams)({ with_response }),
1922
1997
  files,
1923
1998
  auth: false,
1924
1999
  body: {
@@ -1927,18 +2002,11 @@ var InteractionsAPI = class {
1927
2002
  },
1928
2003
  signal
1929
2004
  });
2005
+ return with_response ? response : void 0;
1930
2006
  }
1931
- /**
1932
- * Defers the reply to an interaction
1933
- *
1934
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1935
- * @param interactionId - The id of the interaction
1936
- * @param interactionToken - The token of the interaction
1937
- * @param data - The data for deferring the reply
1938
- * @param options - The options for deferring
1939
- */
1940
- async defer(interactionId, interactionToken, data, { signal } = {}) {
1941
- await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
2007
+ async defer(interactionId, interactionToken, { with_response, ...data } = {}, { signal } = {}) {
2008
+ const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
2009
+ query: (0, import_rest4.makeURLSearchParams)({ with_response }),
1942
2010
  auth: false,
1943
2011
  body: {
1944
2012
  type: import_v107.InteractionResponseType.DeferredChannelMessageWithSource,
@@ -1946,23 +2014,18 @@ var InteractionsAPI = class {
1946
2014
  },
1947
2015
  signal
1948
2016
  });
2017
+ return with_response ? response : void 0;
1949
2018
  }
1950
- /**
1951
- * Defers an update from a message component interaction
1952
- *
1953
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1954
- * @param interactionId - The id of the interaction
1955
- * @param interactionToken - The token of the interaction
1956
- * @param options - The options for deferring
1957
- */
1958
- async deferMessageUpdate(interactionId, interactionToken, { signal } = {}) {
1959
- await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
2019
+ async deferMessageUpdate(interactionId, interactionToken, { with_response } = {}, { signal } = {}) {
2020
+ const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
2021
+ query: (0, import_rest4.makeURLSearchParams)({ with_response }),
1960
2022
  auth: false,
1961
2023
  body: {
1962
2024
  type: import_v107.InteractionResponseType.DeferredMessageUpdate
1963
2025
  },
1964
2026
  signal
1965
2027
  });
2028
+ return with_response ? response : void 0;
1966
2029
  }
1967
2030
  /**
1968
2031
  * Reply to a deferred interaction
@@ -2022,17 +2085,9 @@ var InteractionsAPI = class {
2022
2085
  async deleteReply(applicationId, interactionToken, messageId, { signal } = {}) {
2023
2086
  await this.webhooks.deleteMessage(applicationId, interactionToken, messageId ?? "@original", {}, { signal });
2024
2087
  }
2025
- /**
2026
- * Updates the message the component interaction was triggered on
2027
- *
2028
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
2029
- * @param interactionId - The id of the interaction
2030
- * @param interactionToken - The token of the interaction
2031
- * @param callbackData - The callback data for updating the interaction
2032
- * @param options - The options for updating the interaction
2033
- */
2034
- async updateMessage(interactionId, interactionToken, { files, ...data }, { signal } = {}) {
2035
- await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
2088
+ async updateMessage(interactionId, interactionToken, { files, with_response, ...data }, { signal } = {}) {
2089
+ const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
2090
+ query: (0, import_rest4.makeURLSearchParams)({ with_response }),
2036
2091
  files,
2037
2092
  auth: false,
2038
2093
  body: {
@@ -2041,47 +2096,34 @@ var InteractionsAPI = class {
2041
2096
  },
2042
2097
  signal
2043
2098
  });
2099
+ return with_response ? response : void 0;
2044
2100
  }
2045
- /**
2046
- * Sends an autocomplete response to an interaction
2047
- *
2048
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
2049
- * @param interactionId - The id of the interaction
2050
- * @param interactionToken - The token of the interaction
2051
- * @param callbackData - The callback data for the autocomplete response
2052
- * @param options - The options for sending the autocomplete response
2053
- */
2054
- async createAutocompleteResponse(interactionId, interactionToken, callbackData, { signal } = {}) {
2055
- await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
2101
+ async createAutocompleteResponse(interactionId, interactionToken, { with_response, ...data }, { signal } = {}) {
2102
+ const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
2103
+ query: (0, import_rest4.makeURLSearchParams)({ with_response }),
2056
2104
  auth: false,
2057
2105
  body: {
2058
2106
  type: import_v107.InteractionResponseType.ApplicationCommandAutocompleteResult,
2059
- data: callbackData
2107
+ data
2060
2108
  },
2061
2109
  signal
2062
2110
  });
2111
+ return with_response ? response : void 0;
2063
2112
  }
2064
- /**
2065
- * Sends a modal response to an interaction
2066
- *
2067
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
2068
- * @param interactionId - The id of the interaction
2069
- * @param interactionToken - The token of the interaction
2070
- * @param callbackData - The modal callback data to send
2071
- * @param options - The options for sending the modal
2072
- */
2073
- async createModal(interactionId, interactionToken, callbackData, { signal } = {}) {
2074
- await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
2113
+ async createModal(interactionId, interactionToken, { with_response, ...data }, { signal } = {}) {
2114
+ const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
2115
+ query: (0, import_rest4.makeURLSearchParams)({ with_response }),
2075
2116
  auth: false,
2076
2117
  body: {
2077
2118
  type: import_v107.InteractionResponseType.Modal,
2078
- data: callbackData
2119
+ data
2079
2120
  },
2080
2121
  signal
2081
2122
  });
2123
+ return with_response ? response : void 0;
2082
2124
  }
2083
2125
  /**
2084
- * Sends a premium required response to an interaction
2126
+ * Launches an activity and returns an interaction callback object
2085
2127
  *
2086
2128
  * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
2087
2129
  * @param interactionId - The id of the interaction
@@ -2098,10 +2140,21 @@ var InteractionsAPI = class {
2098
2140
  signal
2099
2141
  });
2100
2142
  }
2143
+ async launchActivity(interactionId, interactionToken, { with_response } = {}, { signal } = {}) {
2144
+ const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
2145
+ query: (0, import_rest4.makeURLSearchParams)({ with_response }),
2146
+ auth: false,
2147
+ body: {
2148
+ type: import_v107.InteractionResponseType.LaunchActivity
2149
+ },
2150
+ signal
2151
+ });
2152
+ return with_response ? response : void 0;
2153
+ }
2101
2154
  };
2102
2155
 
2103
2156
  // src/api/invite.ts
2104
- var import_rest4 = require("@discordjs/rest");
2157
+ var import_rest5 = require("@discordjs/rest");
2105
2158
  var import_v108 = require("discord-api-types/v10");
2106
2159
  var InvitesAPI = class {
2107
2160
  constructor(rest) {
@@ -2120,7 +2173,7 @@ var InvitesAPI = class {
2120
2173
  */
2121
2174
  async get(code, query = {}, { signal } = {}) {
2122
2175
  return this.rest.get(import_v108.Routes.invite(code), {
2123
- query: (0, import_rest4.makeURLSearchParams)(query),
2176
+ query: (0, import_rest5.makeURLSearchParams)(query),
2124
2177
  signal
2125
2178
  });
2126
2179
  }
@@ -2137,7 +2190,7 @@ var InvitesAPI = class {
2137
2190
  };
2138
2191
 
2139
2192
  // src/api/monetization.ts
2140
- var import_rest5 = require("@discordjs/rest");
2193
+ var import_rest6 = require("@discordjs/rest");
2141
2194
  var import_v109 = require("discord-api-types/v10");
2142
2195
  var MonetizationAPI = class {
2143
2196
  constructor(rest) {
@@ -2149,30 +2202,71 @@ var MonetizationAPI = class {
2149
2202
  /**
2150
2203
  * Fetches the SKUs for an application.
2151
2204
  *
2152
- * @see {@link https://discord.com/developers/docs/monetization/skus#list-skus}
2205
+ * @see {@link https://discord.com/developers/docs/resources/sku#list-skus}
2206
+ * @param applicationId - The application id to fetch SKUs for
2153
2207
  * @param options - The options for fetching the SKUs.
2154
2208
  */
2155
2209
  async getSKUs(applicationId, { signal } = {}) {
2156
2210
  return this.rest.get(import_v109.Routes.skus(applicationId), { signal });
2157
2211
  }
2212
+ /**
2213
+ * Fetches subscriptions for an SKU.
2214
+ *
2215
+ * @see {@link https://discord.com/developers/docs/resources/subscription#list-sku-subscriptions}
2216
+ * @param skuId - The SKU id to fetch subscriptions for
2217
+ * @param query - The query options for fetching subscriptions
2218
+ * @param options - The options for fetching subscriptions
2219
+ */
2220
+ async getSKUSubscriptions(skuId, query = {}, { signal } = {}) {
2221
+ return this.rest.get(import_v109.Routes.skuSubscriptions(skuId), {
2222
+ signal,
2223
+ query: (0, import_rest6.makeURLSearchParams)(query)
2224
+ });
2225
+ }
2226
+ /**
2227
+ * Fetches a subscription for an SKU.
2228
+ *
2229
+ * @see {@link https://discord.com/developers/docs/resources/subscription#get-sku-subscription}
2230
+ * @param skuId - The SKU id to fetch subscription for
2231
+ * @param subscriptionId - The subscription id to fetch
2232
+ * @param options - The options for fetching the subscription
2233
+ */
2234
+ async getSKUSubscription(skuId, subscriptionId, { signal } = {}) {
2235
+ return this.rest.get(import_v109.Routes.skuSubscription(skuId, subscriptionId), {
2236
+ signal
2237
+ });
2238
+ }
2158
2239
  /**
2159
2240
  * Fetches the entitlements for an application.
2160
2241
  *
2161
- * @see {@link https://discord.com/developers/docs/monetization/entitlements#list-entitlements}
2242
+ * @see {@link https://discord.com/developers/docs/resources/entitlement#list-entitlements}
2162
2243
  * @param applicationId - The application id to fetch entitlements for
2163
2244
  * @param query - The query options for fetching entitlements
2164
2245
  * @param options - The options for fetching entitlements
2165
2246
  */
2166
- async getEntitlements(applicationId, query, { signal } = {}) {
2247
+ async getEntitlements(applicationId, query = {}, { signal } = {}) {
2167
2248
  return this.rest.get(import_v109.Routes.entitlements(applicationId), {
2168
2249
  signal,
2169
- query: (0, import_rest5.makeURLSearchParams)(query)
2250
+ query: (0, import_rest6.makeURLSearchParams)(query)
2251
+ });
2252
+ }
2253
+ /**
2254
+ * Fetches an entitlement for an application.
2255
+ *
2256
+ * @see {@link https://discord.com/developers/docs/resources/entitlement#get-entitlement}
2257
+ * @param applicationId - The application id to fetch the entitlement for
2258
+ * @param entitlementId - The entitlement id to fetch
2259
+ * @param options - The options for fetching the entitlement
2260
+ */
2261
+ async getEntitlement(applicationId, entitlementId, { signal } = {}) {
2262
+ return this.rest.get(import_v109.Routes.entitlement(applicationId, entitlementId), {
2263
+ signal
2170
2264
  });
2171
2265
  }
2172
2266
  /**
2173
2267
  * Creates a test entitlement for an application's SKU.
2174
2268
  *
2175
- * @see {@link https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement}
2269
+ * @see {@link https://discord.com/developers/docs/resources/entitlement#create-test-entitlement}
2176
2270
  * @param applicationId - The application id to create the entitlement for
2177
2271
  * @param body - The data for creating the entitlement
2178
2272
  * @param options - The options for creating the entitlement
@@ -2186,7 +2280,7 @@ var MonetizationAPI = class {
2186
2280
  /**
2187
2281
  * Deletes a test entitlement for an application's SKU.
2188
2282
  *
2189
- * @see {@link https://discord.com/developers/docs/monetization/entitlements#delete-test-entitlement}
2283
+ * @see {@link https://discord.com/developers/docs/resources/entitlement#delete-test-entitlement}
2190
2284
  * @param applicationId - The application id to delete the entitlement for
2191
2285
  * @param entitlementId - The entitlement id to delete
2192
2286
  * @param options - The options for deleting the entitlement
@@ -2197,7 +2291,7 @@ var MonetizationAPI = class {
2197
2291
  /**
2198
2292
  * Marks a given entitlement for the user as consumed. Only available for One-Time Purchase consumable SKUs.
2199
2293
  *
2200
- * @see {@link https://discord.com/developers/docs/monetization/entitlements#consume-an-entitlement}
2294
+ * @see {@link https://discord.com/developers/docs/resources/entitlement#consume-an-entitlement}
2201
2295
  * @param applicationId - The application id to consume the entitlement for
2202
2296
  * @param entitlementId - The entitlement id to consume
2203
2297
  * @param options - The options for consuming the entitlement
@@ -2208,7 +2302,7 @@ var MonetizationAPI = class {
2208
2302
  };
2209
2303
 
2210
2304
  // src/api/oauth2.ts
2211
- var import_rest6 = require("@discordjs/rest");
2305
+ var import_rest7 = require("@discordjs/rest");
2212
2306
  var import_v1010 = require("discord-api-types/v10");
2213
2307
  var OAuth2API = class {
2214
2308
  constructor(rest) {
@@ -2225,7 +2319,7 @@ var OAuth2API = class {
2225
2319
  */
2226
2320
  generateAuthorizationURL(options) {
2227
2321
  const url = new URL(`${import_v1010.RouteBases.api}${import_v1010.Routes.oauth2Authorization()}`);
2228
- url.search = (0, import_rest6.makeURLSearchParams)(options).toString();
2322
+ url.search = (0, import_rest7.makeURLSearchParams)(options).toString();
2229
2323
  return url.toString();
2230
2324
  }
2231
2325
  /**
@@ -2237,7 +2331,7 @@ var OAuth2API = class {
2237
2331
  */
2238
2332
  async tokenExchange(body, { signal } = {}) {
2239
2333
  return this.rest.post(import_v1010.Routes.oauth2TokenExchange(), {
2240
- body: (0, import_rest6.makeURLSearchParams)(body),
2334
+ body: (0, import_rest7.makeURLSearchParams)(body),
2241
2335
  passThroughBody: true,
2242
2336
  headers: {
2243
2337
  "Content-Type": "application/x-www-form-urlencoded"
@@ -2255,7 +2349,7 @@ var OAuth2API = class {
2255
2349
  */
2256
2350
  async refreshToken(body, { signal } = {}) {
2257
2351
  return this.rest.post(import_v1010.Routes.oauth2TokenExchange(), {
2258
- body: (0, import_rest6.makeURLSearchParams)(body),
2352
+ body: (0, import_rest7.makeURLSearchParams)(body),
2259
2353
  passThroughBody: true,
2260
2354
  headers: {
2261
2355
  "Content-Type": "application/x-www-form-urlencoded"
@@ -2275,7 +2369,7 @@ var OAuth2API = class {
2275
2369
  */
2276
2370
  async getToken(body, { signal } = {}) {
2277
2371
  return this.rest.post(import_v1010.Routes.oauth2TokenExchange(), {
2278
- body: (0, import_rest6.makeURLSearchParams)(body),
2372
+ body: (0, import_rest7.makeURLSearchParams)(body),
2279
2373
  passThroughBody: true,
2280
2374
  headers: {
2281
2375
  "Content-Type": "application/x-www-form-urlencoded"
@@ -2317,7 +2411,7 @@ var OAuth2API = class {
2317
2411
  */
2318
2412
  async revokeToken(applicationId, applicationSecret, body, { signal } = {}) {
2319
2413
  await this.rest.post(import_v1010.Routes.oauth2TokenRevocation(), {
2320
- body: (0, import_rest6.makeURLSearchParams)(body),
2414
+ body: (0, import_rest7.makeURLSearchParams)(body),
2321
2415
  passThroughBody: true,
2322
2416
  headers: {
2323
2417
  Authorization: `Basic ${btoa(`${applicationId}:${applicationSecret}`)}`,
@@ -2330,7 +2424,7 @@ var OAuth2API = class {
2330
2424
  };
2331
2425
 
2332
2426
  // src/api/poll.ts
2333
- var import_rest7 = require("@discordjs/rest");
2427
+ var import_rest8 = require("@discordjs/rest");
2334
2428
  var import_v1011 = require("discord-api-types/v10");
2335
2429
  var PollAPI = class {
2336
2430
  constructor(rest) {
@@ -2349,10 +2443,10 @@ var PollAPI = class {
2349
2443
  * @param query - The query for getting the list of voters
2350
2444
  * @param options - The options for getting the list of voters
2351
2445
  */
2352
- async getAnswerVoters(channelId, messageId, answerId, query, { signal } = {}) {
2446
+ async getAnswerVoters(channelId, messageId, answerId, query = {}, { signal } = {}) {
2353
2447
  return this.rest.get(import_v1011.Routes.pollAnswerVoters(channelId, messageId, answerId), {
2354
2448
  signal,
2355
- query: (0, import_rest7.makeURLSearchParams)(query)
2449
+ query: (0, import_rest8.makeURLSearchParams)(query)
2356
2450
  });
2357
2451
  }
2358
2452
  /**
@@ -2407,8 +2501,30 @@ var RoleConnectionsAPI = class {
2407
2501
  }
2408
2502
  };
2409
2503
 
2410
- // src/api/stageInstances.ts
2504
+ // src/api/soundboardSounds.ts
2411
2505
  var import_v1013 = require("discord-api-types/v10");
2506
+ var SoundboardSoundsAPI = class {
2507
+ constructor(rest) {
2508
+ this.rest = rest;
2509
+ }
2510
+ static {
2511
+ __name(this, "SoundboardSoundsAPI");
2512
+ }
2513
+ /**
2514
+ * Fetches all the soundboard default sounds.
2515
+ *
2516
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#list-default-soundboard-sounds}
2517
+ * @param options - The options for fetching the soundboard default sounds.
2518
+ */
2519
+ async getSoundboardDefaultSounds({ signal } = {}) {
2520
+ return this.rest.get(import_v1013.Routes.soundboardDefaultSounds(), {
2521
+ signal
2522
+ });
2523
+ }
2524
+ };
2525
+
2526
+ // src/api/stageInstances.ts
2527
+ var import_v1014 = require("discord-api-types/v10");
2412
2528
  var StageInstancesAPI = class {
2413
2529
  constructor(rest) {
2414
2530
  this.rest = rest;
@@ -2424,7 +2540,7 @@ var StageInstancesAPI = class {
2424
2540
  * @param options - The options for creating the new stage instance
2425
2541
  */
2426
2542
  async create(body, { reason, signal } = {}) {
2427
- return this.rest.post(import_v1013.Routes.stageInstances(), {
2543
+ return this.rest.post(import_v1014.Routes.stageInstances(), {
2428
2544
  body,
2429
2545
  reason,
2430
2546
  signal
@@ -2438,7 +2554,7 @@ var StageInstancesAPI = class {
2438
2554
  * @param options - The options for fetching the stage instance
2439
2555
  */
2440
2556
  async get(channelId, { signal } = {}) {
2441
- return this.rest.get(import_v1013.Routes.stageInstance(channelId), { signal });
2557
+ return this.rest.get(import_v1014.Routes.stageInstance(channelId), { signal });
2442
2558
  }
2443
2559
  /**
2444
2560
  * Edits a stage instance
@@ -2449,7 +2565,7 @@ var StageInstancesAPI = class {
2449
2565
  * @param options - The options for editing the stage instance
2450
2566
  */
2451
2567
  async edit(channelId, body, { reason, signal } = {}) {
2452
- return this.rest.patch(import_v1013.Routes.stageInstance(channelId), {
2568
+ return this.rest.patch(import_v1014.Routes.stageInstance(channelId), {
2453
2569
  body,
2454
2570
  reason,
2455
2571
  signal
@@ -2463,12 +2579,12 @@ var StageInstancesAPI = class {
2463
2579
  * @param options - The options for deleting the stage instance
2464
2580
  */
2465
2581
  async delete(channelId, { reason, signal } = {}) {
2466
- await this.rest.delete(import_v1013.Routes.stageInstance(channelId), { reason, signal });
2582
+ await this.rest.delete(import_v1014.Routes.stageInstance(channelId), { reason, signal });
2467
2583
  }
2468
2584
  };
2469
2585
 
2470
2586
  // src/api/sticker.ts
2471
- var import_v1014 = require("discord-api-types/v10");
2587
+ var import_v1015 = require("discord-api-types/v10");
2472
2588
  var StickersAPI = class {
2473
2589
  constructor(rest) {
2474
2590
  this.rest = rest;
@@ -2484,7 +2600,7 @@ var StickersAPI = class {
2484
2600
  * @param options - The options for fetching the sticker pack
2485
2601
  */
2486
2602
  async getStickerPack(packId, { signal } = {}) {
2487
- return this.rest.get(import_v1014.Routes.stickerPack(packId), { signal });
2603
+ return this.rest.get(import_v1015.Routes.stickerPack(packId), { signal });
2488
2604
  }
2489
2605
  /**
2490
2606
  * Fetches all of the sticker packs
@@ -2493,7 +2609,7 @@ var StickersAPI = class {
2493
2609
  * @param options - The options for fetching the sticker packs
2494
2610
  */
2495
2611
  async getStickers({ signal } = {}) {
2496
- return this.rest.get(import_v1014.Routes.stickerPacks(), { signal });
2612
+ return this.rest.get(import_v1015.Routes.stickerPacks(), { signal });
2497
2613
  }
2498
2614
  /**
2499
2615
  * Fetches all of the sticker packs
@@ -2513,12 +2629,12 @@ var StickersAPI = class {
2513
2629
  * @param options - The options for fetching the sticker
2514
2630
  */
2515
2631
  async get(stickerId, { signal } = {}) {
2516
- return this.rest.get(import_v1014.Routes.sticker(stickerId), { signal });
2632
+ return this.rest.get(import_v1015.Routes.sticker(stickerId), { signal });
2517
2633
  }
2518
2634
  };
2519
2635
 
2520
2636
  // src/api/thread.ts
2521
- var import_v1015 = require("discord-api-types/v10");
2637
+ var import_v1016 = require("discord-api-types/v10");
2522
2638
  var ThreadsAPI = class {
2523
2639
  constructor(rest) {
2524
2640
  this.rest = rest;
@@ -2534,7 +2650,7 @@ var ThreadsAPI = class {
2534
2650
  * @param options - The options for joining the thread
2535
2651
  */
2536
2652
  async join(threadId, { signal } = {}) {
2537
- await this.rest.put(import_v1015.Routes.threadMembers(threadId, "@me"), { signal });
2653
+ await this.rest.put(import_v1016.Routes.threadMembers(threadId, "@me"), { signal });
2538
2654
  }
2539
2655
  /**
2540
2656
  * Adds a member to a thread
@@ -2545,7 +2661,7 @@ var ThreadsAPI = class {
2545
2661
  * @param options - The options for adding the member to the thread
2546
2662
  */
2547
2663
  async addMember(threadId, userId, { signal } = {}) {
2548
- await this.rest.put(import_v1015.Routes.threadMembers(threadId, userId), { signal });
2664
+ await this.rest.put(import_v1016.Routes.threadMembers(threadId, userId), { signal });
2549
2665
  }
2550
2666
  /**
2551
2667
  * Removes the current user from a thread
@@ -2555,7 +2671,7 @@ var ThreadsAPI = class {
2555
2671
  * @param options - The options for leaving the thread
2556
2672
  */
2557
2673
  async leave(threadId, { signal } = {}) {
2558
- await this.rest.delete(import_v1015.Routes.threadMembers(threadId, "@me"), { signal });
2674
+ await this.rest.delete(import_v1016.Routes.threadMembers(threadId, "@me"), { signal });
2559
2675
  }
2560
2676
  /**
2561
2677
  * Removes a member from a thread
@@ -2566,7 +2682,7 @@ var ThreadsAPI = class {
2566
2682
  * @param options - The options for removing the member from the thread
2567
2683
  */
2568
2684
  async removeMember(threadId, userId, { signal } = {}) {
2569
- await this.rest.delete(import_v1015.Routes.threadMembers(threadId, userId), { signal });
2685
+ await this.rest.delete(import_v1016.Routes.threadMembers(threadId, userId), { signal });
2570
2686
  }
2571
2687
  /**
2572
2688
  * Fetches a member of a thread
@@ -2577,7 +2693,7 @@ var ThreadsAPI = class {
2577
2693
  * @param options - The options for fetching the member
2578
2694
  */
2579
2695
  async getMember(threadId, userId, { signal } = {}) {
2580
- return this.rest.get(import_v1015.Routes.threadMembers(threadId, userId), { signal });
2696
+ return this.rest.get(import_v1016.Routes.threadMembers(threadId, userId), { signal });
2581
2697
  }
2582
2698
  /**
2583
2699
  * Fetches all members of a thread
@@ -2587,13 +2703,13 @@ var ThreadsAPI = class {
2587
2703
  * @param options - The options for fetching the members
2588
2704
  */
2589
2705
  async getAllMembers(threadId, { signal } = {}) {
2590
- return this.rest.get(import_v1015.Routes.threadMembers(threadId), { signal });
2706
+ return this.rest.get(import_v1016.Routes.threadMembers(threadId), { signal });
2591
2707
  }
2592
2708
  };
2593
2709
 
2594
2710
  // src/api/user.ts
2595
- var import_rest8 = require("@discordjs/rest");
2596
- var import_v1016 = require("discord-api-types/v10");
2711
+ var import_rest9 = require("@discordjs/rest");
2712
+ var import_v1017 = require("discord-api-types/v10");
2597
2713
  var UsersAPI = class {
2598
2714
  constructor(rest) {
2599
2715
  this.rest = rest;
@@ -2609,7 +2725,7 @@ var UsersAPI = class {
2609
2725
  * @param options - The options for fetching the user
2610
2726
  */
2611
2727
  async get(userId, { signal } = {}) {
2612
- return this.rest.get(import_v1016.Routes.user(userId), { signal });
2728
+ return this.rest.get(import_v1017.Routes.user(userId), { signal });
2613
2729
  }
2614
2730
  /**
2615
2731
  * Returns the user object of the requester's account
@@ -2618,7 +2734,7 @@ var UsersAPI = class {
2618
2734
  * @param options - The options for fetching the current user
2619
2735
  */
2620
2736
  async getCurrent({ signal } = {}) {
2621
- return this.rest.get(import_v1016.Routes.user("@me"), { signal });
2737
+ return this.rest.get(import_v1017.Routes.user("@me"), { signal });
2622
2738
  }
2623
2739
  /**
2624
2740
  * Returns a list of partial guild objects the current user is a member of
@@ -2628,8 +2744,8 @@ var UsersAPI = class {
2628
2744
  * @param options - The options for fetching the guilds
2629
2745
  */
2630
2746
  async getGuilds(query = {}, { signal } = {}) {
2631
- return this.rest.get(import_v1016.Routes.userGuilds(), {
2632
- query: (0, import_rest8.makeURLSearchParams)(query),
2747
+ return this.rest.get(import_v1017.Routes.userGuilds(), {
2748
+ query: (0, import_rest9.makeURLSearchParams)(query),
2633
2749
  signal
2634
2750
  });
2635
2751
  }
@@ -2641,7 +2757,7 @@ var UsersAPI = class {
2641
2757
  * @param options - The options for leaving the guild
2642
2758
  */
2643
2759
  async leaveGuild(guildId, { signal } = {}) {
2644
- await this.rest.delete(import_v1016.Routes.userGuild(guildId), { signal });
2760
+ await this.rest.delete(import_v1017.Routes.userGuild(guildId), { signal });
2645
2761
  }
2646
2762
  /**
2647
2763
  * Edits the current user
@@ -2651,7 +2767,7 @@ var UsersAPI = class {
2651
2767
  * @param options - The options for editing the user
2652
2768
  */
2653
2769
  async edit(body, { signal } = {}) {
2654
- return this.rest.patch(import_v1016.Routes.user("@me"), { body, signal });
2770
+ return this.rest.patch(import_v1017.Routes.user("@me"), { body, signal });
2655
2771
  }
2656
2772
  /**
2657
2773
  * Fetches the guild member for the current user
@@ -2661,7 +2777,7 @@ var UsersAPI = class {
2661
2777
  * @param options - The options for fetching the guild member
2662
2778
  */
2663
2779
  async getGuildMember(guildId, { signal } = {}) {
2664
- return this.rest.get(import_v1016.Routes.userGuildMember(guildId), { signal });
2780
+ return this.rest.get(import_v1017.Routes.userGuildMember(guildId), { signal });
2665
2781
  }
2666
2782
  /**
2667
2783
  * Edits the guild member for the current user
@@ -2672,7 +2788,7 @@ var UsersAPI = class {
2672
2788
  * @param options - The options for editing the guild member
2673
2789
  */
2674
2790
  async editCurrentGuildMember(guildId, body = {}, { reason, signal } = {}) {
2675
- return this.rest.patch(import_v1016.Routes.guildMember(guildId, "@me"), {
2791
+ return this.rest.patch(import_v1017.Routes.guildMember(guildId, "@me"), {
2676
2792
  reason,
2677
2793
  body,
2678
2794
  signal
@@ -2686,7 +2802,7 @@ var UsersAPI = class {
2686
2802
  * @param options - The options for opening the DM
2687
2803
  */
2688
2804
  async createDM(userId, { signal } = {}) {
2689
- return this.rest.post(import_v1016.Routes.userChannels(), {
2805
+ return this.rest.post(import_v1017.Routes.userChannels(), {
2690
2806
  body: { recipient_id: userId },
2691
2807
  signal
2692
2808
  });
@@ -2698,7 +2814,7 @@ var UsersAPI = class {
2698
2814
  * @param options - The options for fetching the user's connections
2699
2815
  */
2700
2816
  async getConnections({ signal } = {}) {
2701
- return this.rest.get(import_v1016.Routes.userConnections(), { signal });
2817
+ return this.rest.get(import_v1017.Routes.userConnections(), { signal });
2702
2818
  }
2703
2819
  /**
2704
2820
  * Gets the current user's active application role connection
@@ -2708,7 +2824,7 @@ var UsersAPI = class {
2708
2824
  * @param options - The options for fetching the role connections
2709
2825
  */
2710
2826
  async getApplicationRoleConnection(applicationId, { signal } = {}) {
2711
- return this.rest.get(import_v1016.Routes.userApplicationRoleConnection(applicationId), {
2827
+ return this.rest.get(import_v1017.Routes.userApplicationRoleConnection(applicationId), {
2712
2828
  signal
2713
2829
  });
2714
2830
  }
@@ -2721,7 +2837,7 @@ var UsersAPI = class {
2721
2837
  * @param options - The options for updating the application role connection
2722
2838
  */
2723
2839
  async updateApplicationRoleConnection(applicationId, body, { signal } = {}) {
2724
- return this.rest.put(import_v1016.Routes.userApplicationRoleConnection(applicationId), {
2840
+ return this.rest.put(import_v1017.Routes.userApplicationRoleConnection(applicationId), {
2725
2841
  body,
2726
2842
  signal
2727
2843
  });
@@ -2729,8 +2845,8 @@ var UsersAPI = class {
2729
2845
  };
2730
2846
 
2731
2847
  // src/api/webhook.ts
2732
- var import_rest9 = require("@discordjs/rest");
2733
- var import_v1017 = require("discord-api-types/v10");
2848
+ var import_rest10 = require("@discordjs/rest");
2849
+ var import_v1018 = require("discord-api-types/v10");
2734
2850
  var WebhooksAPI = class {
2735
2851
  constructor(rest) {
2736
2852
  this.rest = rest;
@@ -2747,7 +2863,7 @@ var WebhooksAPI = class {
2747
2863
  * @param options - The options for fetching the webhook
2748
2864
  */
2749
2865
  async get(id, { token, signal } = {}) {
2750
- return this.rest.get(import_v1017.Routes.webhook(id, token), {
2866
+ return this.rest.get(import_v1018.Routes.webhook(id, token), {
2751
2867
  signal,
2752
2868
  auth: !token
2753
2869
  });
@@ -2762,7 +2878,7 @@ var WebhooksAPI = class {
2762
2878
  * @param options - The options for editing the webhook
2763
2879
  */
2764
2880
  async edit(id, body, { token, reason, signal } = {}) {
2765
- return this.rest.patch(import_v1017.Routes.webhook(id, token), {
2881
+ return this.rest.patch(import_v1018.Routes.webhook(id, token), {
2766
2882
  reason,
2767
2883
  body,
2768
2884
  signal,
@@ -2778,7 +2894,7 @@ var WebhooksAPI = class {
2778
2894
  * @param options - The options for deleting the webhook
2779
2895
  */
2780
2896
  async delete(id, { token, reason, signal } = {}) {
2781
- await this.rest.delete(import_v1017.Routes.webhook(id, token), {
2897
+ await this.rest.delete(import_v1018.Routes.webhook(id, token), {
2782
2898
  reason,
2783
2899
  signal,
2784
2900
  auth: !token
@@ -2793,15 +2909,9 @@ var WebhooksAPI = class {
2793
2909
  * @param body - The data for executing the webhook
2794
2910
  * @param options - The options for executing the webhook
2795
2911
  */
2796
- async execute(id, token, {
2797
- wait,
2798
- thread_id,
2799
- with_components,
2800
- files,
2801
- ...body
2802
- }, { signal } = {}) {
2803
- return this.rest.post(import_v1017.Routes.webhook(id, token), {
2804
- query: (0, import_rest9.makeURLSearchParams)({ wait, thread_id, with_components }),
2912
+ async execute(id, token, { wait, thread_id, with_components, files, ...body }, { signal } = {}) {
2913
+ return this.rest.post(import_v1018.Routes.webhook(id, token), {
2914
+ query: (0, import_rest10.makeURLSearchParams)({ wait, thread_id, with_components }),
2805
2915
  files,
2806
2916
  body,
2807
2917
  auth: false,
@@ -2820,8 +2930,8 @@ var WebhooksAPI = class {
2820
2930
  * @param options - The options for executing the webhook
2821
2931
  */
2822
2932
  async executeSlack(id, token, body, query = {}, { signal } = {}) {
2823
- await this.rest.post(import_v1017.Routes.webhookPlatform(id, token, "slack"), {
2824
- query: (0, import_rest9.makeURLSearchParams)(query),
2933
+ await this.rest.post(import_v1018.Routes.webhookPlatform(id, token, "slack"), {
2934
+ query: (0, import_rest10.makeURLSearchParams)(query),
2825
2935
  body,
2826
2936
  auth: false,
2827
2937
  signal
@@ -2838,8 +2948,8 @@ var WebhooksAPI = class {
2838
2948
  * @param options - The options for executing the webhook
2839
2949
  */
2840
2950
  async executeGitHub(id, token, body, query = {}, { signal } = {}) {
2841
- await this.rest.post(import_v1017.Routes.webhookPlatform(id, token, "github"), {
2842
- query: (0, import_rest9.makeURLSearchParams)(query),
2951
+ await this.rest.post(import_v1018.Routes.webhookPlatform(id, token, "github"), {
2952
+ query: (0, import_rest10.makeURLSearchParams)(query),
2843
2953
  body,
2844
2954
  signal,
2845
2955
  auth: false
@@ -2856,8 +2966,8 @@ var WebhooksAPI = class {
2856
2966
  * @param options - The options for fetching the message
2857
2967
  */
2858
2968
  async getMessage(id, token, messageId, query = {}, { signal } = {}) {
2859
- return this.rest.get(import_v1017.Routes.webhookMessage(id, token, messageId), {
2860
- query: (0, import_rest9.makeURLSearchParams)(query),
2969
+ return this.rest.get(import_v1018.Routes.webhookMessage(id, token, messageId), {
2970
+ query: (0, import_rest10.makeURLSearchParams)(query),
2861
2971
  auth: false,
2862
2972
  signal
2863
2973
  });
@@ -2872,14 +2982,9 @@ var WebhooksAPI = class {
2872
2982
  * @param body - The data for editing the message
2873
2983
  * @param options - The options for editing the message
2874
2984
  */
2875
- async editMessage(id, token, messageId, {
2876
- thread_id,
2877
- with_components,
2878
- files,
2879
- ...body
2880
- }, { signal } = {}) {
2881
- return this.rest.patch(import_v1017.Routes.webhookMessage(id, token, messageId), {
2882
- query: (0, import_rest9.makeURLSearchParams)({ thread_id, with_components }),
2985
+ async editMessage(id, token, messageId, { thread_id, with_components, files, ...body }, { signal } = {}) {
2986
+ return this.rest.patch(import_v1018.Routes.webhookMessage(id, token, messageId), {
2987
+ query: (0, import_rest10.makeURLSearchParams)({ thread_id, with_components }),
2883
2988
  auth: false,
2884
2989
  body,
2885
2990
  signal,
@@ -2897,8 +3002,8 @@ var WebhooksAPI = class {
2897
3002
  * @param options - The options for deleting the message
2898
3003
  */
2899
3004
  async deleteMessage(id, token, messageId, query = {}, { signal } = {}) {
2900
- await this.rest.delete(import_v1017.Routes.webhookMessage(id, token, messageId), {
2901
- query: (0, import_rest9.makeURLSearchParams)(query),
3005
+ await this.rest.delete(import_v1018.Routes.webhookMessage(id, token, messageId), {
3006
+ query: (0, import_rest10.makeURLSearchParams)(query),
2902
3007
  auth: false,
2903
3008
  signal
2904
3009
  });
@@ -2919,6 +3024,7 @@ var API = class {
2919
3024
  this.oauth2 = new OAuth2API(rest);
2920
3025
  this.poll = new PollAPI(rest);
2921
3026
  this.roleConnections = new RoleConnectionsAPI(rest);
3027
+ this.soundboardSounds = new SoundboardSoundsAPI(rest);
2922
3028
  this.stageInstances = new StageInstancesAPI(rest);
2923
3029
  this.stickers = new StickersAPI(rest);
2924
3030
  this.threads = new ThreadsAPI(rest);
@@ -2941,6 +3047,7 @@ var API = class {
2941
3047
  oauth2;
2942
3048
  poll;
2943
3049
  roleConnections;
3050
+ soundboardSounds;
2944
3051
  stageInstances;
2945
3052
  stickers;
2946
3053
  threads;
@@ -2968,7 +3075,7 @@ __name(withFiles, "withFiles");
2968
3075
 
2969
3076
  // src/http-only/index.ts
2970
3077
  __reExport(http_only_exports, require("discord-api-types/v10"), module.exports);
2971
- var version = "2.3.0";
3078
+ var version = "2.4.0";
2972
3079
  // Annotate the CommonJS export names for ESM import in node:
2973
3080
  0 && (module.exports = {
2974
3081
  API,
@@ -2983,6 +3090,7 @@ var version = "2.3.0";
2983
3090
  OAuth2API,
2984
3091
  PollAPI,
2985
3092
  RoleConnectionsAPI,
3093
+ SoundboardSoundsAPI,
2986
3094
  StageInstancesAPI,
2987
3095
  StickersAPI,
2988
3096
  ThreadsAPI,