@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.
@@ -753,6 +753,20 @@ var ChannelsAPI = class {
753
753
  signal
754
754
  });
755
755
  }
756
+ /**
757
+ * Sends a soundboard sound in a channel
758
+ *
759
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound}
760
+ * @param channelId - The id of the channel to send the soundboard sound in
761
+ * @param body - The data for sending the soundboard sound
762
+ * @param options - The options for sending the soundboard sound
763
+ */
764
+ async sendSoundboardSound(channelId, body, { signal } = {}) {
765
+ return this.rest.post(Routes3.sendSoundboardSound(channelId), {
766
+ body,
767
+ signal
768
+ });
769
+ }
756
770
  /**
757
771
  * Adds a recipient to a group DM channel
758
772
  *
@@ -977,7 +991,7 @@ var GuildsAPI = class {
977
991
  });
978
992
  }
979
993
  /**
980
- * Fetches all the members of a guild
994
+ * Fetches members of a guild.
981
995
  *
982
996
  * @see {@link https://discord.com/developers/docs/resources/guild#list-guild-members}
983
997
  * @param guildId - The id of the guild
@@ -1848,6 +1862,73 @@ var GuildsAPI = class {
1848
1862
  signal
1849
1863
  });
1850
1864
  }
1865
+ /**
1866
+ * Fetches all the soundboard sounds for a guild
1867
+ *
1868
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#list-guild-soundboard-sounds}
1869
+ * @param guildId - The id of the guild to fetch the soundboard sounds for
1870
+ * @param options - The options for fetching the soundboard sounds
1871
+ */
1872
+ async getSoundboardSounds(guildId, { signal } = {}) {
1873
+ return this.rest.get(Routes6.guildSoundboardSounds(guildId), {
1874
+ signal
1875
+ });
1876
+ }
1877
+ /**
1878
+ * Fetches a soundboard sound for a guild
1879
+ *
1880
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#get-guild-soundboard-sound}
1881
+ * @param guildId - The id of the guild to fetch the soundboard sound for
1882
+ * @param soundId - The id of the soundboard sound to fetch
1883
+ * @param options - The options for fetching the soundboard sound
1884
+ */
1885
+ async getSoundboardSound(guildId, soundId, { signal } = {}) {
1886
+ return this.rest.get(Routes6.guildSoundboardSound(guildId, soundId), {
1887
+ signal
1888
+ });
1889
+ }
1890
+ /**
1891
+ * Creates a new soundboard sound for a guild
1892
+ *
1893
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound}
1894
+ * @param guildId - The id of the guild to create the soundboard sound for
1895
+ * @param body - The data for creating the soundboard sound
1896
+ * @param options - The options for creating the soundboard sound
1897
+ */
1898
+ async createSoundboardSound(guildId, body, { reason, signal } = {}) {
1899
+ return this.rest.post(Routes6.guildSoundboardSounds(guildId), {
1900
+ body,
1901
+ reason,
1902
+ signal
1903
+ });
1904
+ }
1905
+ /**
1906
+ * Edits a soundboard sound for a guild
1907
+ *
1908
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound}
1909
+ * @param guildId - The id of the guild to edit the soundboard sound for
1910
+ * @param soundId - The id of the soundboard sound to edit
1911
+ * @param body - The data for editing the soundboard sound
1912
+ * @param options - The options for editing the soundboard sound
1913
+ */
1914
+ async editSoundboardSound(guildId, soundId, body, { reason, signal } = {}) {
1915
+ return this.rest.patch(Routes6.guildSoundboardSound(guildId, soundId), {
1916
+ body,
1917
+ reason,
1918
+ signal
1919
+ });
1920
+ }
1921
+ /**
1922
+ * Deletes a soundboard sound for a guild
1923
+ *
1924
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound}
1925
+ * @param guildId - The id of the guild to delete the soundboard sound for
1926
+ * @param soundId - The id of the soundboard sound to delete
1927
+ * @param options - The options for deleting the soundboard sound
1928
+ */
1929
+ async deleteSoundboardSound(guildId, soundId, { reason, signal } = {}) {
1930
+ await this.rest.delete(Routes6.guildSoundboardSound(guildId, soundId), { reason, signal });
1931
+ }
1851
1932
  /**
1852
1933
  * Modifies incident actions for a guild.
1853
1934
  *
@@ -1865,6 +1946,7 @@ var GuildsAPI = class {
1865
1946
  };
1866
1947
 
1867
1948
  // src/api/interactions.ts
1949
+ import { makeURLSearchParams as makeURLSearchParams4 } from "@discordjs/rest";
1868
1950
  import {
1869
1951
  InteractionResponseType,
1870
1952
  Routes as Routes7
@@ -1877,17 +1959,9 @@ var InteractionsAPI = class {
1877
1959
  static {
1878
1960
  __name(this, "InteractionsAPI");
1879
1961
  }
1880
- /**
1881
- * Replies to an interaction
1882
- *
1883
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1884
- * @param interactionId - The id of the interaction
1885
- * @param interactionToken - The token of the interaction
1886
- * @param body - The callback data for replying
1887
- * @param options - The options for replying
1888
- */
1889
- async reply(interactionId, interactionToken, { files, ...data }, { signal } = {}) {
1890
- await this.rest.post(Routes7.interactionCallback(interactionId, interactionToken), {
1962
+ async reply(interactionId, interactionToken, { files, with_response, ...data }, { signal } = {}) {
1963
+ const response = await this.rest.post(Routes7.interactionCallback(interactionId, interactionToken), {
1964
+ query: makeURLSearchParams4({ with_response }),
1891
1965
  files,
1892
1966
  auth: false,
1893
1967
  body: {
@@ -1896,18 +1970,11 @@ var InteractionsAPI = class {
1896
1970
  },
1897
1971
  signal
1898
1972
  });
1973
+ return with_response ? response : void 0;
1899
1974
  }
1900
- /**
1901
- * Defers the reply to an interaction
1902
- *
1903
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1904
- * @param interactionId - The id of the interaction
1905
- * @param interactionToken - The token of the interaction
1906
- * @param data - The data for deferring the reply
1907
- * @param options - The options for deferring
1908
- */
1909
- async defer(interactionId, interactionToken, data, { signal } = {}) {
1910
- await this.rest.post(Routes7.interactionCallback(interactionId, interactionToken), {
1975
+ async defer(interactionId, interactionToken, { with_response, ...data } = {}, { signal } = {}) {
1976
+ const response = await this.rest.post(Routes7.interactionCallback(interactionId, interactionToken), {
1977
+ query: makeURLSearchParams4({ with_response }),
1911
1978
  auth: false,
1912
1979
  body: {
1913
1980
  type: InteractionResponseType.DeferredChannelMessageWithSource,
@@ -1915,23 +1982,18 @@ var InteractionsAPI = class {
1915
1982
  },
1916
1983
  signal
1917
1984
  });
1985
+ return with_response ? response : void 0;
1918
1986
  }
1919
- /**
1920
- * Defers an update from a message component interaction
1921
- *
1922
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1923
- * @param interactionId - The id of the interaction
1924
- * @param interactionToken - The token of the interaction
1925
- * @param options - The options for deferring
1926
- */
1927
- async deferMessageUpdate(interactionId, interactionToken, { signal } = {}) {
1928
- await this.rest.post(Routes7.interactionCallback(interactionId, interactionToken), {
1987
+ async deferMessageUpdate(interactionId, interactionToken, { with_response } = {}, { signal } = {}) {
1988
+ const response = await this.rest.post(Routes7.interactionCallback(interactionId, interactionToken), {
1989
+ query: makeURLSearchParams4({ with_response }),
1929
1990
  auth: false,
1930
1991
  body: {
1931
1992
  type: InteractionResponseType.DeferredMessageUpdate
1932
1993
  },
1933
1994
  signal
1934
1995
  });
1996
+ return with_response ? response : void 0;
1935
1997
  }
1936
1998
  /**
1937
1999
  * Reply to a deferred interaction
@@ -1991,17 +2053,9 @@ var InteractionsAPI = class {
1991
2053
  async deleteReply(applicationId, interactionToken, messageId, { signal } = {}) {
1992
2054
  await this.webhooks.deleteMessage(applicationId, interactionToken, messageId ?? "@original", {}, { signal });
1993
2055
  }
1994
- /**
1995
- * Updates the message the component interaction was triggered on
1996
- *
1997
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1998
- * @param interactionId - The id of the interaction
1999
- * @param interactionToken - The token of the interaction
2000
- * @param callbackData - The callback data for updating the interaction
2001
- * @param options - The options for updating the interaction
2002
- */
2003
- async updateMessage(interactionId, interactionToken, { files, ...data }, { signal } = {}) {
2004
- await this.rest.post(Routes7.interactionCallback(interactionId, interactionToken), {
2056
+ async updateMessage(interactionId, interactionToken, { files, with_response, ...data }, { signal } = {}) {
2057
+ const response = await this.rest.post(Routes7.interactionCallback(interactionId, interactionToken), {
2058
+ query: makeURLSearchParams4({ with_response }),
2005
2059
  files,
2006
2060
  auth: false,
2007
2061
  body: {
@@ -2010,47 +2064,34 @@ var InteractionsAPI = class {
2010
2064
  },
2011
2065
  signal
2012
2066
  });
2067
+ return with_response ? response : void 0;
2013
2068
  }
2014
- /**
2015
- * Sends an autocomplete response to an interaction
2016
- *
2017
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
2018
- * @param interactionId - The id of the interaction
2019
- * @param interactionToken - The token of the interaction
2020
- * @param callbackData - The callback data for the autocomplete response
2021
- * @param options - The options for sending the autocomplete response
2022
- */
2023
- async createAutocompleteResponse(interactionId, interactionToken, callbackData, { signal } = {}) {
2024
- await this.rest.post(Routes7.interactionCallback(interactionId, interactionToken), {
2069
+ async createAutocompleteResponse(interactionId, interactionToken, { with_response, ...data }, { signal } = {}) {
2070
+ const response = await this.rest.post(Routes7.interactionCallback(interactionId, interactionToken), {
2071
+ query: makeURLSearchParams4({ with_response }),
2025
2072
  auth: false,
2026
2073
  body: {
2027
2074
  type: InteractionResponseType.ApplicationCommandAutocompleteResult,
2028
- data: callbackData
2075
+ data
2029
2076
  },
2030
2077
  signal
2031
2078
  });
2079
+ return with_response ? response : void 0;
2032
2080
  }
2033
- /**
2034
- * Sends a modal response to an interaction
2035
- *
2036
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
2037
- * @param interactionId - The id of the interaction
2038
- * @param interactionToken - The token of the interaction
2039
- * @param callbackData - The modal callback data to send
2040
- * @param options - The options for sending the modal
2041
- */
2042
- async createModal(interactionId, interactionToken, callbackData, { signal } = {}) {
2043
- await this.rest.post(Routes7.interactionCallback(interactionId, interactionToken), {
2081
+ async createModal(interactionId, interactionToken, { with_response, ...data }, { signal } = {}) {
2082
+ const response = await this.rest.post(Routes7.interactionCallback(interactionId, interactionToken), {
2083
+ query: makeURLSearchParams4({ with_response }),
2044
2084
  auth: false,
2045
2085
  body: {
2046
2086
  type: InteractionResponseType.Modal,
2047
- data: callbackData
2087
+ data
2048
2088
  },
2049
2089
  signal
2050
2090
  });
2091
+ return with_response ? response : void 0;
2051
2092
  }
2052
2093
  /**
2053
- * Sends a premium required response to an interaction
2094
+ * Launches an activity and returns an interaction callback object
2054
2095
  *
2055
2096
  * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
2056
2097
  * @param interactionId - The id of the interaction
@@ -2067,10 +2108,21 @@ var InteractionsAPI = class {
2067
2108
  signal
2068
2109
  });
2069
2110
  }
2111
+ async launchActivity(interactionId, interactionToken, { with_response } = {}, { signal } = {}) {
2112
+ const response = await this.rest.post(Routes7.interactionCallback(interactionId, interactionToken), {
2113
+ query: makeURLSearchParams4({ with_response }),
2114
+ auth: false,
2115
+ body: {
2116
+ type: InteractionResponseType.LaunchActivity
2117
+ },
2118
+ signal
2119
+ });
2120
+ return with_response ? response : void 0;
2121
+ }
2070
2122
  };
2071
2123
 
2072
2124
  // src/api/invite.ts
2073
- import { makeURLSearchParams as makeURLSearchParams4 } from "@discordjs/rest";
2125
+ import { makeURLSearchParams as makeURLSearchParams5 } from "@discordjs/rest";
2074
2126
  import { Routes as Routes8 } from "discord-api-types/v10";
2075
2127
  var InvitesAPI = class {
2076
2128
  constructor(rest) {
@@ -2089,7 +2141,7 @@ var InvitesAPI = class {
2089
2141
  */
2090
2142
  async get(code, query = {}, { signal } = {}) {
2091
2143
  return this.rest.get(Routes8.invite(code), {
2092
- query: makeURLSearchParams4(query),
2144
+ query: makeURLSearchParams5(query),
2093
2145
  signal
2094
2146
  });
2095
2147
  }
@@ -2106,7 +2158,7 @@ var InvitesAPI = class {
2106
2158
  };
2107
2159
 
2108
2160
  // src/api/monetization.ts
2109
- import { makeURLSearchParams as makeURLSearchParams5 } from "@discordjs/rest";
2161
+ import { makeURLSearchParams as makeURLSearchParams6 } from "@discordjs/rest";
2110
2162
  import {
2111
2163
  Routes as Routes9
2112
2164
  } from "discord-api-types/v10";
@@ -2120,30 +2172,71 @@ var MonetizationAPI = class {
2120
2172
  /**
2121
2173
  * Fetches the SKUs for an application.
2122
2174
  *
2123
- * @see {@link https://discord.com/developers/docs/monetization/skus#list-skus}
2175
+ * @see {@link https://discord.com/developers/docs/resources/sku#list-skus}
2176
+ * @param applicationId - The application id to fetch SKUs for
2124
2177
  * @param options - The options for fetching the SKUs.
2125
2178
  */
2126
2179
  async getSKUs(applicationId, { signal } = {}) {
2127
2180
  return this.rest.get(Routes9.skus(applicationId), { signal });
2128
2181
  }
2182
+ /**
2183
+ * Fetches subscriptions for an SKU.
2184
+ *
2185
+ * @see {@link https://discord.com/developers/docs/resources/subscription#list-sku-subscriptions}
2186
+ * @param skuId - The SKU id to fetch subscriptions for
2187
+ * @param query - The query options for fetching subscriptions
2188
+ * @param options - The options for fetching subscriptions
2189
+ */
2190
+ async getSKUSubscriptions(skuId, query = {}, { signal } = {}) {
2191
+ return this.rest.get(Routes9.skuSubscriptions(skuId), {
2192
+ signal,
2193
+ query: makeURLSearchParams6(query)
2194
+ });
2195
+ }
2196
+ /**
2197
+ * Fetches a subscription for an SKU.
2198
+ *
2199
+ * @see {@link https://discord.com/developers/docs/resources/subscription#get-sku-subscription}
2200
+ * @param skuId - The SKU id to fetch subscription for
2201
+ * @param subscriptionId - The subscription id to fetch
2202
+ * @param options - The options for fetching the subscription
2203
+ */
2204
+ async getSKUSubscription(skuId, subscriptionId, { signal } = {}) {
2205
+ return this.rest.get(Routes9.skuSubscription(skuId, subscriptionId), {
2206
+ signal
2207
+ });
2208
+ }
2129
2209
  /**
2130
2210
  * Fetches the entitlements for an application.
2131
2211
  *
2132
- * @see {@link https://discord.com/developers/docs/monetization/entitlements#list-entitlements}
2212
+ * @see {@link https://discord.com/developers/docs/resources/entitlement#list-entitlements}
2133
2213
  * @param applicationId - The application id to fetch entitlements for
2134
2214
  * @param query - The query options for fetching entitlements
2135
2215
  * @param options - The options for fetching entitlements
2136
2216
  */
2137
- async getEntitlements(applicationId, query, { signal } = {}) {
2217
+ async getEntitlements(applicationId, query = {}, { signal } = {}) {
2138
2218
  return this.rest.get(Routes9.entitlements(applicationId), {
2139
2219
  signal,
2140
- query: makeURLSearchParams5(query)
2220
+ query: makeURLSearchParams6(query)
2221
+ });
2222
+ }
2223
+ /**
2224
+ * Fetches an entitlement for an application.
2225
+ *
2226
+ * @see {@link https://discord.com/developers/docs/resources/entitlement#get-entitlement}
2227
+ * @param applicationId - The application id to fetch the entitlement for
2228
+ * @param entitlementId - The entitlement id to fetch
2229
+ * @param options - The options for fetching the entitlement
2230
+ */
2231
+ async getEntitlement(applicationId, entitlementId, { signal } = {}) {
2232
+ return this.rest.get(Routes9.entitlement(applicationId, entitlementId), {
2233
+ signal
2141
2234
  });
2142
2235
  }
2143
2236
  /**
2144
2237
  * Creates a test entitlement for an application's SKU.
2145
2238
  *
2146
- * @see {@link https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement}
2239
+ * @see {@link https://discord.com/developers/docs/resources/entitlement#create-test-entitlement}
2147
2240
  * @param applicationId - The application id to create the entitlement for
2148
2241
  * @param body - The data for creating the entitlement
2149
2242
  * @param options - The options for creating the entitlement
@@ -2157,7 +2250,7 @@ var MonetizationAPI = class {
2157
2250
  /**
2158
2251
  * Deletes a test entitlement for an application's SKU.
2159
2252
  *
2160
- * @see {@link https://discord.com/developers/docs/monetization/entitlements#delete-test-entitlement}
2253
+ * @see {@link https://discord.com/developers/docs/resources/entitlement#delete-test-entitlement}
2161
2254
  * @param applicationId - The application id to delete the entitlement for
2162
2255
  * @param entitlementId - The entitlement id to delete
2163
2256
  * @param options - The options for deleting the entitlement
@@ -2168,7 +2261,7 @@ var MonetizationAPI = class {
2168
2261
  /**
2169
2262
  * Marks a given entitlement for the user as consumed. Only available for One-Time Purchase consumable SKUs.
2170
2263
  *
2171
- * @see {@link https://discord.com/developers/docs/monetization/entitlements#consume-an-entitlement}
2264
+ * @see {@link https://discord.com/developers/docs/resources/entitlement#consume-an-entitlement}
2172
2265
  * @param applicationId - The application id to consume the entitlement for
2173
2266
  * @param entitlementId - The entitlement id to consume
2174
2267
  * @param options - The options for consuming the entitlement
@@ -2179,7 +2272,7 @@ var MonetizationAPI = class {
2179
2272
  };
2180
2273
 
2181
2274
  // src/api/oauth2.ts
2182
- import { makeURLSearchParams as makeURLSearchParams6 } from "@discordjs/rest";
2275
+ import { makeURLSearchParams as makeURLSearchParams7 } from "@discordjs/rest";
2183
2276
  import {
2184
2277
  Routes as Routes10,
2185
2278
  RouteBases
@@ -2199,7 +2292,7 @@ var OAuth2API = class {
2199
2292
  */
2200
2293
  generateAuthorizationURL(options) {
2201
2294
  const url = new URL(`${RouteBases.api}${Routes10.oauth2Authorization()}`);
2202
- url.search = makeURLSearchParams6(options).toString();
2295
+ url.search = makeURLSearchParams7(options).toString();
2203
2296
  return url.toString();
2204
2297
  }
2205
2298
  /**
@@ -2211,7 +2304,7 @@ var OAuth2API = class {
2211
2304
  */
2212
2305
  async tokenExchange(body, { signal } = {}) {
2213
2306
  return this.rest.post(Routes10.oauth2TokenExchange(), {
2214
- body: makeURLSearchParams6(body),
2307
+ body: makeURLSearchParams7(body),
2215
2308
  passThroughBody: true,
2216
2309
  headers: {
2217
2310
  "Content-Type": "application/x-www-form-urlencoded"
@@ -2229,7 +2322,7 @@ var OAuth2API = class {
2229
2322
  */
2230
2323
  async refreshToken(body, { signal } = {}) {
2231
2324
  return this.rest.post(Routes10.oauth2TokenExchange(), {
2232
- body: makeURLSearchParams6(body),
2325
+ body: makeURLSearchParams7(body),
2233
2326
  passThroughBody: true,
2234
2327
  headers: {
2235
2328
  "Content-Type": "application/x-www-form-urlencoded"
@@ -2249,7 +2342,7 @@ var OAuth2API = class {
2249
2342
  */
2250
2343
  async getToken(body, { signal } = {}) {
2251
2344
  return this.rest.post(Routes10.oauth2TokenExchange(), {
2252
- body: makeURLSearchParams6(body),
2345
+ body: makeURLSearchParams7(body),
2253
2346
  passThroughBody: true,
2254
2347
  headers: {
2255
2348
  "Content-Type": "application/x-www-form-urlencoded"
@@ -2291,7 +2384,7 @@ var OAuth2API = class {
2291
2384
  */
2292
2385
  async revokeToken(applicationId, applicationSecret, body, { signal } = {}) {
2293
2386
  await this.rest.post(Routes10.oauth2TokenRevocation(), {
2294
- body: makeURLSearchParams6(body),
2387
+ body: makeURLSearchParams7(body),
2295
2388
  passThroughBody: true,
2296
2389
  headers: {
2297
2390
  Authorization: `Basic ${btoa(`${applicationId}:${applicationSecret}`)}`,
@@ -2304,7 +2397,7 @@ var OAuth2API = class {
2304
2397
  };
2305
2398
 
2306
2399
  // src/api/poll.ts
2307
- import { makeURLSearchParams as makeURLSearchParams7 } from "@discordjs/rest";
2400
+ import { makeURLSearchParams as makeURLSearchParams8 } from "@discordjs/rest";
2308
2401
  import {
2309
2402
  Routes as Routes11
2310
2403
  } from "discord-api-types/v10";
@@ -2325,10 +2418,10 @@ var PollAPI = class {
2325
2418
  * @param query - The query for getting the list of voters
2326
2419
  * @param options - The options for getting the list of voters
2327
2420
  */
2328
- async getAnswerVoters(channelId, messageId, answerId, query, { signal } = {}) {
2421
+ async getAnswerVoters(channelId, messageId, answerId, query = {}, { signal } = {}) {
2329
2422
  return this.rest.get(Routes11.pollAnswerVoters(channelId, messageId, answerId), {
2330
2423
  signal,
2331
- query: makeURLSearchParams7(query)
2424
+ query: makeURLSearchParams8(query)
2332
2425
  });
2333
2426
  }
2334
2427
  /**
@@ -2385,9 +2478,31 @@ var RoleConnectionsAPI = class {
2385
2478
  }
2386
2479
  };
2387
2480
 
2481
+ // src/api/soundboardSounds.ts
2482
+ import { Routes as Routes13 } from "discord-api-types/v10";
2483
+ var SoundboardSoundsAPI = class {
2484
+ constructor(rest) {
2485
+ this.rest = rest;
2486
+ }
2487
+ static {
2488
+ __name(this, "SoundboardSoundsAPI");
2489
+ }
2490
+ /**
2491
+ * Fetches all the soundboard default sounds.
2492
+ *
2493
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#list-default-soundboard-sounds}
2494
+ * @param options - The options for fetching the soundboard default sounds.
2495
+ */
2496
+ async getSoundboardDefaultSounds({ signal } = {}) {
2497
+ return this.rest.get(Routes13.soundboardDefaultSounds(), {
2498
+ signal
2499
+ });
2500
+ }
2501
+ };
2502
+
2388
2503
  // src/api/stageInstances.ts
2389
2504
  import {
2390
- Routes as Routes13
2505
+ Routes as Routes14
2391
2506
  } from "discord-api-types/v10";
2392
2507
  var StageInstancesAPI = class {
2393
2508
  constructor(rest) {
@@ -2404,7 +2519,7 @@ var StageInstancesAPI = class {
2404
2519
  * @param options - The options for creating the new stage instance
2405
2520
  */
2406
2521
  async create(body, { reason, signal } = {}) {
2407
- return this.rest.post(Routes13.stageInstances(), {
2522
+ return this.rest.post(Routes14.stageInstances(), {
2408
2523
  body,
2409
2524
  reason,
2410
2525
  signal
@@ -2418,7 +2533,7 @@ var StageInstancesAPI = class {
2418
2533
  * @param options - The options for fetching the stage instance
2419
2534
  */
2420
2535
  async get(channelId, { signal } = {}) {
2421
- return this.rest.get(Routes13.stageInstance(channelId), { signal });
2536
+ return this.rest.get(Routes14.stageInstance(channelId), { signal });
2422
2537
  }
2423
2538
  /**
2424
2539
  * Edits a stage instance
@@ -2429,7 +2544,7 @@ var StageInstancesAPI = class {
2429
2544
  * @param options - The options for editing the stage instance
2430
2545
  */
2431
2546
  async edit(channelId, body, { reason, signal } = {}) {
2432
- return this.rest.patch(Routes13.stageInstance(channelId), {
2547
+ return this.rest.patch(Routes14.stageInstance(channelId), {
2433
2548
  body,
2434
2549
  reason,
2435
2550
  signal
@@ -2443,13 +2558,13 @@ var StageInstancesAPI = class {
2443
2558
  * @param options - The options for deleting the stage instance
2444
2559
  */
2445
2560
  async delete(channelId, { reason, signal } = {}) {
2446
- await this.rest.delete(Routes13.stageInstance(channelId), { reason, signal });
2561
+ await this.rest.delete(Routes14.stageInstance(channelId), { reason, signal });
2447
2562
  }
2448
2563
  };
2449
2564
 
2450
2565
  // src/api/sticker.ts
2451
2566
  import {
2452
- Routes as Routes14
2567
+ Routes as Routes15
2453
2568
  } from "discord-api-types/v10";
2454
2569
  var StickersAPI = class {
2455
2570
  constructor(rest) {
@@ -2466,7 +2581,7 @@ var StickersAPI = class {
2466
2581
  * @param options - The options for fetching the sticker pack
2467
2582
  */
2468
2583
  async getStickerPack(packId, { signal } = {}) {
2469
- return this.rest.get(Routes14.stickerPack(packId), { signal });
2584
+ return this.rest.get(Routes15.stickerPack(packId), { signal });
2470
2585
  }
2471
2586
  /**
2472
2587
  * Fetches all of the sticker packs
@@ -2475,7 +2590,7 @@ var StickersAPI = class {
2475
2590
  * @param options - The options for fetching the sticker packs
2476
2591
  */
2477
2592
  async getStickers({ signal } = {}) {
2478
- return this.rest.get(Routes14.stickerPacks(), { signal });
2593
+ return this.rest.get(Routes15.stickerPacks(), { signal });
2479
2594
  }
2480
2595
  /**
2481
2596
  * Fetches all of the sticker packs
@@ -2495,13 +2610,13 @@ var StickersAPI = class {
2495
2610
  * @param options - The options for fetching the sticker
2496
2611
  */
2497
2612
  async get(stickerId, { signal } = {}) {
2498
- return this.rest.get(Routes14.sticker(stickerId), { signal });
2613
+ return this.rest.get(Routes15.sticker(stickerId), { signal });
2499
2614
  }
2500
2615
  };
2501
2616
 
2502
2617
  // src/api/thread.ts
2503
2618
  import {
2504
- Routes as Routes15
2619
+ Routes as Routes16
2505
2620
  } from "discord-api-types/v10";
2506
2621
  var ThreadsAPI = class {
2507
2622
  constructor(rest) {
@@ -2518,7 +2633,7 @@ var ThreadsAPI = class {
2518
2633
  * @param options - The options for joining the thread
2519
2634
  */
2520
2635
  async join(threadId, { signal } = {}) {
2521
- await this.rest.put(Routes15.threadMembers(threadId, "@me"), { signal });
2636
+ await this.rest.put(Routes16.threadMembers(threadId, "@me"), { signal });
2522
2637
  }
2523
2638
  /**
2524
2639
  * Adds a member to a thread
@@ -2529,7 +2644,7 @@ var ThreadsAPI = class {
2529
2644
  * @param options - The options for adding the member to the thread
2530
2645
  */
2531
2646
  async addMember(threadId, userId, { signal } = {}) {
2532
- await this.rest.put(Routes15.threadMembers(threadId, userId), { signal });
2647
+ await this.rest.put(Routes16.threadMembers(threadId, userId), { signal });
2533
2648
  }
2534
2649
  /**
2535
2650
  * Removes the current user from a thread
@@ -2539,7 +2654,7 @@ var ThreadsAPI = class {
2539
2654
  * @param options - The options for leaving the thread
2540
2655
  */
2541
2656
  async leave(threadId, { signal } = {}) {
2542
- await this.rest.delete(Routes15.threadMembers(threadId, "@me"), { signal });
2657
+ await this.rest.delete(Routes16.threadMembers(threadId, "@me"), { signal });
2543
2658
  }
2544
2659
  /**
2545
2660
  * Removes a member from a thread
@@ -2550,7 +2665,7 @@ var ThreadsAPI = class {
2550
2665
  * @param options - The options for removing the member from the thread
2551
2666
  */
2552
2667
  async removeMember(threadId, userId, { signal } = {}) {
2553
- await this.rest.delete(Routes15.threadMembers(threadId, userId), { signal });
2668
+ await this.rest.delete(Routes16.threadMembers(threadId, userId), { signal });
2554
2669
  }
2555
2670
  /**
2556
2671
  * Fetches a member of a thread
@@ -2561,7 +2676,7 @@ var ThreadsAPI = class {
2561
2676
  * @param options - The options for fetching the member
2562
2677
  */
2563
2678
  async getMember(threadId, userId, { signal } = {}) {
2564
- return this.rest.get(Routes15.threadMembers(threadId, userId), { signal });
2679
+ return this.rest.get(Routes16.threadMembers(threadId, userId), { signal });
2565
2680
  }
2566
2681
  /**
2567
2682
  * Fetches all members of a thread
@@ -2571,14 +2686,14 @@ var ThreadsAPI = class {
2571
2686
  * @param options - The options for fetching the members
2572
2687
  */
2573
2688
  async getAllMembers(threadId, { signal } = {}) {
2574
- return this.rest.get(Routes15.threadMembers(threadId), { signal });
2689
+ return this.rest.get(Routes16.threadMembers(threadId), { signal });
2575
2690
  }
2576
2691
  };
2577
2692
 
2578
2693
  // src/api/user.ts
2579
- import { makeURLSearchParams as makeURLSearchParams8 } from "@discordjs/rest";
2694
+ import { makeURLSearchParams as makeURLSearchParams9 } from "@discordjs/rest";
2580
2695
  import {
2581
- Routes as Routes16
2696
+ Routes as Routes17
2582
2697
  } from "discord-api-types/v10";
2583
2698
  var UsersAPI = class {
2584
2699
  constructor(rest) {
@@ -2595,7 +2710,7 @@ var UsersAPI = class {
2595
2710
  * @param options - The options for fetching the user
2596
2711
  */
2597
2712
  async get(userId, { signal } = {}) {
2598
- return this.rest.get(Routes16.user(userId), { signal });
2713
+ return this.rest.get(Routes17.user(userId), { signal });
2599
2714
  }
2600
2715
  /**
2601
2716
  * Returns the user object of the requester's account
@@ -2604,7 +2719,7 @@ var UsersAPI = class {
2604
2719
  * @param options - The options for fetching the current user
2605
2720
  */
2606
2721
  async getCurrent({ signal } = {}) {
2607
- return this.rest.get(Routes16.user("@me"), { signal });
2722
+ return this.rest.get(Routes17.user("@me"), { signal });
2608
2723
  }
2609
2724
  /**
2610
2725
  * Returns a list of partial guild objects the current user is a member of
@@ -2614,8 +2729,8 @@ var UsersAPI = class {
2614
2729
  * @param options - The options for fetching the guilds
2615
2730
  */
2616
2731
  async getGuilds(query = {}, { signal } = {}) {
2617
- return this.rest.get(Routes16.userGuilds(), {
2618
- query: makeURLSearchParams8(query),
2732
+ return this.rest.get(Routes17.userGuilds(), {
2733
+ query: makeURLSearchParams9(query),
2619
2734
  signal
2620
2735
  });
2621
2736
  }
@@ -2627,7 +2742,7 @@ var UsersAPI = class {
2627
2742
  * @param options - The options for leaving the guild
2628
2743
  */
2629
2744
  async leaveGuild(guildId, { signal } = {}) {
2630
- await this.rest.delete(Routes16.userGuild(guildId), { signal });
2745
+ await this.rest.delete(Routes17.userGuild(guildId), { signal });
2631
2746
  }
2632
2747
  /**
2633
2748
  * Edits the current user
@@ -2637,7 +2752,7 @@ var UsersAPI = class {
2637
2752
  * @param options - The options for editing the user
2638
2753
  */
2639
2754
  async edit(body, { signal } = {}) {
2640
- return this.rest.patch(Routes16.user("@me"), { body, signal });
2755
+ return this.rest.patch(Routes17.user("@me"), { body, signal });
2641
2756
  }
2642
2757
  /**
2643
2758
  * Fetches the guild member for the current user
@@ -2647,7 +2762,7 @@ var UsersAPI = class {
2647
2762
  * @param options - The options for fetching the guild member
2648
2763
  */
2649
2764
  async getGuildMember(guildId, { signal } = {}) {
2650
- return this.rest.get(Routes16.userGuildMember(guildId), { signal });
2765
+ return this.rest.get(Routes17.userGuildMember(guildId), { signal });
2651
2766
  }
2652
2767
  /**
2653
2768
  * Edits the guild member for the current user
@@ -2658,7 +2773,7 @@ var UsersAPI = class {
2658
2773
  * @param options - The options for editing the guild member
2659
2774
  */
2660
2775
  async editCurrentGuildMember(guildId, body = {}, { reason, signal } = {}) {
2661
- return this.rest.patch(Routes16.guildMember(guildId, "@me"), {
2776
+ return this.rest.patch(Routes17.guildMember(guildId, "@me"), {
2662
2777
  reason,
2663
2778
  body,
2664
2779
  signal
@@ -2672,7 +2787,7 @@ var UsersAPI = class {
2672
2787
  * @param options - The options for opening the DM
2673
2788
  */
2674
2789
  async createDM(userId, { signal } = {}) {
2675
- return this.rest.post(Routes16.userChannels(), {
2790
+ return this.rest.post(Routes17.userChannels(), {
2676
2791
  body: { recipient_id: userId },
2677
2792
  signal
2678
2793
  });
@@ -2684,7 +2799,7 @@ var UsersAPI = class {
2684
2799
  * @param options - The options for fetching the user's connections
2685
2800
  */
2686
2801
  async getConnections({ signal } = {}) {
2687
- return this.rest.get(Routes16.userConnections(), { signal });
2802
+ return this.rest.get(Routes17.userConnections(), { signal });
2688
2803
  }
2689
2804
  /**
2690
2805
  * Gets the current user's active application role connection
@@ -2694,7 +2809,7 @@ var UsersAPI = class {
2694
2809
  * @param options - The options for fetching the role connections
2695
2810
  */
2696
2811
  async getApplicationRoleConnection(applicationId, { signal } = {}) {
2697
- return this.rest.get(Routes16.userApplicationRoleConnection(applicationId), {
2812
+ return this.rest.get(Routes17.userApplicationRoleConnection(applicationId), {
2698
2813
  signal
2699
2814
  });
2700
2815
  }
@@ -2707,7 +2822,7 @@ var UsersAPI = class {
2707
2822
  * @param options - The options for updating the application role connection
2708
2823
  */
2709
2824
  async updateApplicationRoleConnection(applicationId, body, { signal } = {}) {
2710
- return this.rest.put(Routes16.userApplicationRoleConnection(applicationId), {
2825
+ return this.rest.put(Routes17.userApplicationRoleConnection(applicationId), {
2711
2826
  body,
2712
2827
  signal
2713
2828
  });
@@ -2715,9 +2830,9 @@ var UsersAPI = class {
2715
2830
  };
2716
2831
 
2717
2832
  // src/api/webhook.ts
2718
- import { makeURLSearchParams as makeURLSearchParams9 } from "@discordjs/rest";
2833
+ import { makeURLSearchParams as makeURLSearchParams10 } from "@discordjs/rest";
2719
2834
  import {
2720
- Routes as Routes17
2835
+ Routes as Routes18
2721
2836
  } from "discord-api-types/v10";
2722
2837
  var WebhooksAPI = class {
2723
2838
  constructor(rest) {
@@ -2735,7 +2850,7 @@ var WebhooksAPI = class {
2735
2850
  * @param options - The options for fetching the webhook
2736
2851
  */
2737
2852
  async get(id, { token, signal } = {}) {
2738
- return this.rest.get(Routes17.webhook(id, token), {
2853
+ return this.rest.get(Routes18.webhook(id, token), {
2739
2854
  signal,
2740
2855
  auth: !token
2741
2856
  });
@@ -2750,7 +2865,7 @@ var WebhooksAPI = class {
2750
2865
  * @param options - The options for editing the webhook
2751
2866
  */
2752
2867
  async edit(id, body, { token, reason, signal } = {}) {
2753
- return this.rest.patch(Routes17.webhook(id, token), {
2868
+ return this.rest.patch(Routes18.webhook(id, token), {
2754
2869
  reason,
2755
2870
  body,
2756
2871
  signal,
@@ -2766,7 +2881,7 @@ var WebhooksAPI = class {
2766
2881
  * @param options - The options for deleting the webhook
2767
2882
  */
2768
2883
  async delete(id, { token, reason, signal } = {}) {
2769
- await this.rest.delete(Routes17.webhook(id, token), {
2884
+ await this.rest.delete(Routes18.webhook(id, token), {
2770
2885
  reason,
2771
2886
  signal,
2772
2887
  auth: !token
@@ -2781,15 +2896,9 @@ var WebhooksAPI = class {
2781
2896
  * @param body - The data for executing the webhook
2782
2897
  * @param options - The options for executing the webhook
2783
2898
  */
2784
- async execute(id, token, {
2785
- wait,
2786
- thread_id,
2787
- with_components,
2788
- files,
2789
- ...body
2790
- }, { signal } = {}) {
2791
- return this.rest.post(Routes17.webhook(id, token), {
2792
- query: makeURLSearchParams9({ wait, thread_id, with_components }),
2899
+ async execute(id, token, { wait, thread_id, with_components, files, ...body }, { signal } = {}) {
2900
+ return this.rest.post(Routes18.webhook(id, token), {
2901
+ query: makeURLSearchParams10({ wait, thread_id, with_components }),
2793
2902
  files,
2794
2903
  body,
2795
2904
  auth: false,
@@ -2808,8 +2917,8 @@ var WebhooksAPI = class {
2808
2917
  * @param options - The options for executing the webhook
2809
2918
  */
2810
2919
  async executeSlack(id, token, body, query = {}, { signal } = {}) {
2811
- await this.rest.post(Routes17.webhookPlatform(id, token, "slack"), {
2812
- query: makeURLSearchParams9(query),
2920
+ await this.rest.post(Routes18.webhookPlatform(id, token, "slack"), {
2921
+ query: makeURLSearchParams10(query),
2813
2922
  body,
2814
2923
  auth: false,
2815
2924
  signal
@@ -2826,8 +2935,8 @@ var WebhooksAPI = class {
2826
2935
  * @param options - The options for executing the webhook
2827
2936
  */
2828
2937
  async executeGitHub(id, token, body, query = {}, { signal } = {}) {
2829
- await this.rest.post(Routes17.webhookPlatform(id, token, "github"), {
2830
- query: makeURLSearchParams9(query),
2938
+ await this.rest.post(Routes18.webhookPlatform(id, token, "github"), {
2939
+ query: makeURLSearchParams10(query),
2831
2940
  body,
2832
2941
  signal,
2833
2942
  auth: false
@@ -2844,8 +2953,8 @@ var WebhooksAPI = class {
2844
2953
  * @param options - The options for fetching the message
2845
2954
  */
2846
2955
  async getMessage(id, token, messageId, query = {}, { signal } = {}) {
2847
- return this.rest.get(Routes17.webhookMessage(id, token, messageId), {
2848
- query: makeURLSearchParams9(query),
2956
+ return this.rest.get(Routes18.webhookMessage(id, token, messageId), {
2957
+ query: makeURLSearchParams10(query),
2849
2958
  auth: false,
2850
2959
  signal
2851
2960
  });
@@ -2860,14 +2969,9 @@ var WebhooksAPI = class {
2860
2969
  * @param body - The data for editing the message
2861
2970
  * @param options - The options for editing the message
2862
2971
  */
2863
- async editMessage(id, token, messageId, {
2864
- thread_id,
2865
- with_components,
2866
- files,
2867
- ...body
2868
- }, { signal } = {}) {
2869
- return this.rest.patch(Routes17.webhookMessage(id, token, messageId), {
2870
- query: makeURLSearchParams9({ thread_id, with_components }),
2972
+ async editMessage(id, token, messageId, { thread_id, with_components, files, ...body }, { signal } = {}) {
2973
+ return this.rest.patch(Routes18.webhookMessage(id, token, messageId), {
2974
+ query: makeURLSearchParams10({ thread_id, with_components }),
2871
2975
  auth: false,
2872
2976
  body,
2873
2977
  signal,
@@ -2885,8 +2989,8 @@ var WebhooksAPI = class {
2885
2989
  * @param options - The options for deleting the message
2886
2990
  */
2887
2991
  async deleteMessage(id, token, messageId, query = {}, { signal } = {}) {
2888
- await this.rest.delete(Routes17.webhookMessage(id, token, messageId), {
2889
- query: makeURLSearchParams9(query),
2992
+ await this.rest.delete(Routes18.webhookMessage(id, token, messageId), {
2993
+ query: makeURLSearchParams10(query),
2890
2994
  auth: false,
2891
2995
  signal
2892
2996
  });
@@ -2907,6 +3011,7 @@ var API = class {
2907
3011
  this.oauth2 = new OAuth2API(rest);
2908
3012
  this.poll = new PollAPI(rest);
2909
3013
  this.roleConnections = new RoleConnectionsAPI(rest);
3014
+ this.soundboardSounds = new SoundboardSoundsAPI(rest);
2910
3015
  this.stageInstances = new StageInstancesAPI(rest);
2911
3016
  this.stickers = new StickersAPI(rest);
2912
3017
  this.threads = new ThreadsAPI(rest);
@@ -2929,6 +3034,7 @@ var API = class {
2929
3034
  oauth2;
2930
3035
  poll;
2931
3036
  roleConnections;
3037
+ soundboardSounds;
2932
3038
  stageInstances;
2933
3039
  stickers;
2934
3040
  threads;
@@ -2956,7 +3062,7 @@ __name(withFiles, "withFiles");
2956
3062
 
2957
3063
  // src/http-only/index.ts
2958
3064
  export * from "discord-api-types/v10";
2959
- var version = "2.3.0";
3065
+ var version = "2.4.0";
2960
3066
  export {
2961
3067
  API,
2962
3068
  ApplicationCommandsAPI,
@@ -2970,6 +3076,7 @@ export {
2970
3076
  OAuth2API,
2971
3077
  PollAPI,
2972
3078
  RoleConnectionsAPI,
3079
+ SoundboardSoundsAPI,
2973
3080
  StageInstancesAPI,
2974
3081
  StickersAPI,
2975
3082
  ThreadsAPI,