@discordjs/core 2.0.1-dev.1730030702-ed78e4570 → 2.1.0-dev.1730808317-1184b38d3
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.d.mts +93 -7
- package/dist/http-only.d.ts +93 -7
- package/dist/http-only.js +179 -44
- package/dist/http-only.js.map +1 -1
- package/dist/http-only.mjs +178 -44
- package/dist/http-only.mjs.map +1 -1
- package/dist/index.d.mts +100 -7
- package/dist/index.d.ts +100 -7
- package/dist/index.js +184 -49
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +178 -44
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/http-only.mjs
CHANGED
|
@@ -743,6 +743,20 @@ var ChannelsAPI = class {
|
|
|
743
743
|
signal
|
|
744
744
|
});
|
|
745
745
|
}
|
|
746
|
+
/**
|
|
747
|
+
* Sends a soundboard sound in a channel
|
|
748
|
+
*
|
|
749
|
+
* @see {@link https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound}
|
|
750
|
+
* @param channelId - The id of the channel to send the soundboard sound in
|
|
751
|
+
* @param body - The data for sending the soundboard sound
|
|
752
|
+
* @param options - The options for sending the soundboard sound
|
|
753
|
+
*/
|
|
754
|
+
async sendSoundboardSound(channelId, body, { signal } = {}) {
|
|
755
|
+
return this.rest.post(Routes3.sendSoundboardSound(channelId), {
|
|
756
|
+
body,
|
|
757
|
+
signal
|
|
758
|
+
});
|
|
759
|
+
}
|
|
746
760
|
};
|
|
747
761
|
|
|
748
762
|
// src/api/guild.ts
|
|
@@ -1775,6 +1789,73 @@ var GuildsAPI = class {
|
|
|
1775
1789
|
signal
|
|
1776
1790
|
});
|
|
1777
1791
|
}
|
|
1792
|
+
/**
|
|
1793
|
+
* Fetches all the soundboard sounds for a guild
|
|
1794
|
+
*
|
|
1795
|
+
* @see {@link https://discord.com/developers/docs/resources/soundboard#list-guild-soundboard-sounds}
|
|
1796
|
+
* @param guildId - The id of the guild to fetch the soundboard sounds for
|
|
1797
|
+
* @param options - The options for fetching the soundboard sounds
|
|
1798
|
+
*/
|
|
1799
|
+
async getSoundboardSounds(guildId, { signal } = {}) {
|
|
1800
|
+
return this.rest.get(Routes5.guildSoundboardSounds(guildId), {
|
|
1801
|
+
signal
|
|
1802
|
+
});
|
|
1803
|
+
}
|
|
1804
|
+
/**
|
|
1805
|
+
* Fetches a soundboard sound for a guild
|
|
1806
|
+
*
|
|
1807
|
+
* @see {@link https://discord.com/developers/docs/resources/soundboard#get-guild-soundboard-sound}
|
|
1808
|
+
* @param guildId - The id of the guild to fetch the soundboard sound for
|
|
1809
|
+
* @param soundId - The id of the soundboard sound to fetch
|
|
1810
|
+
* @param options - The options for fetching the soundboard sound
|
|
1811
|
+
*/
|
|
1812
|
+
async getSoundboardSound(guildId, soundId, { signal } = {}) {
|
|
1813
|
+
return this.rest.get(Routes5.guildSoundboardSound(guildId, soundId), {
|
|
1814
|
+
signal
|
|
1815
|
+
});
|
|
1816
|
+
}
|
|
1817
|
+
/**
|
|
1818
|
+
* Creates a new soundboard sound for a guild
|
|
1819
|
+
*
|
|
1820
|
+
* @see {@link https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound}
|
|
1821
|
+
* @param guildId - The id of the guild to create the soundboard sound for
|
|
1822
|
+
* @param body - The data for creating the soundboard sound
|
|
1823
|
+
* @param options - The options for creating the soundboard sound
|
|
1824
|
+
*/
|
|
1825
|
+
async createSoundboardSound(guildId, body, { reason, signal } = {}) {
|
|
1826
|
+
return this.rest.post(Routes5.guildSoundboardSounds(guildId), {
|
|
1827
|
+
body,
|
|
1828
|
+
reason,
|
|
1829
|
+
signal
|
|
1830
|
+
});
|
|
1831
|
+
}
|
|
1832
|
+
/**
|
|
1833
|
+
* Edits a soundboard sound for a guild
|
|
1834
|
+
*
|
|
1835
|
+
* @see {@link https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound}
|
|
1836
|
+
* @param guildId - The id of the guild to edit the soundboard sound for
|
|
1837
|
+
* @param soundId - The id of the soundboard sound to edit
|
|
1838
|
+
* @param body - The data for editing the soundboard sound
|
|
1839
|
+
* @param options - The options for editing the soundboard sound
|
|
1840
|
+
*/
|
|
1841
|
+
async editSoundboardSound(guildId, soundId, body, { reason, signal } = {}) {
|
|
1842
|
+
return this.rest.patch(Routes5.guildSoundboardSound(guildId, soundId), {
|
|
1843
|
+
body,
|
|
1844
|
+
reason,
|
|
1845
|
+
signal
|
|
1846
|
+
});
|
|
1847
|
+
}
|
|
1848
|
+
/**
|
|
1849
|
+
* Deletes a soundboard sound for a guild
|
|
1850
|
+
*
|
|
1851
|
+
* @see {@link https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound}
|
|
1852
|
+
* @param guildId - The id of the guild to delete the soundboard sound for
|
|
1853
|
+
* @param soundId - The id of the soundboard sound to delete
|
|
1854
|
+
* @param options - The options for deleting the soundboard sound
|
|
1855
|
+
*/
|
|
1856
|
+
async deleteSoundboardSound(guildId, soundId, { reason, signal } = {}) {
|
|
1857
|
+
await this.rest.delete(Routes5.guildSoundboardSound(guildId, soundId), { reason, signal });
|
|
1858
|
+
}
|
|
1778
1859
|
};
|
|
1779
1860
|
|
|
1780
1861
|
// src/api/interactions.ts
|
|
@@ -2033,16 +2114,44 @@ var MonetizationAPI = class {
|
|
|
2033
2114
|
/**
|
|
2034
2115
|
* Fetches the SKUs for an application.
|
|
2035
2116
|
*
|
|
2036
|
-
* @see {@link https://discord.com/developers/docs/
|
|
2117
|
+
* @see {@link https://discord.com/developers/docs/resources/sku#list-skus}
|
|
2118
|
+
* @param applicationId - The application id to fetch SKUs for
|
|
2037
2119
|
* @param options - The options for fetching the SKUs.
|
|
2038
2120
|
*/
|
|
2039
2121
|
async getSKUs(applicationId, { signal } = {}) {
|
|
2040
2122
|
return this.rest.get(Routes8.skus(applicationId), { signal });
|
|
2041
2123
|
}
|
|
2124
|
+
/**
|
|
2125
|
+
* Fetches subscriptions for an SKU.
|
|
2126
|
+
*
|
|
2127
|
+
* @see {@link https://discord.com/developers/docs/resources/subscription#list-sku-subscriptions}
|
|
2128
|
+
* @param skuId - The SKU id to fetch subscriptions for
|
|
2129
|
+
* @param query - The query options for fetching subscriptions
|
|
2130
|
+
* @param options - The options for fetching subscriptions
|
|
2131
|
+
*/
|
|
2132
|
+
async getSKUSubscriptions(skuId, query, { signal } = {}) {
|
|
2133
|
+
return this.rest.get(Routes8.skuSubscriptions(skuId), {
|
|
2134
|
+
signal,
|
|
2135
|
+
query: makeURLSearchParams5(query)
|
|
2136
|
+
});
|
|
2137
|
+
}
|
|
2138
|
+
/**
|
|
2139
|
+
* Fetches a subscription for an SKU.
|
|
2140
|
+
*
|
|
2141
|
+
* @see {@link https://discord.com/developers/docs/resources/subscription#get-sku-subscription}
|
|
2142
|
+
* @param skuId - The SKU id to fetch subscription for
|
|
2143
|
+
* @param subscriptionId - The subscription id to fetch
|
|
2144
|
+
* @param options - The options for fetching the subscription
|
|
2145
|
+
*/
|
|
2146
|
+
async getSKUSubscription(skuId, subscriptionId, { signal } = {}) {
|
|
2147
|
+
return this.rest.get(Routes8.skuSubscription(skuId, subscriptionId), {
|
|
2148
|
+
signal
|
|
2149
|
+
});
|
|
2150
|
+
}
|
|
2042
2151
|
/**
|
|
2043
2152
|
* Fetches the entitlements for an application.
|
|
2044
2153
|
*
|
|
2045
|
-
* @see {@link https://discord.com/developers/docs/
|
|
2154
|
+
* @see {@link https://discord.com/developers/docs/resources/entitlement#list-entitlements}
|
|
2046
2155
|
* @param applicationId - The application id to fetch entitlements for
|
|
2047
2156
|
* @param query - The query options for fetching entitlements
|
|
2048
2157
|
* @param options - The options for fetching entitlements
|
|
@@ -2056,7 +2165,7 @@ var MonetizationAPI = class {
|
|
|
2056
2165
|
/**
|
|
2057
2166
|
* Creates a test entitlement for an application's SKU.
|
|
2058
2167
|
*
|
|
2059
|
-
* @see {@link https://discord.com/developers/docs/
|
|
2168
|
+
* @see {@link https://discord.com/developers/docs/resources/entitlement#create-test-entitlement}
|
|
2060
2169
|
* @param applicationId - The application id to create the entitlement for
|
|
2061
2170
|
* @param body - The data for creating the entitlement
|
|
2062
2171
|
* @param options - The options for creating the entitlement
|
|
@@ -2070,7 +2179,7 @@ var MonetizationAPI = class {
|
|
|
2070
2179
|
/**
|
|
2071
2180
|
* Deletes a test entitlement for an application's SKU.
|
|
2072
2181
|
*
|
|
2073
|
-
* @see {@link https://discord.com/developers/docs/
|
|
2182
|
+
* @see {@link https://discord.com/developers/docs/resources/entitlement#delete-test-entitlement}
|
|
2074
2183
|
* @param applicationId - The application id to delete the entitlement for
|
|
2075
2184
|
* @param entitlementId - The entitlement id to delete
|
|
2076
2185
|
* @param options - The options for deleting the entitlement
|
|
@@ -2081,7 +2190,7 @@ var MonetizationAPI = class {
|
|
|
2081
2190
|
/**
|
|
2082
2191
|
* Marks a given entitlement for the user as consumed. Only available for One-Time Purchase consumable SKUs.
|
|
2083
2192
|
*
|
|
2084
|
-
* @see {@link https://discord.com/developers/docs/
|
|
2193
|
+
* @see {@link https://discord.com/developers/docs/resources/entitlement#consume-an-entitlement}
|
|
2085
2194
|
* @param applicationId - The application id to consume the entitlement for
|
|
2086
2195
|
* @param entitlementId - The entitlement id to consume
|
|
2087
2196
|
* @param options - The options for consuming the entitlement
|
|
@@ -2298,9 +2407,31 @@ var RoleConnectionsAPI = class {
|
|
|
2298
2407
|
}
|
|
2299
2408
|
};
|
|
2300
2409
|
|
|
2410
|
+
// src/api/soundboardSounds.ts
|
|
2411
|
+
import { Routes as Routes12 } from "discord-api-types/v10";
|
|
2412
|
+
var SoundboardSoundsAPI = class {
|
|
2413
|
+
constructor(rest) {
|
|
2414
|
+
this.rest = rest;
|
|
2415
|
+
}
|
|
2416
|
+
static {
|
|
2417
|
+
__name(this, "SoundboardSoundsAPI");
|
|
2418
|
+
}
|
|
2419
|
+
/**
|
|
2420
|
+
* Fetches all the soundboard default sounds.
|
|
2421
|
+
*
|
|
2422
|
+
* @see {@link https://discord.com/developers/docs/resources/soundboard#list-default-soundboard-sounds}
|
|
2423
|
+
* @param options - The options for fetching the soundboard default sounds.
|
|
2424
|
+
*/
|
|
2425
|
+
async getSoundboardDefaultSounds({ signal } = {}) {
|
|
2426
|
+
return this.rest.get(Routes12.soundboardDefaultSounds(), {
|
|
2427
|
+
signal
|
|
2428
|
+
});
|
|
2429
|
+
}
|
|
2430
|
+
};
|
|
2431
|
+
|
|
2301
2432
|
// src/api/stageInstances.ts
|
|
2302
2433
|
import {
|
|
2303
|
-
Routes as
|
|
2434
|
+
Routes as Routes13
|
|
2304
2435
|
} from "discord-api-types/v10";
|
|
2305
2436
|
var StageInstancesAPI = class {
|
|
2306
2437
|
constructor(rest) {
|
|
@@ -2317,7 +2448,7 @@ var StageInstancesAPI = class {
|
|
|
2317
2448
|
* @param options - The options for creating the new stage instance
|
|
2318
2449
|
*/
|
|
2319
2450
|
async create(body, { reason, signal } = {}) {
|
|
2320
|
-
return this.rest.post(
|
|
2451
|
+
return this.rest.post(Routes13.stageInstances(), {
|
|
2321
2452
|
body,
|
|
2322
2453
|
reason,
|
|
2323
2454
|
signal
|
|
@@ -2331,7 +2462,7 @@ var StageInstancesAPI = class {
|
|
|
2331
2462
|
* @param options - The options for fetching the stage instance
|
|
2332
2463
|
*/
|
|
2333
2464
|
async get(channelId, { signal } = {}) {
|
|
2334
|
-
return this.rest.get(
|
|
2465
|
+
return this.rest.get(Routes13.stageInstance(channelId), { signal });
|
|
2335
2466
|
}
|
|
2336
2467
|
/**
|
|
2337
2468
|
* Edits a stage instance
|
|
@@ -2342,7 +2473,7 @@ var StageInstancesAPI = class {
|
|
|
2342
2473
|
* @param options - The options for editing the stage instance
|
|
2343
2474
|
*/
|
|
2344
2475
|
async edit(channelId, body, { reason, signal } = {}) {
|
|
2345
|
-
return this.rest.patch(
|
|
2476
|
+
return this.rest.patch(Routes13.stageInstance(channelId), {
|
|
2346
2477
|
body,
|
|
2347
2478
|
reason,
|
|
2348
2479
|
signal
|
|
@@ -2356,13 +2487,13 @@ var StageInstancesAPI = class {
|
|
|
2356
2487
|
* @param options - The options for deleting the stage instance
|
|
2357
2488
|
*/
|
|
2358
2489
|
async delete(channelId, { reason, signal } = {}) {
|
|
2359
|
-
await this.rest.delete(
|
|
2490
|
+
await this.rest.delete(Routes13.stageInstance(channelId), { reason, signal });
|
|
2360
2491
|
}
|
|
2361
2492
|
};
|
|
2362
2493
|
|
|
2363
2494
|
// src/api/sticker.ts
|
|
2364
2495
|
import {
|
|
2365
|
-
Routes as
|
|
2496
|
+
Routes as Routes14
|
|
2366
2497
|
} from "discord-api-types/v10";
|
|
2367
2498
|
var StickersAPI = class {
|
|
2368
2499
|
constructor(rest) {
|
|
@@ -2379,7 +2510,7 @@ var StickersAPI = class {
|
|
|
2379
2510
|
* @param options - The options for fetching the sticker pack
|
|
2380
2511
|
*/
|
|
2381
2512
|
async getStickerPack(packId, { signal } = {}) {
|
|
2382
|
-
return this.rest.get(
|
|
2513
|
+
return this.rest.get(Routes14.stickerPack(packId), { signal });
|
|
2383
2514
|
}
|
|
2384
2515
|
/**
|
|
2385
2516
|
* Fetches all of the sticker packs
|
|
@@ -2388,7 +2519,7 @@ var StickersAPI = class {
|
|
|
2388
2519
|
* @param options - The options for fetching the sticker packs
|
|
2389
2520
|
*/
|
|
2390
2521
|
async getStickers({ signal } = {}) {
|
|
2391
|
-
return this.rest.get(
|
|
2522
|
+
return this.rest.get(Routes14.stickerPacks(), { signal });
|
|
2392
2523
|
}
|
|
2393
2524
|
/**
|
|
2394
2525
|
* Fetches all of the sticker packs
|
|
@@ -2408,13 +2539,13 @@ var StickersAPI = class {
|
|
|
2408
2539
|
* @param options - The options for fetching the sticker
|
|
2409
2540
|
*/
|
|
2410
2541
|
async get(stickerId, { signal } = {}) {
|
|
2411
|
-
return this.rest.get(
|
|
2542
|
+
return this.rest.get(Routes14.sticker(stickerId), { signal });
|
|
2412
2543
|
}
|
|
2413
2544
|
};
|
|
2414
2545
|
|
|
2415
2546
|
// src/api/thread.ts
|
|
2416
2547
|
import {
|
|
2417
|
-
Routes as
|
|
2548
|
+
Routes as Routes15
|
|
2418
2549
|
} from "discord-api-types/v10";
|
|
2419
2550
|
var ThreadsAPI = class {
|
|
2420
2551
|
constructor(rest) {
|
|
@@ -2431,7 +2562,7 @@ var ThreadsAPI = class {
|
|
|
2431
2562
|
* @param options - The options for joining the thread
|
|
2432
2563
|
*/
|
|
2433
2564
|
async join(threadId, { signal } = {}) {
|
|
2434
|
-
await this.rest.put(
|
|
2565
|
+
await this.rest.put(Routes15.threadMembers(threadId, "@me"), { signal });
|
|
2435
2566
|
}
|
|
2436
2567
|
/**
|
|
2437
2568
|
* Adds a member to a thread
|
|
@@ -2442,7 +2573,7 @@ var ThreadsAPI = class {
|
|
|
2442
2573
|
* @param options - The options for adding the member to the thread
|
|
2443
2574
|
*/
|
|
2444
2575
|
async addMember(threadId, userId, { signal } = {}) {
|
|
2445
|
-
await this.rest.put(
|
|
2576
|
+
await this.rest.put(Routes15.threadMembers(threadId, userId), { signal });
|
|
2446
2577
|
}
|
|
2447
2578
|
/**
|
|
2448
2579
|
* Removes the current user from a thread
|
|
@@ -2452,7 +2583,7 @@ var ThreadsAPI = class {
|
|
|
2452
2583
|
* @param options - The options for leaving the thread
|
|
2453
2584
|
*/
|
|
2454
2585
|
async leave(threadId, { signal } = {}) {
|
|
2455
|
-
await this.rest.delete(
|
|
2586
|
+
await this.rest.delete(Routes15.threadMembers(threadId, "@me"), { signal });
|
|
2456
2587
|
}
|
|
2457
2588
|
/**
|
|
2458
2589
|
* Removes a member from a thread
|
|
@@ -2463,7 +2594,7 @@ var ThreadsAPI = class {
|
|
|
2463
2594
|
* @param options - The options for removing the member from the thread
|
|
2464
2595
|
*/
|
|
2465
2596
|
async removeMember(threadId, userId, { signal } = {}) {
|
|
2466
|
-
await this.rest.delete(
|
|
2597
|
+
await this.rest.delete(Routes15.threadMembers(threadId, userId), { signal });
|
|
2467
2598
|
}
|
|
2468
2599
|
/**
|
|
2469
2600
|
* Fetches a member of a thread
|
|
@@ -2474,7 +2605,7 @@ var ThreadsAPI = class {
|
|
|
2474
2605
|
* @param options - The options for fetching the member
|
|
2475
2606
|
*/
|
|
2476
2607
|
async getMember(threadId, userId, { signal } = {}) {
|
|
2477
|
-
return this.rest.get(
|
|
2608
|
+
return this.rest.get(Routes15.threadMembers(threadId, userId), { signal });
|
|
2478
2609
|
}
|
|
2479
2610
|
/**
|
|
2480
2611
|
* Fetches all members of a thread
|
|
@@ -2484,14 +2615,14 @@ var ThreadsAPI = class {
|
|
|
2484
2615
|
* @param options - The options for fetching the members
|
|
2485
2616
|
*/
|
|
2486
2617
|
async getAllMembers(threadId, { signal } = {}) {
|
|
2487
|
-
return this.rest.get(
|
|
2618
|
+
return this.rest.get(Routes15.threadMembers(threadId), { signal });
|
|
2488
2619
|
}
|
|
2489
2620
|
};
|
|
2490
2621
|
|
|
2491
2622
|
// src/api/user.ts
|
|
2492
2623
|
import { makeURLSearchParams as makeURLSearchParams8 } from "@discordjs/rest";
|
|
2493
2624
|
import {
|
|
2494
|
-
Routes as
|
|
2625
|
+
Routes as Routes16
|
|
2495
2626
|
} from "discord-api-types/v10";
|
|
2496
2627
|
var UsersAPI = class {
|
|
2497
2628
|
constructor(rest) {
|
|
@@ -2508,7 +2639,7 @@ var UsersAPI = class {
|
|
|
2508
2639
|
* @param options - The options for fetching the user
|
|
2509
2640
|
*/
|
|
2510
2641
|
async get(userId, { signal } = {}) {
|
|
2511
|
-
return this.rest.get(
|
|
2642
|
+
return this.rest.get(Routes16.user(userId), { signal });
|
|
2512
2643
|
}
|
|
2513
2644
|
/**
|
|
2514
2645
|
* Returns the user object of the requester's account
|
|
@@ -2517,7 +2648,7 @@ var UsersAPI = class {
|
|
|
2517
2648
|
* @param options - The options for fetching the current user
|
|
2518
2649
|
*/
|
|
2519
2650
|
async getCurrent({ signal } = {}) {
|
|
2520
|
-
return this.rest.get(
|
|
2651
|
+
return this.rest.get(Routes16.user("@me"), { signal });
|
|
2521
2652
|
}
|
|
2522
2653
|
/**
|
|
2523
2654
|
* Returns a list of partial guild objects the current user is a member of
|
|
@@ -2527,7 +2658,7 @@ var UsersAPI = class {
|
|
|
2527
2658
|
* @param options - The options for fetching the guilds
|
|
2528
2659
|
*/
|
|
2529
2660
|
async getGuilds(query = {}, { signal } = {}) {
|
|
2530
|
-
return this.rest.get(
|
|
2661
|
+
return this.rest.get(Routes16.userGuilds(), {
|
|
2531
2662
|
query: makeURLSearchParams8(query),
|
|
2532
2663
|
signal
|
|
2533
2664
|
});
|
|
@@ -2540,7 +2671,7 @@ var UsersAPI = class {
|
|
|
2540
2671
|
* @param options - The options for leaving the guild
|
|
2541
2672
|
*/
|
|
2542
2673
|
async leaveGuild(guildId, { signal } = {}) {
|
|
2543
|
-
await this.rest.delete(
|
|
2674
|
+
await this.rest.delete(Routes16.userGuild(guildId), { signal });
|
|
2544
2675
|
}
|
|
2545
2676
|
/**
|
|
2546
2677
|
* Edits the current user
|
|
@@ -2550,7 +2681,7 @@ var UsersAPI = class {
|
|
|
2550
2681
|
* @param options - The options for editing the user
|
|
2551
2682
|
*/
|
|
2552
2683
|
async edit(body, { signal } = {}) {
|
|
2553
|
-
return this.rest.patch(
|
|
2684
|
+
return this.rest.patch(Routes16.user("@me"), { body, signal });
|
|
2554
2685
|
}
|
|
2555
2686
|
/**
|
|
2556
2687
|
* Fetches the guild member for the current user
|
|
@@ -2560,7 +2691,7 @@ var UsersAPI = class {
|
|
|
2560
2691
|
* @param options - The options for fetching the guild member
|
|
2561
2692
|
*/
|
|
2562
2693
|
async getGuildMember(guildId, { signal } = {}) {
|
|
2563
|
-
return this.rest.get(
|
|
2694
|
+
return this.rest.get(Routes16.userGuildMember(guildId), { signal });
|
|
2564
2695
|
}
|
|
2565
2696
|
/**
|
|
2566
2697
|
* Edits the guild member for the current user
|
|
@@ -2571,7 +2702,7 @@ var UsersAPI = class {
|
|
|
2571
2702
|
* @param options - The options for editing the guild member
|
|
2572
2703
|
*/
|
|
2573
2704
|
async editCurrentGuildMember(guildId, body = {}, { reason, signal } = {}) {
|
|
2574
|
-
return this.rest.patch(
|
|
2705
|
+
return this.rest.patch(Routes16.guildMember(guildId, "@me"), {
|
|
2575
2706
|
reason,
|
|
2576
2707
|
body,
|
|
2577
2708
|
signal
|
|
@@ -2585,7 +2716,7 @@ var UsersAPI = class {
|
|
|
2585
2716
|
* @param options - The options for opening the DM
|
|
2586
2717
|
*/
|
|
2587
2718
|
async createDM(userId, { signal } = {}) {
|
|
2588
|
-
return this.rest.post(
|
|
2719
|
+
return this.rest.post(Routes16.userChannels(), {
|
|
2589
2720
|
body: { recipient_id: userId },
|
|
2590
2721
|
signal
|
|
2591
2722
|
});
|
|
@@ -2597,7 +2728,7 @@ var UsersAPI = class {
|
|
|
2597
2728
|
* @param options - The options for fetching the user's connections
|
|
2598
2729
|
*/
|
|
2599
2730
|
async getConnections({ signal } = {}) {
|
|
2600
|
-
return this.rest.get(
|
|
2731
|
+
return this.rest.get(Routes16.userConnections(), { signal });
|
|
2601
2732
|
}
|
|
2602
2733
|
/**
|
|
2603
2734
|
* Gets the current user's active application role connection
|
|
@@ -2607,7 +2738,7 @@ var UsersAPI = class {
|
|
|
2607
2738
|
* @param options - The options for fetching the role connections
|
|
2608
2739
|
*/
|
|
2609
2740
|
async getApplicationRoleConnection(applicationId, { signal } = {}) {
|
|
2610
|
-
return this.rest.get(
|
|
2741
|
+
return this.rest.get(Routes16.userApplicationRoleConnection(applicationId), {
|
|
2611
2742
|
signal
|
|
2612
2743
|
});
|
|
2613
2744
|
}
|
|
@@ -2620,7 +2751,7 @@ var UsersAPI = class {
|
|
|
2620
2751
|
* @param options - The options for updating the application role connection
|
|
2621
2752
|
*/
|
|
2622
2753
|
async updateApplicationRoleConnection(applicationId, body, { signal } = {}) {
|
|
2623
|
-
return this.rest.put(
|
|
2754
|
+
return this.rest.put(Routes16.userApplicationRoleConnection(applicationId), {
|
|
2624
2755
|
body,
|
|
2625
2756
|
signal
|
|
2626
2757
|
});
|
|
@@ -2630,7 +2761,7 @@ var UsersAPI = class {
|
|
|
2630
2761
|
// src/api/webhook.ts
|
|
2631
2762
|
import { makeURLSearchParams as makeURLSearchParams9 } from "@discordjs/rest";
|
|
2632
2763
|
import {
|
|
2633
|
-
Routes as
|
|
2764
|
+
Routes as Routes17
|
|
2634
2765
|
} from "discord-api-types/v10";
|
|
2635
2766
|
var WebhooksAPI = class {
|
|
2636
2767
|
constructor(rest) {
|
|
@@ -2648,7 +2779,7 @@ var WebhooksAPI = class {
|
|
|
2648
2779
|
* @param options - The options for fetching the webhook
|
|
2649
2780
|
*/
|
|
2650
2781
|
async get(id, { token, signal } = {}) {
|
|
2651
|
-
return this.rest.get(
|
|
2782
|
+
return this.rest.get(Routes17.webhook(id, token), {
|
|
2652
2783
|
signal,
|
|
2653
2784
|
auth: !token
|
|
2654
2785
|
});
|
|
@@ -2663,7 +2794,7 @@ var WebhooksAPI = class {
|
|
|
2663
2794
|
* @param options - The options for editing the webhook
|
|
2664
2795
|
*/
|
|
2665
2796
|
async edit(id, body, { token, reason, signal } = {}) {
|
|
2666
|
-
return this.rest.patch(
|
|
2797
|
+
return this.rest.patch(Routes17.webhook(id, token), {
|
|
2667
2798
|
reason,
|
|
2668
2799
|
body,
|
|
2669
2800
|
signal,
|
|
@@ -2679,7 +2810,7 @@ var WebhooksAPI = class {
|
|
|
2679
2810
|
* @param options - The options for deleting the webhook
|
|
2680
2811
|
*/
|
|
2681
2812
|
async delete(id, { token, reason, signal } = {}) {
|
|
2682
|
-
await this.rest.delete(
|
|
2813
|
+
await this.rest.delete(Routes17.webhook(id, token), {
|
|
2683
2814
|
reason,
|
|
2684
2815
|
signal,
|
|
2685
2816
|
auth: !token
|
|
@@ -2700,7 +2831,7 @@ var WebhooksAPI = class {
|
|
|
2700
2831
|
files,
|
|
2701
2832
|
...body
|
|
2702
2833
|
}, { signal } = {}) {
|
|
2703
|
-
return this.rest.post(
|
|
2834
|
+
return this.rest.post(Routes17.webhook(id, token), {
|
|
2704
2835
|
query: makeURLSearchParams9({ wait, thread_id }),
|
|
2705
2836
|
files,
|
|
2706
2837
|
body,
|
|
@@ -2720,7 +2851,7 @@ var WebhooksAPI = class {
|
|
|
2720
2851
|
* @param options - The options for executing the webhook
|
|
2721
2852
|
*/
|
|
2722
2853
|
async executeSlack(id, token, body, query = {}, { signal } = {}) {
|
|
2723
|
-
await this.rest.post(
|
|
2854
|
+
await this.rest.post(Routes17.webhookPlatform(id, token, "slack"), {
|
|
2724
2855
|
query: makeURLSearchParams9(query),
|
|
2725
2856
|
body,
|
|
2726
2857
|
auth: false,
|
|
@@ -2738,7 +2869,7 @@ var WebhooksAPI = class {
|
|
|
2738
2869
|
* @param options - The options for executing the webhook
|
|
2739
2870
|
*/
|
|
2740
2871
|
async executeGitHub(id, token, body, query = {}, { signal } = {}) {
|
|
2741
|
-
await this.rest.post(
|
|
2872
|
+
await this.rest.post(Routes17.webhookPlatform(id, token, "github"), {
|
|
2742
2873
|
query: makeURLSearchParams9(query),
|
|
2743
2874
|
body,
|
|
2744
2875
|
signal,
|
|
@@ -2756,7 +2887,7 @@ var WebhooksAPI = class {
|
|
|
2756
2887
|
* @param options - The options for fetching the message
|
|
2757
2888
|
*/
|
|
2758
2889
|
async getMessage(id, token, messageId, query = {}, { signal } = {}) {
|
|
2759
|
-
return this.rest.get(
|
|
2890
|
+
return this.rest.get(Routes17.webhookMessage(id, token, messageId), {
|
|
2760
2891
|
query: makeURLSearchParams9(query),
|
|
2761
2892
|
auth: false,
|
|
2762
2893
|
signal
|
|
@@ -2777,7 +2908,7 @@ var WebhooksAPI = class {
|
|
|
2777
2908
|
files,
|
|
2778
2909
|
...body
|
|
2779
2910
|
}, { signal } = {}) {
|
|
2780
|
-
return this.rest.patch(
|
|
2911
|
+
return this.rest.patch(Routes17.webhookMessage(id, token, messageId), {
|
|
2781
2912
|
query: makeURLSearchParams9({ thread_id }),
|
|
2782
2913
|
auth: false,
|
|
2783
2914
|
body,
|
|
@@ -2796,7 +2927,7 @@ var WebhooksAPI = class {
|
|
|
2796
2927
|
* @param options - The options for deleting the message
|
|
2797
2928
|
*/
|
|
2798
2929
|
async deleteMessage(id, token, messageId, query = {}, { signal } = {}) {
|
|
2799
|
-
await this.rest.delete(
|
|
2930
|
+
await this.rest.delete(Routes17.webhookMessage(id, token, messageId), {
|
|
2800
2931
|
query: makeURLSearchParams9(query),
|
|
2801
2932
|
auth: false,
|
|
2802
2933
|
signal
|
|
@@ -2817,6 +2948,7 @@ var API = class {
|
|
|
2817
2948
|
this.oauth2 = new OAuth2API(rest);
|
|
2818
2949
|
this.poll = new PollAPI(rest);
|
|
2819
2950
|
this.roleConnections = new RoleConnectionsAPI(rest);
|
|
2951
|
+
this.soundboardSounds = new SoundboardSoundsAPI(rest);
|
|
2820
2952
|
this.stageInstances = new StageInstancesAPI(rest);
|
|
2821
2953
|
this.stickers = new StickersAPI(rest);
|
|
2822
2954
|
this.threads = new ThreadsAPI(rest);
|
|
@@ -2838,6 +2970,7 @@ var API = class {
|
|
|
2838
2970
|
oauth2;
|
|
2839
2971
|
poll;
|
|
2840
2972
|
roleConnections;
|
|
2973
|
+
soundboardSounds;
|
|
2841
2974
|
stageInstances;
|
|
2842
2975
|
stickers;
|
|
2843
2976
|
threads;
|
|
@@ -2865,7 +2998,7 @@ __name(withFiles, "withFiles");
|
|
|
2865
2998
|
|
|
2866
2999
|
// src/http-only/index.ts
|
|
2867
3000
|
export * from "discord-api-types/v10";
|
|
2868
|
-
var version = "2.0
|
|
3001
|
+
var version = "2.1.0-dev.1730808317-1184b38d3";
|
|
2869
3002
|
export {
|
|
2870
3003
|
API,
|
|
2871
3004
|
ApplicationCommandsAPI,
|
|
@@ -2878,6 +3011,7 @@ export {
|
|
|
2878
3011
|
OAuth2API,
|
|
2879
3012
|
PollAPI,
|
|
2880
3013
|
RoleConnectionsAPI,
|
|
3014
|
+
SoundboardSoundsAPI,
|
|
2881
3015
|
StageInstancesAPI,
|
|
2882
3016
|
StickersAPI,
|
|
2883
3017
|
ThreadsAPI,
|