@discordjs/core 2.1.0-dev.1732709132-97ffa201a → 2.1.0-dev.1738965220-519aa3abe
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/README.md +2 -1
- package/dist/http-only.d.mts +23 -234
- package/dist/http-only.d.ts +23 -234
- package/dist/http-only.js +138 -284
- package/dist/http-only.js.map +1 -1
- package/dist/http-only.mjs +138 -283
- package/dist/http-only.mjs.map +1 -1
- package/dist/index.d.mts +23 -241
- package/dist/index.d.ts +23 -241
- package/dist/index.js +143 -289
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +138 -283
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -12
package/dist/http-only.mjs
CHANGED
|
@@ -378,17 +378,9 @@ var ChannelsAPI = class {
|
|
|
378
378
|
* @see {@link https://discord.com/developers/docs/resources/message#get-reactions}
|
|
379
379
|
* @param channelId - The id of the channel the message is in
|
|
380
380
|
* @param messageId - The id of the message to get the reactions for
|
|
381
|
-
* @param emoji - The emoji to get the reactions for
|
|
381
|
+
* @param emoji - The emoji to get the reactions for
|
|
382
382
|
* @param query - The query options for fetching the reactions
|
|
383
383
|
* @param options - The options for fetching the message reactions
|
|
384
|
-
* @example
|
|
385
|
-
* ```ts
|
|
386
|
-
* // Unicode.
|
|
387
|
-
* await api.channels.getMessageReactions('1234567890', '1234567890', '👍');
|
|
388
|
-
*
|
|
389
|
-
* // Custom emoji.
|
|
390
|
-
* await api.channels.getMessageReactions('1234567890', '1234567890', 'emoji_name:1234567890');
|
|
391
|
-
* ```
|
|
392
384
|
*/
|
|
393
385
|
async getMessageReactions(channelId, messageId, emoji, query = {}, { signal } = {}) {
|
|
394
386
|
return this.rest.get(Routes3.channelMessageReaction(channelId, messageId, encodeURIComponent(emoji)), {
|
|
@@ -402,16 +394,8 @@ var ChannelsAPI = class {
|
|
|
402
394
|
* @see {@link https://discord.com/developers/docs/resources/message#delete-own-reaction}
|
|
403
395
|
* @param channelId - The id of the channel the message is in
|
|
404
396
|
* @param messageId - The id of the message to delete the reaction for
|
|
405
|
-
* @param emoji - The emoji to delete the reaction for
|
|
397
|
+
* @param emoji - The emoji to delete the reaction for
|
|
406
398
|
* @param options - The options for deleting the reaction
|
|
407
|
-
* @example
|
|
408
|
-
* ```ts
|
|
409
|
-
* // Unicode.
|
|
410
|
-
* await api.channels.deleteOwnMessageReaction('1234567890', '1234567890', '👍');
|
|
411
|
-
*
|
|
412
|
-
* // Custom emoji.
|
|
413
|
-
* await api.channels.deleteOwnMessageReaction('1234567890', '1234567890', 'emoji_name:1234567890');
|
|
414
|
-
* ```
|
|
415
399
|
*/
|
|
416
400
|
async deleteOwnMessageReaction(channelId, messageId, emoji, { signal } = {}) {
|
|
417
401
|
await this.rest.delete(Routes3.channelMessageOwnReaction(channelId, messageId, encodeURIComponent(emoji)), {
|
|
@@ -424,17 +408,9 @@ var ChannelsAPI = class {
|
|
|
424
408
|
* @see {@link https://discord.com/developers/docs/resources/message#delete-user-reaction}
|
|
425
409
|
* @param channelId - The id of the channel the message is in
|
|
426
410
|
* @param messageId - The id of the message to delete the reaction for
|
|
427
|
-
* @param emoji - The emoji to delete the reaction for
|
|
411
|
+
* @param emoji - The emoji to delete the reaction for
|
|
428
412
|
* @param userId - The id of the user to delete the reaction for
|
|
429
413
|
* @param options - The options for deleting the reaction
|
|
430
|
-
* @example
|
|
431
|
-
* ```ts
|
|
432
|
-
* // Unicode.
|
|
433
|
-
* await api.channels.deleteUserMessageReaction('1234567890', '1234567890', '👍', '1234567890');
|
|
434
|
-
*
|
|
435
|
-
* // Custom emoji.
|
|
436
|
-
* await api.channels.deleteUserMessageReaction('1234567890', '1234567890', 'emoji_name:1234567890', '1234567890');
|
|
437
|
-
* ```
|
|
438
414
|
*/
|
|
439
415
|
async deleteUserMessageReaction(channelId, messageId, emoji, userId, { signal } = {}) {
|
|
440
416
|
await this.rest.delete(Routes3.channelMessageUserReaction(channelId, messageId, encodeURIComponent(emoji), userId), {
|
|
@@ -458,16 +434,8 @@ var ChannelsAPI = class {
|
|
|
458
434
|
* @see {@link https://discord.com/developers/docs/resources/message#delete-all-reactions-for-emoji}
|
|
459
435
|
* @param channelId - The id of the channel the message is in
|
|
460
436
|
* @param messageId - The id of the message to delete the reactions for
|
|
461
|
-
* @param emoji - The emoji to delete the reactions for
|
|
437
|
+
* @param emoji - The emoji to delete the reactions for
|
|
462
438
|
* @param options - The options for deleting the reactions
|
|
463
|
-
* @example
|
|
464
|
-
* ```ts
|
|
465
|
-
* // Unicode.
|
|
466
|
-
* await api.channels.deleteAllMessageReactionsForEmoji('1234567890', '1234567890', '👍');
|
|
467
|
-
*
|
|
468
|
-
* // Custom emoji.
|
|
469
|
-
* await api.channels.deleteAllMessageReactionsForEmoji('1234567890', '1234567890', 'emoji_name:1234567890');
|
|
470
|
-
* ```
|
|
471
439
|
*/
|
|
472
440
|
async deleteAllMessageReactionsForEmoji(channelId, messageId, emoji, { signal } = {}) {
|
|
473
441
|
await this.rest.delete(Routes3.channelMessageReaction(channelId, messageId, encodeURIComponent(emoji)), { signal });
|
|
@@ -478,16 +446,8 @@ var ChannelsAPI = class {
|
|
|
478
446
|
* @see {@link https://discord.com/developers/docs/resources/message#create-reaction}
|
|
479
447
|
* @param channelId - The id of the channel the message is in
|
|
480
448
|
* @param messageId - The id of the message to add the reaction to
|
|
481
|
-
* @param emoji - The emoji to add the reaction with
|
|
449
|
+
* @param emoji - The emoji to add the reaction with
|
|
482
450
|
* @param options - The options for adding the reaction
|
|
483
|
-
* @example
|
|
484
|
-
* ```ts
|
|
485
|
-
* // Unicode.
|
|
486
|
-
* await api.channels.addMessageReaction('1234567890', '1234567890', '👍');
|
|
487
|
-
*
|
|
488
|
-
* // Custom emoji.
|
|
489
|
-
* await api.channels.addMessageReaction('1234567890', '1234567890', 'emoji_name:1234567890');
|
|
490
|
-
* ```
|
|
491
451
|
*/
|
|
492
452
|
async addMessageReaction(channelId, messageId, emoji, { signal } = {}) {
|
|
493
453
|
await this.rest.put(Routes3.channelMessageOwnReaction(channelId, messageId, encodeURIComponent(emoji)), { signal });
|
|
@@ -783,20 +743,6 @@ var ChannelsAPI = class {
|
|
|
783
743
|
signal
|
|
784
744
|
});
|
|
785
745
|
}
|
|
786
|
-
/**
|
|
787
|
-
* Sends a soundboard sound in a channel
|
|
788
|
-
*
|
|
789
|
-
* @see {@link https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound}
|
|
790
|
-
* @param channelId - The id of the channel to send the soundboard sound in
|
|
791
|
-
* @param body - The data for sending the soundboard sound
|
|
792
|
-
* @param options - The options for sending the soundboard sound
|
|
793
|
-
*/
|
|
794
|
-
async sendSoundboardSound(channelId, body, { signal } = {}) {
|
|
795
|
-
return this.rest.post(Routes3.sendSoundboardSound(channelId), {
|
|
796
|
-
body,
|
|
797
|
-
signal
|
|
798
|
-
});
|
|
799
|
-
}
|
|
800
746
|
};
|
|
801
747
|
|
|
802
748
|
// src/api/guild.ts
|
|
@@ -1829,77 +1775,9 @@ var GuildsAPI = class {
|
|
|
1829
1775
|
signal
|
|
1830
1776
|
});
|
|
1831
1777
|
}
|
|
1832
|
-
/**
|
|
1833
|
-
* Fetches all the soundboard sounds for a guild
|
|
1834
|
-
*
|
|
1835
|
-
* @see {@link https://discord.com/developers/docs/resources/soundboard#list-guild-soundboard-sounds}
|
|
1836
|
-
* @param guildId - The id of the guild to fetch the soundboard sounds for
|
|
1837
|
-
* @param options - The options for fetching the soundboard sounds
|
|
1838
|
-
*/
|
|
1839
|
-
async getSoundboardSounds(guildId, { signal } = {}) {
|
|
1840
|
-
return this.rest.get(Routes5.guildSoundboardSounds(guildId), {
|
|
1841
|
-
signal
|
|
1842
|
-
});
|
|
1843
|
-
}
|
|
1844
|
-
/**
|
|
1845
|
-
* Fetches a soundboard sound for a guild
|
|
1846
|
-
*
|
|
1847
|
-
* @see {@link https://discord.com/developers/docs/resources/soundboard#get-guild-soundboard-sound}
|
|
1848
|
-
* @param guildId - The id of the guild to fetch the soundboard sound for
|
|
1849
|
-
* @param soundId - The id of the soundboard sound to fetch
|
|
1850
|
-
* @param options - The options for fetching the soundboard sound
|
|
1851
|
-
*/
|
|
1852
|
-
async getSoundboardSound(guildId, soundId, { signal } = {}) {
|
|
1853
|
-
return this.rest.get(Routes5.guildSoundboardSound(guildId, soundId), {
|
|
1854
|
-
signal
|
|
1855
|
-
});
|
|
1856
|
-
}
|
|
1857
|
-
/**
|
|
1858
|
-
* Creates a new soundboard sound for a guild
|
|
1859
|
-
*
|
|
1860
|
-
* @see {@link https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound}
|
|
1861
|
-
* @param guildId - The id of the guild to create the soundboard sound for
|
|
1862
|
-
* @param body - The data for creating the soundboard sound
|
|
1863
|
-
* @param options - The options for creating the soundboard sound
|
|
1864
|
-
*/
|
|
1865
|
-
async createSoundboardSound(guildId, body, { reason, signal } = {}) {
|
|
1866
|
-
return this.rest.post(Routes5.guildSoundboardSounds(guildId), {
|
|
1867
|
-
body,
|
|
1868
|
-
reason,
|
|
1869
|
-
signal
|
|
1870
|
-
});
|
|
1871
|
-
}
|
|
1872
|
-
/**
|
|
1873
|
-
* Edits a soundboard sound for a guild
|
|
1874
|
-
*
|
|
1875
|
-
* @see {@link https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound}
|
|
1876
|
-
* @param guildId - The id of the guild to edit the soundboard sound for
|
|
1877
|
-
* @param soundId - The id of the soundboard sound to edit
|
|
1878
|
-
* @param body - The data for editing the soundboard sound
|
|
1879
|
-
* @param options - The options for editing the soundboard sound
|
|
1880
|
-
*/
|
|
1881
|
-
async editSoundboardSound(guildId, soundId, body, { reason, signal } = {}) {
|
|
1882
|
-
return this.rest.patch(Routes5.guildSoundboardSound(guildId, soundId), {
|
|
1883
|
-
body,
|
|
1884
|
-
reason,
|
|
1885
|
-
signal
|
|
1886
|
-
});
|
|
1887
|
-
}
|
|
1888
|
-
/**
|
|
1889
|
-
* Deletes a soundboard sound for a guild
|
|
1890
|
-
*
|
|
1891
|
-
* @see {@link https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound}
|
|
1892
|
-
* @param guildId - The id of the guild to delete the soundboard sound for
|
|
1893
|
-
* @param soundId - The id of the soundboard sound to delete
|
|
1894
|
-
* @param options - The options for deleting the soundboard sound
|
|
1895
|
-
*/
|
|
1896
|
-
async deleteSoundboardSound(guildId, soundId, { reason, signal } = {}) {
|
|
1897
|
-
await this.rest.delete(Routes5.guildSoundboardSound(guildId, soundId), { reason, signal });
|
|
1898
|
-
}
|
|
1899
1778
|
};
|
|
1900
1779
|
|
|
1901
1780
|
// src/api/interactions.ts
|
|
1902
|
-
import { makeURLSearchParams as makeURLSearchParams4 } from "@discordjs/rest";
|
|
1903
1781
|
import {
|
|
1904
1782
|
InteractionResponseType,
|
|
1905
1783
|
Routes as Routes6
|
|
@@ -1912,13 +1790,17 @@ var InteractionsAPI = class {
|
|
|
1912
1790
|
static {
|
|
1913
1791
|
__name(this, "InteractionsAPI");
|
|
1914
1792
|
}
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1793
|
+
/**
|
|
1794
|
+
* Replies to an interaction
|
|
1795
|
+
*
|
|
1796
|
+
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1797
|
+
* @param interactionId - The id of the interaction
|
|
1798
|
+
* @param interactionToken - The token of the interaction
|
|
1799
|
+
* @param body - The callback data for replying
|
|
1800
|
+
* @param options - The options for replying
|
|
1801
|
+
*/
|
|
1802
|
+
async reply(interactionId, interactionToken, { files, ...data }, { signal } = {}) {
|
|
1803
|
+
await this.rest.post(Routes6.interactionCallback(interactionId, interactionToken), {
|
|
1922
1804
|
files,
|
|
1923
1805
|
auth: false,
|
|
1924
1806
|
body: {
|
|
@@ -1927,14 +1809,18 @@ var InteractionsAPI = class {
|
|
|
1927
1809
|
},
|
|
1928
1810
|
signal
|
|
1929
1811
|
});
|
|
1930
|
-
return with_response ? response : void 0;
|
|
1931
1812
|
}
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1813
|
+
/**
|
|
1814
|
+
* Defers the reply to an interaction
|
|
1815
|
+
*
|
|
1816
|
+
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1817
|
+
* @param interactionId - The id of the interaction
|
|
1818
|
+
* @param interactionToken - The token of the interaction
|
|
1819
|
+
* @param data - The data for deferring the reply
|
|
1820
|
+
* @param options - The options for deferring
|
|
1821
|
+
*/
|
|
1822
|
+
async defer(interactionId, interactionToken, data, { signal } = {}) {
|
|
1823
|
+
await this.rest.post(Routes6.interactionCallback(interactionId, interactionToken), {
|
|
1938
1824
|
auth: false,
|
|
1939
1825
|
body: {
|
|
1940
1826
|
type: InteractionResponseType.DeferredChannelMessageWithSource,
|
|
@@ -1942,18 +1828,23 @@ var InteractionsAPI = class {
|
|
|
1942
1828
|
},
|
|
1943
1829
|
signal
|
|
1944
1830
|
});
|
|
1945
|
-
return with_response ? response : void 0;
|
|
1946
1831
|
}
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1832
|
+
/**
|
|
1833
|
+
* Defers an update from a message component interaction
|
|
1834
|
+
*
|
|
1835
|
+
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1836
|
+
* @param interactionId - The id of the interaction
|
|
1837
|
+
* @param interactionToken - The token of the interaction
|
|
1838
|
+
* @param options - The options for deferring
|
|
1839
|
+
*/
|
|
1840
|
+
async deferMessageUpdate(interactionId, interactionToken, { signal } = {}) {
|
|
1841
|
+
await this.rest.post(Routes6.interactionCallback(interactionId, interactionToken), {
|
|
1950
1842
|
auth: false,
|
|
1951
1843
|
body: {
|
|
1952
1844
|
type: InteractionResponseType.DeferredMessageUpdate
|
|
1953
1845
|
},
|
|
1954
1846
|
signal
|
|
1955
1847
|
});
|
|
1956
|
-
return with_response ? response : void 0;
|
|
1957
1848
|
}
|
|
1958
1849
|
/**
|
|
1959
1850
|
* Reply to a deferred interaction
|
|
@@ -2013,12 +1904,17 @@ var InteractionsAPI = class {
|
|
|
2013
1904
|
async deleteReply(applicationId, interactionToken, messageId, { signal } = {}) {
|
|
2014
1905
|
await this.webhooks.deleteMessage(applicationId, interactionToken, messageId ?? "@original", {}, { signal });
|
|
2015
1906
|
}
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
1907
|
+
/**
|
|
1908
|
+
* Updates the message the component interaction was triggered on
|
|
1909
|
+
*
|
|
1910
|
+
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1911
|
+
* @param interactionId - The id of the interaction
|
|
1912
|
+
* @param interactionToken - The token of the interaction
|
|
1913
|
+
* @param callbackData - The callback data for updating the interaction
|
|
1914
|
+
* @param options - The options for updating the interaction
|
|
1915
|
+
*/
|
|
1916
|
+
async updateMessage(interactionId, interactionToken, { files, ...data }, { signal } = {}) {
|
|
1917
|
+
await this.rest.post(Routes6.interactionCallback(interactionId, interactionToken), {
|
|
2022
1918
|
files,
|
|
2023
1919
|
auth: false,
|
|
2024
1920
|
body: {
|
|
@@ -2027,32 +1923,44 @@ var InteractionsAPI = class {
|
|
|
2027
1923
|
},
|
|
2028
1924
|
signal
|
|
2029
1925
|
});
|
|
2030
|
-
return with_response ? response : void 0;
|
|
2031
1926
|
}
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
1927
|
+
/**
|
|
1928
|
+
* Sends an autocomplete response to an interaction
|
|
1929
|
+
*
|
|
1930
|
+
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1931
|
+
* @param interactionId - The id of the interaction
|
|
1932
|
+
* @param interactionToken - The token of the interaction
|
|
1933
|
+
* @param callbackData - The callback data for the autocomplete response
|
|
1934
|
+
* @param options - The options for sending the autocomplete response
|
|
1935
|
+
*/
|
|
1936
|
+
async createAutocompleteResponse(interactionId, interactionToken, callbackData, { signal } = {}) {
|
|
1937
|
+
await this.rest.post(Routes6.interactionCallback(interactionId, interactionToken), {
|
|
2037
1938
|
auth: false,
|
|
2038
1939
|
body: {
|
|
2039
1940
|
type: InteractionResponseType.ApplicationCommandAutocompleteResult,
|
|
2040
|
-
data
|
|
1941
|
+
data: callbackData
|
|
2041
1942
|
},
|
|
2042
1943
|
signal
|
|
2043
1944
|
});
|
|
2044
|
-
return with_response ? response : void 0;
|
|
2045
1945
|
}
|
|
2046
|
-
|
|
2047
|
-
|
|
1946
|
+
/**
|
|
1947
|
+
* Sends a modal response to an interaction
|
|
1948
|
+
*
|
|
1949
|
+
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1950
|
+
* @param interactionId - The id of the interaction
|
|
1951
|
+
* @param interactionToken - The token of the interaction
|
|
1952
|
+
* @param callbackData - The modal callback data to send
|
|
1953
|
+
* @param options - The options for sending the modal
|
|
1954
|
+
*/
|
|
1955
|
+
async createModal(interactionId, interactionToken, callbackData, { signal } = {}) {
|
|
1956
|
+
await this.rest.post(Routes6.interactionCallback(interactionId, interactionToken), {
|
|
2048
1957
|
auth: false,
|
|
2049
1958
|
body: {
|
|
2050
1959
|
type: InteractionResponseType.Modal,
|
|
2051
|
-
data
|
|
1960
|
+
data: callbackData
|
|
2052
1961
|
},
|
|
2053
1962
|
signal
|
|
2054
1963
|
});
|
|
2055
|
-
return with_response ? response : void 0;
|
|
2056
1964
|
}
|
|
2057
1965
|
/**
|
|
2058
1966
|
* Sends a premium required response to an interaction
|
|
@@ -2061,7 +1969,7 @@ var InteractionsAPI = class {
|
|
|
2061
1969
|
* @param interactionId - The id of the interaction
|
|
2062
1970
|
* @param interactionToken - The token of the interaction
|
|
2063
1971
|
* @param options - The options for sending the premium required response
|
|
2064
|
-
* @deprecated Sending a premium-style button is the new Discord
|
|
1972
|
+
* @deprecated Sending a premium-style button is the new Discord behavior.
|
|
2065
1973
|
*/
|
|
2066
1974
|
async sendPremiumRequired(interactionId, interactionToken, { signal } = {}) {
|
|
2067
1975
|
await this.rest.post(Routes6.interactionCallback(interactionId, interactionToken), {
|
|
@@ -2075,7 +1983,7 @@ var InteractionsAPI = class {
|
|
|
2075
1983
|
};
|
|
2076
1984
|
|
|
2077
1985
|
// src/api/invite.ts
|
|
2078
|
-
import { makeURLSearchParams as
|
|
1986
|
+
import { makeURLSearchParams as makeURLSearchParams4 } from "@discordjs/rest";
|
|
2079
1987
|
import { Routes as Routes7 } from "discord-api-types/v10";
|
|
2080
1988
|
var InvitesAPI = class {
|
|
2081
1989
|
constructor(rest) {
|
|
@@ -2094,7 +2002,7 @@ var InvitesAPI = class {
|
|
|
2094
2002
|
*/
|
|
2095
2003
|
async get(code, query = {}, { signal } = {}) {
|
|
2096
2004
|
return this.rest.get(Routes7.invite(code), {
|
|
2097
|
-
query:
|
|
2005
|
+
query: makeURLSearchParams4(query),
|
|
2098
2006
|
signal
|
|
2099
2007
|
});
|
|
2100
2008
|
}
|
|
@@ -2111,7 +2019,7 @@ var InvitesAPI = class {
|
|
|
2111
2019
|
};
|
|
2112
2020
|
|
|
2113
2021
|
// src/api/monetization.ts
|
|
2114
|
-
import { makeURLSearchParams as
|
|
2022
|
+
import { makeURLSearchParams as makeURLSearchParams5 } from "@discordjs/rest";
|
|
2115
2023
|
import {
|
|
2116
2024
|
Routes as Routes8
|
|
2117
2025
|
} from "discord-api-types/v10";
|
|
@@ -2125,44 +2033,16 @@ var MonetizationAPI = class {
|
|
|
2125
2033
|
/**
|
|
2126
2034
|
* Fetches the SKUs for an application.
|
|
2127
2035
|
*
|
|
2128
|
-
* @see {@link https://discord.com/developers/docs/
|
|
2129
|
-
* @param applicationId - The application id to fetch SKUs for
|
|
2036
|
+
* @see {@link https://discord.com/developers/docs/monetization/skus#list-skus}
|
|
2130
2037
|
* @param options - The options for fetching the SKUs.
|
|
2131
2038
|
*/
|
|
2132
2039
|
async getSKUs(applicationId, { signal } = {}) {
|
|
2133
2040
|
return this.rest.get(Routes8.skus(applicationId), { signal });
|
|
2134
2041
|
}
|
|
2135
|
-
/**
|
|
2136
|
-
* Fetches subscriptions for an SKU.
|
|
2137
|
-
*
|
|
2138
|
-
* @see {@link https://discord.com/developers/docs/resources/subscription#list-sku-subscriptions}
|
|
2139
|
-
* @param skuId - The SKU id to fetch subscriptions for
|
|
2140
|
-
* @param query - The query options for fetching subscriptions
|
|
2141
|
-
* @param options - The options for fetching subscriptions
|
|
2142
|
-
*/
|
|
2143
|
-
async getSKUSubscriptions(skuId, query, { signal } = {}) {
|
|
2144
|
-
return this.rest.get(Routes8.skuSubscriptions(skuId), {
|
|
2145
|
-
signal,
|
|
2146
|
-
query: makeURLSearchParams6(query)
|
|
2147
|
-
});
|
|
2148
|
-
}
|
|
2149
|
-
/**
|
|
2150
|
-
* Fetches a subscription for an SKU.
|
|
2151
|
-
*
|
|
2152
|
-
* @see {@link https://discord.com/developers/docs/resources/subscription#get-sku-subscription}
|
|
2153
|
-
* @param skuId - The SKU id to fetch subscription for
|
|
2154
|
-
* @param subscriptionId - The subscription id to fetch
|
|
2155
|
-
* @param options - The options for fetching the subscription
|
|
2156
|
-
*/
|
|
2157
|
-
async getSKUSubscription(skuId, subscriptionId, { signal } = {}) {
|
|
2158
|
-
return this.rest.get(Routes8.skuSubscription(skuId, subscriptionId), {
|
|
2159
|
-
signal
|
|
2160
|
-
});
|
|
2161
|
-
}
|
|
2162
2042
|
/**
|
|
2163
2043
|
* Fetches the entitlements for an application.
|
|
2164
2044
|
*
|
|
2165
|
-
* @see {@link https://discord.com/developers/docs/
|
|
2045
|
+
* @see {@link https://discord.com/developers/docs/monetization/entitlements#list-entitlements}
|
|
2166
2046
|
* @param applicationId - The application id to fetch entitlements for
|
|
2167
2047
|
* @param query - The query options for fetching entitlements
|
|
2168
2048
|
* @param options - The options for fetching entitlements
|
|
@@ -2170,13 +2050,13 @@ var MonetizationAPI = class {
|
|
|
2170
2050
|
async getEntitlements(applicationId, query, { signal } = {}) {
|
|
2171
2051
|
return this.rest.get(Routes8.entitlements(applicationId), {
|
|
2172
2052
|
signal,
|
|
2173
|
-
query:
|
|
2053
|
+
query: makeURLSearchParams5(query)
|
|
2174
2054
|
});
|
|
2175
2055
|
}
|
|
2176
2056
|
/**
|
|
2177
2057
|
* Creates a test entitlement for an application's SKU.
|
|
2178
2058
|
*
|
|
2179
|
-
* @see {@link https://discord.com/developers/docs/
|
|
2059
|
+
* @see {@link https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement}
|
|
2180
2060
|
* @param applicationId - The application id to create the entitlement for
|
|
2181
2061
|
* @param body - The data for creating the entitlement
|
|
2182
2062
|
* @param options - The options for creating the entitlement
|
|
@@ -2190,7 +2070,7 @@ var MonetizationAPI = class {
|
|
|
2190
2070
|
/**
|
|
2191
2071
|
* Deletes a test entitlement for an application's SKU.
|
|
2192
2072
|
*
|
|
2193
|
-
* @see {@link https://discord.com/developers/docs/
|
|
2073
|
+
* @see {@link https://discord.com/developers/docs/monetization/entitlements#delete-test-entitlement}
|
|
2194
2074
|
* @param applicationId - The application id to delete the entitlement for
|
|
2195
2075
|
* @param entitlementId - The entitlement id to delete
|
|
2196
2076
|
* @param options - The options for deleting the entitlement
|
|
@@ -2201,7 +2081,7 @@ var MonetizationAPI = class {
|
|
|
2201
2081
|
/**
|
|
2202
2082
|
* Marks a given entitlement for the user as consumed. Only available for One-Time Purchase consumable SKUs.
|
|
2203
2083
|
*
|
|
2204
|
-
* @see {@link https://discord.com/developers/docs/
|
|
2084
|
+
* @see {@link https://discord.com/developers/docs/monetization/entitlements#consume-an-entitlement}
|
|
2205
2085
|
* @param applicationId - The application id to consume the entitlement for
|
|
2206
2086
|
* @param entitlementId - The entitlement id to consume
|
|
2207
2087
|
* @param options - The options for consuming the entitlement
|
|
@@ -2212,7 +2092,7 @@ var MonetizationAPI = class {
|
|
|
2212
2092
|
};
|
|
2213
2093
|
|
|
2214
2094
|
// src/api/oauth2.ts
|
|
2215
|
-
import { makeURLSearchParams as
|
|
2095
|
+
import { makeURLSearchParams as makeURLSearchParams6 } from "@discordjs/rest";
|
|
2216
2096
|
import {
|
|
2217
2097
|
Routes as Routes9,
|
|
2218
2098
|
RouteBases
|
|
@@ -2232,7 +2112,7 @@ var OAuth2API = class {
|
|
|
2232
2112
|
*/
|
|
2233
2113
|
generateAuthorizationURL(options) {
|
|
2234
2114
|
const url = new URL(`${RouteBases.api}${Routes9.oauth2Authorization()}`);
|
|
2235
|
-
url.search =
|
|
2115
|
+
url.search = makeURLSearchParams6(options).toString();
|
|
2236
2116
|
return url.toString();
|
|
2237
2117
|
}
|
|
2238
2118
|
/**
|
|
@@ -2244,7 +2124,7 @@ var OAuth2API = class {
|
|
|
2244
2124
|
*/
|
|
2245
2125
|
async tokenExchange(body, { signal } = {}) {
|
|
2246
2126
|
return this.rest.post(Routes9.oauth2TokenExchange(), {
|
|
2247
|
-
body:
|
|
2127
|
+
body: makeURLSearchParams6(body),
|
|
2248
2128
|
passThroughBody: true,
|
|
2249
2129
|
headers: {
|
|
2250
2130
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
@@ -2262,7 +2142,7 @@ var OAuth2API = class {
|
|
|
2262
2142
|
*/
|
|
2263
2143
|
async refreshToken(body, { signal } = {}) {
|
|
2264
2144
|
return this.rest.post(Routes9.oauth2TokenExchange(), {
|
|
2265
|
-
body:
|
|
2145
|
+
body: makeURLSearchParams6(body),
|
|
2266
2146
|
passThroughBody: true,
|
|
2267
2147
|
headers: {
|
|
2268
2148
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
@@ -2282,7 +2162,7 @@ var OAuth2API = class {
|
|
|
2282
2162
|
*/
|
|
2283
2163
|
async getToken(body, { signal } = {}) {
|
|
2284
2164
|
return this.rest.post(Routes9.oauth2TokenExchange(), {
|
|
2285
|
-
body:
|
|
2165
|
+
body: makeURLSearchParams6(body),
|
|
2286
2166
|
passThroughBody: true,
|
|
2287
2167
|
headers: {
|
|
2288
2168
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
@@ -2324,7 +2204,7 @@ var OAuth2API = class {
|
|
|
2324
2204
|
*/
|
|
2325
2205
|
async revokeToken(applicationId, applicationSecret, body, { signal } = {}) {
|
|
2326
2206
|
await this.rest.post(Routes9.oauth2TokenRevocation(), {
|
|
2327
|
-
body:
|
|
2207
|
+
body: makeURLSearchParams6(body),
|
|
2328
2208
|
passThroughBody: true,
|
|
2329
2209
|
headers: {
|
|
2330
2210
|
Authorization: `Basic ${btoa(`${applicationId}:${applicationSecret}`)}`,
|
|
@@ -2337,7 +2217,7 @@ var OAuth2API = class {
|
|
|
2337
2217
|
};
|
|
2338
2218
|
|
|
2339
2219
|
// src/api/poll.ts
|
|
2340
|
-
import { makeURLSearchParams as
|
|
2220
|
+
import { makeURLSearchParams as makeURLSearchParams7 } from "@discordjs/rest";
|
|
2341
2221
|
import {
|
|
2342
2222
|
Routes as Routes10
|
|
2343
2223
|
} from "discord-api-types/v10";
|
|
@@ -2361,7 +2241,7 @@ var PollAPI = class {
|
|
|
2361
2241
|
async getAnswerVoters(channelId, messageId, answerId, query, { signal } = {}) {
|
|
2362
2242
|
return this.rest.get(Routes10.pollAnswerVoters(channelId, messageId, answerId), {
|
|
2363
2243
|
signal,
|
|
2364
|
-
query:
|
|
2244
|
+
query: makeURLSearchParams7(query)
|
|
2365
2245
|
});
|
|
2366
2246
|
}
|
|
2367
2247
|
/**
|
|
@@ -2418,31 +2298,9 @@ var RoleConnectionsAPI = class {
|
|
|
2418
2298
|
}
|
|
2419
2299
|
};
|
|
2420
2300
|
|
|
2421
|
-
// src/api/soundboardSounds.ts
|
|
2422
|
-
import { Routes as Routes12 } from "discord-api-types/v10";
|
|
2423
|
-
var SoundboardSoundsAPI = class {
|
|
2424
|
-
constructor(rest) {
|
|
2425
|
-
this.rest = rest;
|
|
2426
|
-
}
|
|
2427
|
-
static {
|
|
2428
|
-
__name(this, "SoundboardSoundsAPI");
|
|
2429
|
-
}
|
|
2430
|
-
/**
|
|
2431
|
-
* Fetches all the soundboard default sounds.
|
|
2432
|
-
*
|
|
2433
|
-
* @see {@link https://discord.com/developers/docs/resources/soundboard#list-default-soundboard-sounds}
|
|
2434
|
-
* @param options - The options for fetching the soundboard default sounds.
|
|
2435
|
-
*/
|
|
2436
|
-
async getSoundboardDefaultSounds({ signal } = {}) {
|
|
2437
|
-
return this.rest.get(Routes12.soundboardDefaultSounds(), {
|
|
2438
|
-
signal
|
|
2439
|
-
});
|
|
2440
|
-
}
|
|
2441
|
-
};
|
|
2442
|
-
|
|
2443
2301
|
// src/api/stageInstances.ts
|
|
2444
2302
|
import {
|
|
2445
|
-
Routes as
|
|
2303
|
+
Routes as Routes12
|
|
2446
2304
|
} from "discord-api-types/v10";
|
|
2447
2305
|
var StageInstancesAPI = class {
|
|
2448
2306
|
constructor(rest) {
|
|
@@ -2459,7 +2317,7 @@ var StageInstancesAPI = class {
|
|
|
2459
2317
|
* @param options - The options for creating the new stage instance
|
|
2460
2318
|
*/
|
|
2461
2319
|
async create(body, { reason, signal } = {}) {
|
|
2462
|
-
return this.rest.post(
|
|
2320
|
+
return this.rest.post(Routes12.stageInstances(), {
|
|
2463
2321
|
body,
|
|
2464
2322
|
reason,
|
|
2465
2323
|
signal
|
|
@@ -2473,7 +2331,7 @@ var StageInstancesAPI = class {
|
|
|
2473
2331
|
* @param options - The options for fetching the stage instance
|
|
2474
2332
|
*/
|
|
2475
2333
|
async get(channelId, { signal } = {}) {
|
|
2476
|
-
return this.rest.get(
|
|
2334
|
+
return this.rest.get(Routes12.stageInstance(channelId), { signal });
|
|
2477
2335
|
}
|
|
2478
2336
|
/**
|
|
2479
2337
|
* Edits a stage instance
|
|
@@ -2484,7 +2342,7 @@ var StageInstancesAPI = class {
|
|
|
2484
2342
|
* @param options - The options for editing the stage instance
|
|
2485
2343
|
*/
|
|
2486
2344
|
async edit(channelId, body, { reason, signal } = {}) {
|
|
2487
|
-
return this.rest.patch(
|
|
2345
|
+
return this.rest.patch(Routes12.stageInstance(channelId), {
|
|
2488
2346
|
body,
|
|
2489
2347
|
reason,
|
|
2490
2348
|
signal
|
|
@@ -2498,13 +2356,13 @@ var StageInstancesAPI = class {
|
|
|
2498
2356
|
* @param options - The options for deleting the stage instance
|
|
2499
2357
|
*/
|
|
2500
2358
|
async delete(channelId, { reason, signal } = {}) {
|
|
2501
|
-
await this.rest.delete(
|
|
2359
|
+
await this.rest.delete(Routes12.stageInstance(channelId), { reason, signal });
|
|
2502
2360
|
}
|
|
2503
2361
|
};
|
|
2504
2362
|
|
|
2505
2363
|
// src/api/sticker.ts
|
|
2506
2364
|
import {
|
|
2507
|
-
Routes as
|
|
2365
|
+
Routes as Routes13
|
|
2508
2366
|
} from "discord-api-types/v10";
|
|
2509
2367
|
var StickersAPI = class {
|
|
2510
2368
|
constructor(rest) {
|
|
@@ -2521,7 +2379,7 @@ var StickersAPI = class {
|
|
|
2521
2379
|
* @param options - The options for fetching the sticker pack
|
|
2522
2380
|
*/
|
|
2523
2381
|
async getStickerPack(packId, { signal } = {}) {
|
|
2524
|
-
return this.rest.get(
|
|
2382
|
+
return this.rest.get(Routes13.stickerPack(packId), { signal });
|
|
2525
2383
|
}
|
|
2526
2384
|
/**
|
|
2527
2385
|
* Fetches all of the sticker packs
|
|
@@ -2530,7 +2388,7 @@ var StickersAPI = class {
|
|
|
2530
2388
|
* @param options - The options for fetching the sticker packs
|
|
2531
2389
|
*/
|
|
2532
2390
|
async getStickers({ signal } = {}) {
|
|
2533
|
-
return this.rest.get(
|
|
2391
|
+
return this.rest.get(Routes13.stickerPacks(), { signal });
|
|
2534
2392
|
}
|
|
2535
2393
|
/**
|
|
2536
2394
|
* Fetches all of the sticker packs
|
|
@@ -2550,13 +2408,13 @@ var StickersAPI = class {
|
|
|
2550
2408
|
* @param options - The options for fetching the sticker
|
|
2551
2409
|
*/
|
|
2552
2410
|
async get(stickerId, { signal } = {}) {
|
|
2553
|
-
return this.rest.get(
|
|
2411
|
+
return this.rest.get(Routes13.sticker(stickerId), { signal });
|
|
2554
2412
|
}
|
|
2555
2413
|
};
|
|
2556
2414
|
|
|
2557
2415
|
// src/api/thread.ts
|
|
2558
2416
|
import {
|
|
2559
|
-
Routes as
|
|
2417
|
+
Routes as Routes14
|
|
2560
2418
|
} from "discord-api-types/v10";
|
|
2561
2419
|
var ThreadsAPI = class {
|
|
2562
2420
|
constructor(rest) {
|
|
@@ -2573,7 +2431,7 @@ var ThreadsAPI = class {
|
|
|
2573
2431
|
* @param options - The options for joining the thread
|
|
2574
2432
|
*/
|
|
2575
2433
|
async join(threadId, { signal } = {}) {
|
|
2576
|
-
await this.rest.put(
|
|
2434
|
+
await this.rest.put(Routes14.threadMembers(threadId, "@me"), { signal });
|
|
2577
2435
|
}
|
|
2578
2436
|
/**
|
|
2579
2437
|
* Adds a member to a thread
|
|
@@ -2584,7 +2442,7 @@ var ThreadsAPI = class {
|
|
|
2584
2442
|
* @param options - The options for adding the member to the thread
|
|
2585
2443
|
*/
|
|
2586
2444
|
async addMember(threadId, userId, { signal } = {}) {
|
|
2587
|
-
await this.rest.put(
|
|
2445
|
+
await this.rest.put(Routes14.threadMembers(threadId, userId), { signal });
|
|
2588
2446
|
}
|
|
2589
2447
|
/**
|
|
2590
2448
|
* Removes the current user from a thread
|
|
@@ -2594,7 +2452,7 @@ var ThreadsAPI = class {
|
|
|
2594
2452
|
* @param options - The options for leaving the thread
|
|
2595
2453
|
*/
|
|
2596
2454
|
async leave(threadId, { signal } = {}) {
|
|
2597
|
-
await this.rest.delete(
|
|
2455
|
+
await this.rest.delete(Routes14.threadMembers(threadId, "@me"), { signal });
|
|
2598
2456
|
}
|
|
2599
2457
|
/**
|
|
2600
2458
|
* Removes a member from a thread
|
|
@@ -2605,7 +2463,7 @@ var ThreadsAPI = class {
|
|
|
2605
2463
|
* @param options - The options for removing the member from the thread
|
|
2606
2464
|
*/
|
|
2607
2465
|
async removeMember(threadId, userId, { signal } = {}) {
|
|
2608
|
-
await this.rest.delete(
|
|
2466
|
+
await this.rest.delete(Routes14.threadMembers(threadId, userId), { signal });
|
|
2609
2467
|
}
|
|
2610
2468
|
/**
|
|
2611
2469
|
* Fetches a member of a thread
|
|
@@ -2616,7 +2474,7 @@ var ThreadsAPI = class {
|
|
|
2616
2474
|
* @param options - The options for fetching the member
|
|
2617
2475
|
*/
|
|
2618
2476
|
async getMember(threadId, userId, { signal } = {}) {
|
|
2619
|
-
return this.rest.get(
|
|
2477
|
+
return this.rest.get(Routes14.threadMembers(threadId, userId), { signal });
|
|
2620
2478
|
}
|
|
2621
2479
|
/**
|
|
2622
2480
|
* Fetches all members of a thread
|
|
@@ -2626,14 +2484,14 @@ var ThreadsAPI = class {
|
|
|
2626
2484
|
* @param options - The options for fetching the members
|
|
2627
2485
|
*/
|
|
2628
2486
|
async getAllMembers(threadId, { signal } = {}) {
|
|
2629
|
-
return this.rest.get(
|
|
2487
|
+
return this.rest.get(Routes14.threadMembers(threadId), { signal });
|
|
2630
2488
|
}
|
|
2631
2489
|
};
|
|
2632
2490
|
|
|
2633
2491
|
// src/api/user.ts
|
|
2634
|
-
import { makeURLSearchParams as
|
|
2492
|
+
import { makeURLSearchParams as makeURLSearchParams8 } from "@discordjs/rest";
|
|
2635
2493
|
import {
|
|
2636
|
-
Routes as
|
|
2494
|
+
Routes as Routes15
|
|
2637
2495
|
} from "discord-api-types/v10";
|
|
2638
2496
|
var UsersAPI = class {
|
|
2639
2497
|
constructor(rest) {
|
|
@@ -2650,7 +2508,7 @@ var UsersAPI = class {
|
|
|
2650
2508
|
* @param options - The options for fetching the user
|
|
2651
2509
|
*/
|
|
2652
2510
|
async get(userId, { signal } = {}) {
|
|
2653
|
-
return this.rest.get(
|
|
2511
|
+
return this.rest.get(Routes15.user(userId), { signal });
|
|
2654
2512
|
}
|
|
2655
2513
|
/**
|
|
2656
2514
|
* Returns the user object of the requester's account
|
|
@@ -2659,7 +2517,7 @@ var UsersAPI = class {
|
|
|
2659
2517
|
* @param options - The options for fetching the current user
|
|
2660
2518
|
*/
|
|
2661
2519
|
async getCurrent({ signal } = {}) {
|
|
2662
|
-
return this.rest.get(
|
|
2520
|
+
return this.rest.get(Routes15.user("@me"), { signal });
|
|
2663
2521
|
}
|
|
2664
2522
|
/**
|
|
2665
2523
|
* Returns a list of partial guild objects the current user is a member of
|
|
@@ -2669,8 +2527,8 @@ var UsersAPI = class {
|
|
|
2669
2527
|
* @param options - The options for fetching the guilds
|
|
2670
2528
|
*/
|
|
2671
2529
|
async getGuilds(query = {}, { signal } = {}) {
|
|
2672
|
-
return this.rest.get(
|
|
2673
|
-
query:
|
|
2530
|
+
return this.rest.get(Routes15.userGuilds(), {
|
|
2531
|
+
query: makeURLSearchParams8(query),
|
|
2674
2532
|
signal
|
|
2675
2533
|
});
|
|
2676
2534
|
}
|
|
@@ -2682,7 +2540,7 @@ var UsersAPI = class {
|
|
|
2682
2540
|
* @param options - The options for leaving the guild
|
|
2683
2541
|
*/
|
|
2684
2542
|
async leaveGuild(guildId, { signal } = {}) {
|
|
2685
|
-
await this.rest.delete(
|
|
2543
|
+
await this.rest.delete(Routes15.userGuild(guildId), { signal });
|
|
2686
2544
|
}
|
|
2687
2545
|
/**
|
|
2688
2546
|
* Edits the current user
|
|
@@ -2692,7 +2550,7 @@ var UsersAPI = class {
|
|
|
2692
2550
|
* @param options - The options for editing the user
|
|
2693
2551
|
*/
|
|
2694
2552
|
async edit(body, { signal } = {}) {
|
|
2695
|
-
return this.rest.patch(
|
|
2553
|
+
return this.rest.patch(Routes15.user("@me"), { body, signal });
|
|
2696
2554
|
}
|
|
2697
2555
|
/**
|
|
2698
2556
|
* Fetches the guild member for the current user
|
|
@@ -2702,7 +2560,7 @@ var UsersAPI = class {
|
|
|
2702
2560
|
* @param options - The options for fetching the guild member
|
|
2703
2561
|
*/
|
|
2704
2562
|
async getGuildMember(guildId, { signal } = {}) {
|
|
2705
|
-
return this.rest.get(
|
|
2563
|
+
return this.rest.get(Routes15.userGuildMember(guildId), { signal });
|
|
2706
2564
|
}
|
|
2707
2565
|
/**
|
|
2708
2566
|
* Edits the guild member for the current user
|
|
@@ -2713,7 +2571,7 @@ var UsersAPI = class {
|
|
|
2713
2571
|
* @param options - The options for editing the guild member
|
|
2714
2572
|
*/
|
|
2715
2573
|
async editCurrentGuildMember(guildId, body = {}, { reason, signal } = {}) {
|
|
2716
|
-
return this.rest.patch(
|
|
2574
|
+
return this.rest.patch(Routes15.guildMember(guildId, "@me"), {
|
|
2717
2575
|
reason,
|
|
2718
2576
|
body,
|
|
2719
2577
|
signal
|
|
@@ -2727,7 +2585,7 @@ var UsersAPI = class {
|
|
|
2727
2585
|
* @param options - The options for opening the DM
|
|
2728
2586
|
*/
|
|
2729
2587
|
async createDM(userId, { signal } = {}) {
|
|
2730
|
-
return this.rest.post(
|
|
2588
|
+
return this.rest.post(Routes15.userChannels(), {
|
|
2731
2589
|
body: { recipient_id: userId },
|
|
2732
2590
|
signal
|
|
2733
2591
|
});
|
|
@@ -2739,7 +2597,7 @@ var UsersAPI = class {
|
|
|
2739
2597
|
* @param options - The options for fetching the user's connections
|
|
2740
2598
|
*/
|
|
2741
2599
|
async getConnections({ signal } = {}) {
|
|
2742
|
-
return this.rest.get(
|
|
2600
|
+
return this.rest.get(Routes15.userConnections(), { signal });
|
|
2743
2601
|
}
|
|
2744
2602
|
/**
|
|
2745
2603
|
* Gets the current user's active application role connection
|
|
@@ -2749,7 +2607,7 @@ var UsersAPI = class {
|
|
|
2749
2607
|
* @param options - The options for fetching the role connections
|
|
2750
2608
|
*/
|
|
2751
2609
|
async getApplicationRoleConnection(applicationId, { signal } = {}) {
|
|
2752
|
-
return this.rest.get(
|
|
2610
|
+
return this.rest.get(Routes15.userApplicationRoleConnection(applicationId), {
|
|
2753
2611
|
signal
|
|
2754
2612
|
});
|
|
2755
2613
|
}
|
|
@@ -2762,7 +2620,7 @@ var UsersAPI = class {
|
|
|
2762
2620
|
* @param options - The options for updating the application role connection
|
|
2763
2621
|
*/
|
|
2764
2622
|
async updateApplicationRoleConnection(applicationId, body, { signal } = {}) {
|
|
2765
|
-
return this.rest.put(
|
|
2623
|
+
return this.rest.put(Routes15.userApplicationRoleConnection(applicationId), {
|
|
2766
2624
|
body,
|
|
2767
2625
|
signal
|
|
2768
2626
|
});
|
|
@@ -2770,9 +2628,9 @@ var UsersAPI = class {
|
|
|
2770
2628
|
};
|
|
2771
2629
|
|
|
2772
2630
|
// src/api/webhook.ts
|
|
2773
|
-
import { makeURLSearchParams as
|
|
2631
|
+
import { makeURLSearchParams as makeURLSearchParams9 } from "@discordjs/rest";
|
|
2774
2632
|
import {
|
|
2775
|
-
Routes as
|
|
2633
|
+
Routes as Routes16
|
|
2776
2634
|
} from "discord-api-types/v10";
|
|
2777
2635
|
var WebhooksAPI = class {
|
|
2778
2636
|
constructor(rest) {
|
|
@@ -2790,7 +2648,7 @@ var WebhooksAPI = class {
|
|
|
2790
2648
|
* @param options - The options for fetching the webhook
|
|
2791
2649
|
*/
|
|
2792
2650
|
async get(id, { token, signal } = {}) {
|
|
2793
|
-
return this.rest.get(
|
|
2651
|
+
return this.rest.get(Routes16.webhook(id, token), {
|
|
2794
2652
|
signal,
|
|
2795
2653
|
auth: !token
|
|
2796
2654
|
});
|
|
@@ -2805,7 +2663,7 @@ var WebhooksAPI = class {
|
|
|
2805
2663
|
* @param options - The options for editing the webhook
|
|
2806
2664
|
*/
|
|
2807
2665
|
async edit(id, body, { token, reason, signal } = {}) {
|
|
2808
|
-
return this.rest.patch(
|
|
2666
|
+
return this.rest.patch(Routes16.webhook(id, token), {
|
|
2809
2667
|
reason,
|
|
2810
2668
|
body,
|
|
2811
2669
|
signal,
|
|
@@ -2821,7 +2679,7 @@ var WebhooksAPI = class {
|
|
|
2821
2679
|
* @param options - The options for deleting the webhook
|
|
2822
2680
|
*/
|
|
2823
2681
|
async delete(id, { token, reason, signal } = {}) {
|
|
2824
|
-
await this.rest.delete(
|
|
2682
|
+
await this.rest.delete(Routes16.webhook(id, token), {
|
|
2825
2683
|
reason,
|
|
2826
2684
|
signal,
|
|
2827
2685
|
auth: !token
|
|
@@ -2842,8 +2700,8 @@ var WebhooksAPI = class {
|
|
|
2842
2700
|
files,
|
|
2843
2701
|
...body
|
|
2844
2702
|
}, { signal } = {}) {
|
|
2845
|
-
return this.rest.post(
|
|
2846
|
-
query:
|
|
2703
|
+
return this.rest.post(Routes16.webhook(id, token), {
|
|
2704
|
+
query: makeURLSearchParams9({ wait, thread_id }),
|
|
2847
2705
|
files,
|
|
2848
2706
|
body,
|
|
2849
2707
|
auth: false,
|
|
@@ -2862,8 +2720,8 @@ var WebhooksAPI = class {
|
|
|
2862
2720
|
* @param options - The options for executing the webhook
|
|
2863
2721
|
*/
|
|
2864
2722
|
async executeSlack(id, token, body, query = {}, { signal } = {}) {
|
|
2865
|
-
await this.rest.post(
|
|
2866
|
-
query:
|
|
2723
|
+
await this.rest.post(Routes16.webhookPlatform(id, token, "slack"), {
|
|
2724
|
+
query: makeURLSearchParams9(query),
|
|
2867
2725
|
body,
|
|
2868
2726
|
auth: false,
|
|
2869
2727
|
signal
|
|
@@ -2880,8 +2738,8 @@ var WebhooksAPI = class {
|
|
|
2880
2738
|
* @param options - The options for executing the webhook
|
|
2881
2739
|
*/
|
|
2882
2740
|
async executeGitHub(id, token, body, query = {}, { signal } = {}) {
|
|
2883
|
-
await this.rest.post(
|
|
2884
|
-
query:
|
|
2741
|
+
await this.rest.post(Routes16.webhookPlatform(id, token, "github"), {
|
|
2742
|
+
query: makeURLSearchParams9(query),
|
|
2885
2743
|
body,
|
|
2886
2744
|
signal,
|
|
2887
2745
|
auth: false
|
|
@@ -2898,8 +2756,8 @@ var WebhooksAPI = class {
|
|
|
2898
2756
|
* @param options - The options for fetching the message
|
|
2899
2757
|
*/
|
|
2900
2758
|
async getMessage(id, token, messageId, query = {}, { signal } = {}) {
|
|
2901
|
-
return this.rest.get(
|
|
2902
|
-
query:
|
|
2759
|
+
return this.rest.get(Routes16.webhookMessage(id, token, messageId), {
|
|
2760
|
+
query: makeURLSearchParams9(query),
|
|
2903
2761
|
auth: false,
|
|
2904
2762
|
signal
|
|
2905
2763
|
});
|
|
@@ -2919,8 +2777,8 @@ var WebhooksAPI = class {
|
|
|
2919
2777
|
files,
|
|
2920
2778
|
...body
|
|
2921
2779
|
}, { signal } = {}) {
|
|
2922
|
-
return this.rest.patch(
|
|
2923
|
-
query:
|
|
2780
|
+
return this.rest.patch(Routes16.webhookMessage(id, token, messageId), {
|
|
2781
|
+
query: makeURLSearchParams9({ thread_id }),
|
|
2924
2782
|
auth: false,
|
|
2925
2783
|
body,
|
|
2926
2784
|
signal,
|
|
@@ -2938,8 +2796,8 @@ var WebhooksAPI = class {
|
|
|
2938
2796
|
* @param options - The options for deleting the message
|
|
2939
2797
|
*/
|
|
2940
2798
|
async deleteMessage(id, token, messageId, query = {}, { signal } = {}) {
|
|
2941
|
-
await this.rest.delete(
|
|
2942
|
-
query:
|
|
2799
|
+
await this.rest.delete(Routes16.webhookMessage(id, token, messageId), {
|
|
2800
|
+
query: makeURLSearchParams9(query),
|
|
2943
2801
|
auth: false,
|
|
2944
2802
|
signal
|
|
2945
2803
|
});
|
|
@@ -2959,7 +2817,6 @@ var API = class {
|
|
|
2959
2817
|
this.oauth2 = new OAuth2API(rest);
|
|
2960
2818
|
this.poll = new PollAPI(rest);
|
|
2961
2819
|
this.roleConnections = new RoleConnectionsAPI(rest);
|
|
2962
|
-
this.soundboardSounds = new SoundboardSoundsAPI(rest);
|
|
2963
2820
|
this.stageInstances = new StageInstancesAPI(rest);
|
|
2964
2821
|
this.stickers = new StickersAPI(rest);
|
|
2965
2822
|
this.threads = new ThreadsAPI(rest);
|
|
@@ -2981,7 +2838,6 @@ var API = class {
|
|
|
2981
2838
|
oauth2;
|
|
2982
2839
|
poll;
|
|
2983
2840
|
roleConnections;
|
|
2984
|
-
soundboardSounds;
|
|
2985
2841
|
stageInstances;
|
|
2986
2842
|
stickers;
|
|
2987
2843
|
threads;
|
|
@@ -3009,7 +2865,7 @@ __name(withFiles, "withFiles");
|
|
|
3009
2865
|
|
|
3010
2866
|
// src/http-only/index.ts
|
|
3011
2867
|
export * from "discord-api-types/v10";
|
|
3012
|
-
var version = "2.1.0-dev.
|
|
2868
|
+
var version = "2.1.0-dev.1738965220-519aa3abe";
|
|
3013
2869
|
export {
|
|
3014
2870
|
API,
|
|
3015
2871
|
ApplicationCommandsAPI,
|
|
@@ -3022,7 +2878,6 @@ export {
|
|
|
3022
2878
|
OAuth2API,
|
|
3023
2879
|
PollAPI,
|
|
3024
2880
|
RoleConnectionsAPI,
|
|
3025
|
-
SoundboardSoundsAPI,
|
|
3026
2881
|
StageInstancesAPI,
|
|
3027
2882
|
StickersAPI,
|
|
3028
2883
|
ThreadsAPI,
|