@discordjs/core 2.3.0 → 2.5.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
@@ -1764,6 +1779,20 @@ var GuildsAPI = class {
1764
1779
  signal
1765
1780
  });
1766
1781
  }
1782
+ /**
1783
+ * Searches for messages.
1784
+ *
1785
+ * @see {@link https://docs.discord.com/developers/resources/message#search-guild-messages}
1786
+ * @param guildId - The id of the guild to search in
1787
+ * @param query - The query to search for
1788
+ * @param options - The options for searching for messages
1789
+ */
1790
+ async searchForMessages(guildId, query, { signal } = {}) {
1791
+ return this.rest.get(import_v106.Routes.guildMessagesSearch(guildId), {
1792
+ query: (0, import_rest3.makeURLSearchParams)(query),
1793
+ signal
1794
+ });
1795
+ }
1767
1796
  /**
1768
1797
  * Edits a guild member
1769
1798
  *
@@ -1882,6 +1911,73 @@ var GuildsAPI = class {
1882
1911
  signal
1883
1912
  });
1884
1913
  }
1914
+ /**
1915
+ * Fetches all the soundboard sounds for a guild
1916
+ *
1917
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#list-guild-soundboard-sounds}
1918
+ * @param guildId - The id of the guild to fetch the soundboard sounds for
1919
+ * @param options - The options for fetching the soundboard sounds
1920
+ */
1921
+ async getSoundboardSounds(guildId, { signal } = {}) {
1922
+ return this.rest.get(import_v106.Routes.guildSoundboardSounds(guildId), {
1923
+ signal
1924
+ });
1925
+ }
1926
+ /**
1927
+ * Fetches a soundboard sound for a guild
1928
+ *
1929
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#get-guild-soundboard-sound}
1930
+ * @param guildId - The id of the guild to fetch the soundboard sound for
1931
+ * @param soundId - The id of the soundboard sound to fetch
1932
+ * @param options - The options for fetching the soundboard sound
1933
+ */
1934
+ async getSoundboardSound(guildId, soundId, { signal } = {}) {
1935
+ return this.rest.get(import_v106.Routes.guildSoundboardSound(guildId, soundId), {
1936
+ signal
1937
+ });
1938
+ }
1939
+ /**
1940
+ * Creates a new soundboard sound for a guild
1941
+ *
1942
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound}
1943
+ * @param guildId - The id of the guild to create the soundboard sound for
1944
+ * @param body - The data for creating the soundboard sound
1945
+ * @param options - The options for creating the soundboard sound
1946
+ */
1947
+ async createSoundboardSound(guildId, body, { reason, signal } = {}) {
1948
+ return this.rest.post(import_v106.Routes.guildSoundboardSounds(guildId), {
1949
+ body,
1950
+ reason,
1951
+ signal
1952
+ });
1953
+ }
1954
+ /**
1955
+ * Edits a soundboard sound for a guild
1956
+ *
1957
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound}
1958
+ * @param guildId - The id of the guild to edit the soundboard sound for
1959
+ * @param soundId - The id of the soundboard sound to edit
1960
+ * @param body - The data for editing the soundboard sound
1961
+ * @param options - The options for editing the soundboard sound
1962
+ */
1963
+ async editSoundboardSound(guildId, soundId, body, { reason, signal } = {}) {
1964
+ return this.rest.patch(import_v106.Routes.guildSoundboardSound(guildId, soundId), {
1965
+ body,
1966
+ reason,
1967
+ signal
1968
+ });
1969
+ }
1970
+ /**
1971
+ * Deletes a soundboard sound for a guild
1972
+ *
1973
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound}
1974
+ * @param guildId - The id of the guild to delete the soundboard sound for
1975
+ * @param soundId - The id of the soundboard sound to delete
1976
+ * @param options - The options for deleting the soundboard sound
1977
+ */
1978
+ async deleteSoundboardSound(guildId, soundId, { reason, signal } = {}) {
1979
+ await this.rest.delete(import_v106.Routes.guildSoundboardSound(guildId, soundId), { reason, signal });
1980
+ }
1885
1981
  /**
1886
1982
  * Modifies incident actions for a guild.
1887
1983
  *
@@ -1899,6 +1995,7 @@ var GuildsAPI = class {
1899
1995
  };
1900
1996
 
1901
1997
  // src/api/interactions.ts
1998
+ var import_rest4 = require("@discordjs/rest");
1902
1999
  var import_v107 = require("discord-api-types/v10");
1903
2000
  var InteractionsAPI = class {
1904
2001
  constructor(rest, webhooks) {
@@ -1908,17 +2005,9 @@ var InteractionsAPI = class {
1908
2005
  static {
1909
2006
  __name(this, "InteractionsAPI");
1910
2007
  }
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), {
2008
+ async reply(interactionId, interactionToken, { files, with_response, ...data }, { signal } = {}) {
2009
+ const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
2010
+ query: (0, import_rest4.makeURLSearchParams)({ with_response }),
1922
2011
  files,
1923
2012
  auth: false,
1924
2013
  body: {
@@ -1927,18 +2016,11 @@ var InteractionsAPI = class {
1927
2016
  },
1928
2017
  signal
1929
2018
  });
2019
+ return with_response ? response : void 0;
1930
2020
  }
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), {
2021
+ async defer(interactionId, interactionToken, { with_response, ...data } = {}, { signal } = {}) {
2022
+ const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
2023
+ query: (0, import_rest4.makeURLSearchParams)({ with_response }),
1942
2024
  auth: false,
1943
2025
  body: {
1944
2026
  type: import_v107.InteractionResponseType.DeferredChannelMessageWithSource,
@@ -1946,23 +2028,18 @@ var InteractionsAPI = class {
1946
2028
  },
1947
2029
  signal
1948
2030
  });
2031
+ return with_response ? response : void 0;
1949
2032
  }
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), {
2033
+ async deferMessageUpdate(interactionId, interactionToken, { with_response } = {}, { signal } = {}) {
2034
+ const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
2035
+ query: (0, import_rest4.makeURLSearchParams)({ with_response }),
1960
2036
  auth: false,
1961
2037
  body: {
1962
2038
  type: import_v107.InteractionResponseType.DeferredMessageUpdate
1963
2039
  },
1964
2040
  signal
1965
2041
  });
2042
+ return with_response ? response : void 0;
1966
2043
  }
1967
2044
  /**
1968
2045
  * Reply to a deferred interaction
@@ -2022,17 +2099,9 @@ var InteractionsAPI = class {
2022
2099
  async deleteReply(applicationId, interactionToken, messageId, { signal } = {}) {
2023
2100
  await this.webhooks.deleteMessage(applicationId, interactionToken, messageId ?? "@original", {}, { signal });
2024
2101
  }
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), {
2102
+ async updateMessage(interactionId, interactionToken, { files, with_response, ...data }, { signal } = {}) {
2103
+ const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
2104
+ query: (0, import_rest4.makeURLSearchParams)({ with_response }),
2036
2105
  files,
2037
2106
  auth: false,
2038
2107
  body: {
@@ -2041,47 +2110,34 @@ var InteractionsAPI = class {
2041
2110
  },
2042
2111
  signal
2043
2112
  });
2113
+ return with_response ? response : void 0;
2044
2114
  }
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), {
2115
+ async createAutocompleteResponse(interactionId, interactionToken, { with_response, ...data }, { signal } = {}) {
2116
+ const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
2117
+ query: (0, import_rest4.makeURLSearchParams)({ with_response }),
2056
2118
  auth: false,
2057
2119
  body: {
2058
2120
  type: import_v107.InteractionResponseType.ApplicationCommandAutocompleteResult,
2059
- data: callbackData
2121
+ data
2060
2122
  },
2061
2123
  signal
2062
2124
  });
2125
+ return with_response ? response : void 0;
2063
2126
  }
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), {
2127
+ async createModal(interactionId, interactionToken, { with_response, ...data }, { signal } = {}) {
2128
+ const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
2129
+ query: (0, import_rest4.makeURLSearchParams)({ with_response }),
2075
2130
  auth: false,
2076
2131
  body: {
2077
2132
  type: import_v107.InteractionResponseType.Modal,
2078
- data: callbackData
2133
+ data
2079
2134
  },
2080
2135
  signal
2081
2136
  });
2137
+ return with_response ? response : void 0;
2082
2138
  }
2083
2139
  /**
2084
- * Sends a premium required response to an interaction
2140
+ * Launches an activity and returns an interaction callback object
2085
2141
  *
2086
2142
  * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
2087
2143
  * @param interactionId - The id of the interaction
@@ -2098,10 +2154,21 @@ var InteractionsAPI = class {
2098
2154
  signal
2099
2155
  });
2100
2156
  }
2157
+ async launchActivity(interactionId, interactionToken, { with_response } = {}, { signal } = {}) {
2158
+ const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
2159
+ query: (0, import_rest4.makeURLSearchParams)({ with_response }),
2160
+ auth: false,
2161
+ body: {
2162
+ type: import_v107.InteractionResponseType.LaunchActivity
2163
+ },
2164
+ signal
2165
+ });
2166
+ return with_response ? response : void 0;
2167
+ }
2101
2168
  };
2102
2169
 
2103
2170
  // src/api/invite.ts
2104
- var import_rest4 = require("@discordjs/rest");
2171
+ var import_rest5 = require("@discordjs/rest");
2105
2172
  var import_v108 = require("discord-api-types/v10");
2106
2173
  var InvitesAPI = class {
2107
2174
  constructor(rest) {
@@ -2120,7 +2187,7 @@ var InvitesAPI = class {
2120
2187
  */
2121
2188
  async get(code, query = {}, { signal } = {}) {
2122
2189
  return this.rest.get(import_v108.Routes.invite(code), {
2123
- query: (0, import_rest4.makeURLSearchParams)(query),
2190
+ query: (0, import_rest5.makeURLSearchParams)(query),
2124
2191
  signal
2125
2192
  });
2126
2193
  }
@@ -2132,12 +2199,12 @@ var InvitesAPI = class {
2132
2199
  * @param options - The options for deleting the invite
2133
2200
  */
2134
2201
  async delete(code, { reason, signal } = {}) {
2135
- await this.rest.delete(import_v108.Routes.invite(code), { reason, signal });
2202
+ return this.rest.delete(import_v108.Routes.invite(code), { reason, signal });
2136
2203
  }
2137
2204
  };
2138
2205
 
2139
2206
  // src/api/monetization.ts
2140
- var import_rest5 = require("@discordjs/rest");
2207
+ var import_rest6 = require("@discordjs/rest");
2141
2208
  var import_v109 = require("discord-api-types/v10");
2142
2209
  var MonetizationAPI = class {
2143
2210
  constructor(rest) {
@@ -2149,30 +2216,71 @@ var MonetizationAPI = class {
2149
2216
  /**
2150
2217
  * Fetches the SKUs for an application.
2151
2218
  *
2152
- * @see {@link https://discord.com/developers/docs/monetization/skus#list-skus}
2219
+ * @see {@link https://discord.com/developers/docs/resources/sku#list-skus}
2220
+ * @param applicationId - The application id to fetch SKUs for
2153
2221
  * @param options - The options for fetching the SKUs.
2154
2222
  */
2155
2223
  async getSKUs(applicationId, { signal } = {}) {
2156
2224
  return this.rest.get(import_v109.Routes.skus(applicationId), { signal });
2157
2225
  }
2226
+ /**
2227
+ * Fetches subscriptions for an SKU.
2228
+ *
2229
+ * @see {@link https://discord.com/developers/docs/resources/subscription#list-sku-subscriptions}
2230
+ * @param skuId - The SKU id to fetch subscriptions for
2231
+ * @param query - The query options for fetching subscriptions
2232
+ * @param options - The options for fetching subscriptions
2233
+ */
2234
+ async getSKUSubscriptions(skuId, query = {}, { signal } = {}) {
2235
+ return this.rest.get(import_v109.Routes.skuSubscriptions(skuId), {
2236
+ signal,
2237
+ query: (0, import_rest6.makeURLSearchParams)(query)
2238
+ });
2239
+ }
2240
+ /**
2241
+ * Fetches a subscription for an SKU.
2242
+ *
2243
+ * @see {@link https://discord.com/developers/docs/resources/subscription#get-sku-subscription}
2244
+ * @param skuId - The SKU id to fetch subscription for
2245
+ * @param subscriptionId - The subscription id to fetch
2246
+ * @param options - The options for fetching the subscription
2247
+ */
2248
+ async getSKUSubscription(skuId, subscriptionId, { signal } = {}) {
2249
+ return this.rest.get(import_v109.Routes.skuSubscription(skuId, subscriptionId), {
2250
+ signal
2251
+ });
2252
+ }
2158
2253
  /**
2159
2254
  * Fetches the entitlements for an application.
2160
2255
  *
2161
- * @see {@link https://discord.com/developers/docs/monetization/entitlements#list-entitlements}
2256
+ * @see {@link https://discord.com/developers/docs/resources/entitlement#list-entitlements}
2162
2257
  * @param applicationId - The application id to fetch entitlements for
2163
2258
  * @param query - The query options for fetching entitlements
2164
2259
  * @param options - The options for fetching entitlements
2165
2260
  */
2166
- async getEntitlements(applicationId, query, { signal } = {}) {
2261
+ async getEntitlements(applicationId, query = {}, { signal } = {}) {
2167
2262
  return this.rest.get(import_v109.Routes.entitlements(applicationId), {
2168
2263
  signal,
2169
- query: (0, import_rest5.makeURLSearchParams)(query)
2264
+ query: (0, import_rest6.makeURLSearchParams)(query)
2265
+ });
2266
+ }
2267
+ /**
2268
+ * Fetches an entitlement for an application.
2269
+ *
2270
+ * @see {@link https://discord.com/developers/docs/resources/entitlement#get-entitlement}
2271
+ * @param applicationId - The application id to fetch the entitlement for
2272
+ * @param entitlementId - The entitlement id to fetch
2273
+ * @param options - The options for fetching the entitlement
2274
+ */
2275
+ async getEntitlement(applicationId, entitlementId, { signal } = {}) {
2276
+ return this.rest.get(import_v109.Routes.entitlement(applicationId, entitlementId), {
2277
+ signal
2170
2278
  });
2171
2279
  }
2172
2280
  /**
2173
2281
  * Creates a test entitlement for an application's SKU.
2174
2282
  *
2175
- * @see {@link https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement}
2283
+ * @see {@link https://discord.com/developers/docs/resources/entitlement#create-test-entitlement}
2176
2284
  * @param applicationId - The application id to create the entitlement for
2177
2285
  * @param body - The data for creating the entitlement
2178
2286
  * @param options - The options for creating the entitlement
@@ -2186,7 +2294,7 @@ var MonetizationAPI = class {
2186
2294
  /**
2187
2295
  * Deletes a test entitlement for an application's SKU.
2188
2296
  *
2189
- * @see {@link https://discord.com/developers/docs/monetization/entitlements#delete-test-entitlement}
2297
+ * @see {@link https://discord.com/developers/docs/resources/entitlement#delete-test-entitlement}
2190
2298
  * @param applicationId - The application id to delete the entitlement for
2191
2299
  * @param entitlementId - The entitlement id to delete
2192
2300
  * @param options - The options for deleting the entitlement
@@ -2197,7 +2305,7 @@ var MonetizationAPI = class {
2197
2305
  /**
2198
2306
  * Marks a given entitlement for the user as consumed. Only available for One-Time Purchase consumable SKUs.
2199
2307
  *
2200
- * @see {@link https://discord.com/developers/docs/monetization/entitlements#consume-an-entitlement}
2308
+ * @see {@link https://discord.com/developers/docs/resources/entitlement#consume-an-entitlement}
2201
2309
  * @param applicationId - The application id to consume the entitlement for
2202
2310
  * @param entitlementId - The entitlement id to consume
2203
2311
  * @param options - The options for consuming the entitlement
@@ -2208,7 +2316,7 @@ var MonetizationAPI = class {
2208
2316
  };
2209
2317
 
2210
2318
  // src/api/oauth2.ts
2211
- var import_rest6 = require("@discordjs/rest");
2319
+ var import_rest7 = require("@discordjs/rest");
2212
2320
  var import_v1010 = require("discord-api-types/v10");
2213
2321
  var OAuth2API = class {
2214
2322
  constructor(rest) {
@@ -2225,7 +2333,7 @@ var OAuth2API = class {
2225
2333
  */
2226
2334
  generateAuthorizationURL(options) {
2227
2335
  const url = new URL(`${import_v1010.RouteBases.api}${import_v1010.Routes.oauth2Authorization()}`);
2228
- url.search = (0, import_rest6.makeURLSearchParams)(options).toString();
2336
+ url.search = (0, import_rest7.makeURLSearchParams)(options).toString();
2229
2337
  return url.toString();
2230
2338
  }
2231
2339
  /**
@@ -2237,7 +2345,7 @@ var OAuth2API = class {
2237
2345
  */
2238
2346
  async tokenExchange(body, { signal } = {}) {
2239
2347
  return this.rest.post(import_v1010.Routes.oauth2TokenExchange(), {
2240
- body: (0, import_rest6.makeURLSearchParams)(body),
2348
+ body: (0, import_rest7.makeURLSearchParams)(body),
2241
2349
  passThroughBody: true,
2242
2350
  headers: {
2243
2351
  "Content-Type": "application/x-www-form-urlencoded"
@@ -2255,7 +2363,7 @@ var OAuth2API = class {
2255
2363
  */
2256
2364
  async refreshToken(body, { signal } = {}) {
2257
2365
  return this.rest.post(import_v1010.Routes.oauth2TokenExchange(), {
2258
- body: (0, import_rest6.makeURLSearchParams)(body),
2366
+ body: (0, import_rest7.makeURLSearchParams)(body),
2259
2367
  passThroughBody: true,
2260
2368
  headers: {
2261
2369
  "Content-Type": "application/x-www-form-urlencoded"
@@ -2275,7 +2383,7 @@ var OAuth2API = class {
2275
2383
  */
2276
2384
  async getToken(body, { signal } = {}) {
2277
2385
  return this.rest.post(import_v1010.Routes.oauth2TokenExchange(), {
2278
- body: (0, import_rest6.makeURLSearchParams)(body),
2386
+ body: (0, import_rest7.makeURLSearchParams)(body),
2279
2387
  passThroughBody: true,
2280
2388
  headers: {
2281
2389
  "Content-Type": "application/x-www-form-urlencoded"
@@ -2317,7 +2425,7 @@ var OAuth2API = class {
2317
2425
  */
2318
2426
  async revokeToken(applicationId, applicationSecret, body, { signal } = {}) {
2319
2427
  await this.rest.post(import_v1010.Routes.oauth2TokenRevocation(), {
2320
- body: (0, import_rest6.makeURLSearchParams)(body),
2428
+ body: (0, import_rest7.makeURLSearchParams)(body),
2321
2429
  passThroughBody: true,
2322
2430
  headers: {
2323
2431
  Authorization: `Basic ${btoa(`${applicationId}:${applicationSecret}`)}`,
@@ -2330,7 +2438,7 @@ var OAuth2API = class {
2330
2438
  };
2331
2439
 
2332
2440
  // src/api/poll.ts
2333
- var import_rest7 = require("@discordjs/rest");
2441
+ var import_rest8 = require("@discordjs/rest");
2334
2442
  var import_v1011 = require("discord-api-types/v10");
2335
2443
  var PollAPI = class {
2336
2444
  constructor(rest) {
@@ -2349,10 +2457,10 @@ var PollAPI = class {
2349
2457
  * @param query - The query for getting the list of voters
2350
2458
  * @param options - The options for getting the list of voters
2351
2459
  */
2352
- async getAnswerVoters(channelId, messageId, answerId, query, { signal } = {}) {
2460
+ async getAnswerVoters(channelId, messageId, answerId, query = {}, { signal } = {}) {
2353
2461
  return this.rest.get(import_v1011.Routes.pollAnswerVoters(channelId, messageId, answerId), {
2354
2462
  signal,
2355
- query: (0, import_rest7.makeURLSearchParams)(query)
2463
+ query: (0, import_rest8.makeURLSearchParams)(query)
2356
2464
  });
2357
2465
  }
2358
2466
  /**
@@ -2407,8 +2515,30 @@ var RoleConnectionsAPI = class {
2407
2515
  }
2408
2516
  };
2409
2517
 
2410
- // src/api/stageInstances.ts
2518
+ // src/api/soundboardSounds.ts
2411
2519
  var import_v1013 = require("discord-api-types/v10");
2520
+ var SoundboardSoundsAPI = class {
2521
+ constructor(rest) {
2522
+ this.rest = rest;
2523
+ }
2524
+ static {
2525
+ __name(this, "SoundboardSoundsAPI");
2526
+ }
2527
+ /**
2528
+ * Fetches all the soundboard default sounds.
2529
+ *
2530
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#list-default-soundboard-sounds}
2531
+ * @param options - The options for fetching the soundboard default sounds.
2532
+ */
2533
+ async getSoundboardDefaultSounds({ signal } = {}) {
2534
+ return this.rest.get(import_v1013.Routes.soundboardDefaultSounds(), {
2535
+ signal
2536
+ });
2537
+ }
2538
+ };
2539
+
2540
+ // src/api/stageInstances.ts
2541
+ var import_v1014 = require("discord-api-types/v10");
2412
2542
  var StageInstancesAPI = class {
2413
2543
  constructor(rest) {
2414
2544
  this.rest = rest;
@@ -2424,7 +2554,7 @@ var StageInstancesAPI = class {
2424
2554
  * @param options - The options for creating the new stage instance
2425
2555
  */
2426
2556
  async create(body, { reason, signal } = {}) {
2427
- return this.rest.post(import_v1013.Routes.stageInstances(), {
2557
+ return this.rest.post(import_v1014.Routes.stageInstances(), {
2428
2558
  body,
2429
2559
  reason,
2430
2560
  signal
@@ -2438,7 +2568,7 @@ var StageInstancesAPI = class {
2438
2568
  * @param options - The options for fetching the stage instance
2439
2569
  */
2440
2570
  async get(channelId, { signal } = {}) {
2441
- return this.rest.get(import_v1013.Routes.stageInstance(channelId), { signal });
2571
+ return this.rest.get(import_v1014.Routes.stageInstance(channelId), { signal });
2442
2572
  }
2443
2573
  /**
2444
2574
  * Edits a stage instance
@@ -2449,7 +2579,7 @@ var StageInstancesAPI = class {
2449
2579
  * @param options - The options for editing the stage instance
2450
2580
  */
2451
2581
  async edit(channelId, body, { reason, signal } = {}) {
2452
- return this.rest.patch(import_v1013.Routes.stageInstance(channelId), {
2582
+ return this.rest.patch(import_v1014.Routes.stageInstance(channelId), {
2453
2583
  body,
2454
2584
  reason,
2455
2585
  signal
@@ -2463,12 +2593,12 @@ var StageInstancesAPI = class {
2463
2593
  * @param options - The options for deleting the stage instance
2464
2594
  */
2465
2595
  async delete(channelId, { reason, signal } = {}) {
2466
- await this.rest.delete(import_v1013.Routes.stageInstance(channelId), { reason, signal });
2596
+ await this.rest.delete(import_v1014.Routes.stageInstance(channelId), { reason, signal });
2467
2597
  }
2468
2598
  };
2469
2599
 
2470
2600
  // src/api/sticker.ts
2471
- var import_v1014 = require("discord-api-types/v10");
2601
+ var import_v1015 = require("discord-api-types/v10");
2472
2602
  var StickersAPI = class {
2473
2603
  constructor(rest) {
2474
2604
  this.rest = rest;
@@ -2484,7 +2614,7 @@ var StickersAPI = class {
2484
2614
  * @param options - The options for fetching the sticker pack
2485
2615
  */
2486
2616
  async getStickerPack(packId, { signal } = {}) {
2487
- return this.rest.get(import_v1014.Routes.stickerPack(packId), { signal });
2617
+ return this.rest.get(import_v1015.Routes.stickerPack(packId), { signal });
2488
2618
  }
2489
2619
  /**
2490
2620
  * Fetches all of the sticker packs
@@ -2493,7 +2623,7 @@ var StickersAPI = class {
2493
2623
  * @param options - The options for fetching the sticker packs
2494
2624
  */
2495
2625
  async getStickers({ signal } = {}) {
2496
- return this.rest.get(import_v1014.Routes.stickerPacks(), { signal });
2626
+ return this.rest.get(import_v1015.Routes.stickerPacks(), { signal });
2497
2627
  }
2498
2628
  /**
2499
2629
  * Fetches all of the sticker packs
@@ -2513,12 +2643,12 @@ var StickersAPI = class {
2513
2643
  * @param options - The options for fetching the sticker
2514
2644
  */
2515
2645
  async get(stickerId, { signal } = {}) {
2516
- return this.rest.get(import_v1014.Routes.sticker(stickerId), { signal });
2646
+ return this.rest.get(import_v1015.Routes.sticker(stickerId), { signal });
2517
2647
  }
2518
2648
  };
2519
2649
 
2520
2650
  // src/api/thread.ts
2521
- var import_v1015 = require("discord-api-types/v10");
2651
+ var import_v1016 = require("discord-api-types/v10");
2522
2652
  var ThreadsAPI = class {
2523
2653
  constructor(rest) {
2524
2654
  this.rest = rest;
@@ -2534,7 +2664,7 @@ var ThreadsAPI = class {
2534
2664
  * @param options - The options for joining the thread
2535
2665
  */
2536
2666
  async join(threadId, { signal } = {}) {
2537
- await this.rest.put(import_v1015.Routes.threadMembers(threadId, "@me"), { signal });
2667
+ await this.rest.put(import_v1016.Routes.threadMembers(threadId, "@me"), { signal });
2538
2668
  }
2539
2669
  /**
2540
2670
  * Adds a member to a thread
@@ -2545,7 +2675,7 @@ var ThreadsAPI = class {
2545
2675
  * @param options - The options for adding the member to the thread
2546
2676
  */
2547
2677
  async addMember(threadId, userId, { signal } = {}) {
2548
- await this.rest.put(import_v1015.Routes.threadMembers(threadId, userId), { signal });
2678
+ await this.rest.put(import_v1016.Routes.threadMembers(threadId, userId), { signal });
2549
2679
  }
2550
2680
  /**
2551
2681
  * Removes the current user from a thread
@@ -2555,7 +2685,7 @@ var ThreadsAPI = class {
2555
2685
  * @param options - The options for leaving the thread
2556
2686
  */
2557
2687
  async leave(threadId, { signal } = {}) {
2558
- await this.rest.delete(import_v1015.Routes.threadMembers(threadId, "@me"), { signal });
2688
+ await this.rest.delete(import_v1016.Routes.threadMembers(threadId, "@me"), { signal });
2559
2689
  }
2560
2690
  /**
2561
2691
  * Removes a member from a thread
@@ -2566,7 +2696,7 @@ var ThreadsAPI = class {
2566
2696
  * @param options - The options for removing the member from the thread
2567
2697
  */
2568
2698
  async removeMember(threadId, userId, { signal } = {}) {
2569
- await this.rest.delete(import_v1015.Routes.threadMembers(threadId, userId), { signal });
2699
+ await this.rest.delete(import_v1016.Routes.threadMembers(threadId, userId), { signal });
2570
2700
  }
2571
2701
  /**
2572
2702
  * Fetches a member of a thread
@@ -2577,7 +2707,7 @@ var ThreadsAPI = class {
2577
2707
  * @param options - The options for fetching the member
2578
2708
  */
2579
2709
  async getMember(threadId, userId, { signal } = {}) {
2580
- return this.rest.get(import_v1015.Routes.threadMembers(threadId, userId), { signal });
2710
+ return this.rest.get(import_v1016.Routes.threadMembers(threadId, userId), { signal });
2581
2711
  }
2582
2712
  /**
2583
2713
  * Fetches all members of a thread
@@ -2587,13 +2717,13 @@ var ThreadsAPI = class {
2587
2717
  * @param options - The options for fetching the members
2588
2718
  */
2589
2719
  async getAllMembers(threadId, { signal } = {}) {
2590
- return this.rest.get(import_v1015.Routes.threadMembers(threadId), { signal });
2720
+ return this.rest.get(import_v1016.Routes.threadMembers(threadId), { signal });
2591
2721
  }
2592
2722
  };
2593
2723
 
2594
2724
  // src/api/user.ts
2595
- var import_rest8 = require("@discordjs/rest");
2596
- var import_v1016 = require("discord-api-types/v10");
2725
+ var import_rest9 = require("@discordjs/rest");
2726
+ var import_v1017 = require("discord-api-types/v10");
2597
2727
  var UsersAPI = class {
2598
2728
  constructor(rest) {
2599
2729
  this.rest = rest;
@@ -2609,7 +2739,7 @@ var UsersAPI = class {
2609
2739
  * @param options - The options for fetching the user
2610
2740
  */
2611
2741
  async get(userId, { signal } = {}) {
2612
- return this.rest.get(import_v1016.Routes.user(userId), { signal });
2742
+ return this.rest.get(import_v1017.Routes.user(userId), { signal });
2613
2743
  }
2614
2744
  /**
2615
2745
  * Returns the user object of the requester's account
@@ -2618,7 +2748,7 @@ var UsersAPI = class {
2618
2748
  * @param options - The options for fetching the current user
2619
2749
  */
2620
2750
  async getCurrent({ signal } = {}) {
2621
- return this.rest.get(import_v1016.Routes.user("@me"), { signal });
2751
+ return this.rest.get(import_v1017.Routes.user("@me"), { signal });
2622
2752
  }
2623
2753
  /**
2624
2754
  * Returns a list of partial guild objects the current user is a member of
@@ -2628,8 +2758,8 @@ var UsersAPI = class {
2628
2758
  * @param options - The options for fetching the guilds
2629
2759
  */
2630
2760
  async getGuilds(query = {}, { signal } = {}) {
2631
- return this.rest.get(import_v1016.Routes.userGuilds(), {
2632
- query: (0, import_rest8.makeURLSearchParams)(query),
2761
+ return this.rest.get(import_v1017.Routes.userGuilds(), {
2762
+ query: (0, import_rest9.makeURLSearchParams)(query),
2633
2763
  signal
2634
2764
  });
2635
2765
  }
@@ -2641,7 +2771,7 @@ var UsersAPI = class {
2641
2771
  * @param options - The options for leaving the guild
2642
2772
  */
2643
2773
  async leaveGuild(guildId, { signal } = {}) {
2644
- await this.rest.delete(import_v1016.Routes.userGuild(guildId), { signal });
2774
+ await this.rest.delete(import_v1017.Routes.userGuild(guildId), { signal });
2645
2775
  }
2646
2776
  /**
2647
2777
  * Edits the current user
@@ -2651,7 +2781,7 @@ var UsersAPI = class {
2651
2781
  * @param options - The options for editing the user
2652
2782
  */
2653
2783
  async edit(body, { signal } = {}) {
2654
- return this.rest.patch(import_v1016.Routes.user("@me"), { body, signal });
2784
+ return this.rest.patch(import_v1017.Routes.user("@me"), { body, signal });
2655
2785
  }
2656
2786
  /**
2657
2787
  * Fetches the guild member for the current user
@@ -2661,7 +2791,7 @@ var UsersAPI = class {
2661
2791
  * @param options - The options for fetching the guild member
2662
2792
  */
2663
2793
  async getGuildMember(guildId, { signal } = {}) {
2664
- return this.rest.get(import_v1016.Routes.userGuildMember(guildId), { signal });
2794
+ return this.rest.get(import_v1017.Routes.userGuildMember(guildId), { signal });
2665
2795
  }
2666
2796
  /**
2667
2797
  * Edits the guild member for the current user
@@ -2672,7 +2802,7 @@ var UsersAPI = class {
2672
2802
  * @param options - The options for editing the guild member
2673
2803
  */
2674
2804
  async editCurrentGuildMember(guildId, body = {}, { reason, signal } = {}) {
2675
- return this.rest.patch(import_v1016.Routes.guildMember(guildId, "@me"), {
2805
+ return this.rest.patch(import_v1017.Routes.guildMember(guildId, "@me"), {
2676
2806
  reason,
2677
2807
  body,
2678
2808
  signal
@@ -2686,7 +2816,7 @@ var UsersAPI = class {
2686
2816
  * @param options - The options for opening the DM
2687
2817
  */
2688
2818
  async createDM(userId, { signal } = {}) {
2689
- return this.rest.post(import_v1016.Routes.userChannels(), {
2819
+ return this.rest.post(import_v1017.Routes.userChannels(), {
2690
2820
  body: { recipient_id: userId },
2691
2821
  signal
2692
2822
  });
@@ -2698,7 +2828,7 @@ var UsersAPI = class {
2698
2828
  * @param options - The options for fetching the user's connections
2699
2829
  */
2700
2830
  async getConnections({ signal } = {}) {
2701
- return this.rest.get(import_v1016.Routes.userConnections(), { signal });
2831
+ return this.rest.get(import_v1017.Routes.userConnections(), { signal });
2702
2832
  }
2703
2833
  /**
2704
2834
  * Gets the current user's active application role connection
@@ -2708,7 +2838,7 @@ var UsersAPI = class {
2708
2838
  * @param options - The options for fetching the role connections
2709
2839
  */
2710
2840
  async getApplicationRoleConnection(applicationId, { signal } = {}) {
2711
- return this.rest.get(import_v1016.Routes.userApplicationRoleConnection(applicationId), {
2841
+ return this.rest.get(import_v1017.Routes.userApplicationRoleConnection(applicationId), {
2712
2842
  signal
2713
2843
  });
2714
2844
  }
@@ -2721,7 +2851,7 @@ var UsersAPI = class {
2721
2851
  * @param options - The options for updating the application role connection
2722
2852
  */
2723
2853
  async updateApplicationRoleConnection(applicationId, body, { signal } = {}) {
2724
- return this.rest.put(import_v1016.Routes.userApplicationRoleConnection(applicationId), {
2854
+ return this.rest.put(import_v1017.Routes.userApplicationRoleConnection(applicationId), {
2725
2855
  body,
2726
2856
  signal
2727
2857
  });
@@ -2729,8 +2859,8 @@ var UsersAPI = class {
2729
2859
  };
2730
2860
 
2731
2861
  // src/api/webhook.ts
2732
- var import_rest9 = require("@discordjs/rest");
2733
- var import_v1017 = require("discord-api-types/v10");
2862
+ var import_rest10 = require("@discordjs/rest");
2863
+ var import_v1018 = require("discord-api-types/v10");
2734
2864
  var WebhooksAPI = class {
2735
2865
  constructor(rest) {
2736
2866
  this.rest = rest;
@@ -2747,7 +2877,7 @@ var WebhooksAPI = class {
2747
2877
  * @param options - The options for fetching the webhook
2748
2878
  */
2749
2879
  async get(id, { token, signal } = {}) {
2750
- return this.rest.get(import_v1017.Routes.webhook(id, token), {
2880
+ return this.rest.get(import_v1018.Routes.webhook(id, token), {
2751
2881
  signal,
2752
2882
  auth: !token
2753
2883
  });
@@ -2762,7 +2892,7 @@ var WebhooksAPI = class {
2762
2892
  * @param options - The options for editing the webhook
2763
2893
  */
2764
2894
  async edit(id, body, { token, reason, signal } = {}) {
2765
- return this.rest.patch(import_v1017.Routes.webhook(id, token), {
2895
+ return this.rest.patch(import_v1018.Routes.webhook(id, token), {
2766
2896
  reason,
2767
2897
  body,
2768
2898
  signal,
@@ -2778,7 +2908,7 @@ var WebhooksAPI = class {
2778
2908
  * @param options - The options for deleting the webhook
2779
2909
  */
2780
2910
  async delete(id, { token, reason, signal } = {}) {
2781
- await this.rest.delete(import_v1017.Routes.webhook(id, token), {
2911
+ await this.rest.delete(import_v1018.Routes.webhook(id, token), {
2782
2912
  reason,
2783
2913
  signal,
2784
2914
  auth: !token
@@ -2793,15 +2923,9 @@ var WebhooksAPI = class {
2793
2923
  * @param body - The data for executing the webhook
2794
2924
  * @param options - The options for executing the webhook
2795
2925
  */
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 }),
2926
+ async execute(id, token, { wait, thread_id, with_components, files, ...body }, { signal } = {}) {
2927
+ return this.rest.post(import_v1018.Routes.webhook(id, token), {
2928
+ query: (0, import_rest10.makeURLSearchParams)({ wait, thread_id, with_components }),
2805
2929
  files,
2806
2930
  body,
2807
2931
  auth: false,
@@ -2820,8 +2944,8 @@ var WebhooksAPI = class {
2820
2944
  * @param options - The options for executing the webhook
2821
2945
  */
2822
2946
  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),
2947
+ await this.rest.post(import_v1018.Routes.webhookPlatform(id, token, "slack"), {
2948
+ query: (0, import_rest10.makeURLSearchParams)(query),
2825
2949
  body,
2826
2950
  auth: false,
2827
2951
  signal
@@ -2838,8 +2962,8 @@ var WebhooksAPI = class {
2838
2962
  * @param options - The options for executing the webhook
2839
2963
  */
2840
2964
  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),
2965
+ await this.rest.post(import_v1018.Routes.webhookPlatform(id, token, "github"), {
2966
+ query: (0, import_rest10.makeURLSearchParams)(query),
2843
2967
  body,
2844
2968
  signal,
2845
2969
  auth: false
@@ -2856,8 +2980,8 @@ var WebhooksAPI = class {
2856
2980
  * @param options - The options for fetching the message
2857
2981
  */
2858
2982
  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),
2983
+ return this.rest.get(import_v1018.Routes.webhookMessage(id, token, messageId), {
2984
+ query: (0, import_rest10.makeURLSearchParams)(query),
2861
2985
  auth: false,
2862
2986
  signal
2863
2987
  });
@@ -2872,14 +2996,9 @@ var WebhooksAPI = class {
2872
2996
  * @param body - The data for editing the message
2873
2997
  * @param options - The options for editing the message
2874
2998
  */
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 }),
2999
+ async editMessage(id, token, messageId, { thread_id, with_components, files, ...body }, { signal } = {}) {
3000
+ return this.rest.patch(import_v1018.Routes.webhookMessage(id, token, messageId), {
3001
+ query: (0, import_rest10.makeURLSearchParams)({ thread_id, with_components }),
2883
3002
  auth: false,
2884
3003
  body,
2885
3004
  signal,
@@ -2897,8 +3016,8 @@ var WebhooksAPI = class {
2897
3016
  * @param options - The options for deleting the message
2898
3017
  */
2899
3018
  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),
3019
+ await this.rest.delete(import_v1018.Routes.webhookMessage(id, token, messageId), {
3020
+ query: (0, import_rest10.makeURLSearchParams)(query),
2902
3021
  auth: false,
2903
3022
  signal
2904
3023
  });
@@ -2919,6 +3038,7 @@ var API = class {
2919
3038
  this.oauth2 = new OAuth2API(rest);
2920
3039
  this.poll = new PollAPI(rest);
2921
3040
  this.roleConnections = new RoleConnectionsAPI(rest);
3041
+ this.soundboardSounds = new SoundboardSoundsAPI(rest);
2922
3042
  this.stageInstances = new StageInstancesAPI(rest);
2923
3043
  this.stickers = new StickersAPI(rest);
2924
3044
  this.threads = new ThreadsAPI(rest);
@@ -2941,6 +3061,7 @@ var API = class {
2941
3061
  oauth2;
2942
3062
  poll;
2943
3063
  roleConnections;
3064
+ soundboardSounds;
2944
3065
  stageInstances;
2945
3066
  stickers;
2946
3067
  threads;
@@ -2968,7 +3089,7 @@ __name(withFiles, "withFiles");
2968
3089
 
2969
3090
  // src/http-only/index.ts
2970
3091
  __reExport(http_only_exports, require("discord-api-types/v10"), module.exports);
2971
- var version = "2.3.0";
3092
+ var version = "2.5.0";
2972
3093
  // Annotate the CommonJS export names for ESM import in node:
2973
3094
  0 && (module.exports = {
2974
3095
  API,
@@ -2983,6 +3104,7 @@ var version = "2.3.0";
2983
3104
  OAuth2API,
2984
3105
  PollAPI,
2985
3106
  RoleConnectionsAPI,
3107
+ SoundboardSoundsAPI,
2986
3108
  StageInstancesAPI,
2987
3109
  StickersAPI,
2988
3110
  ThreadsAPI,