@discordjs/core 1.1.2-dev.1703117367-891a67ac4 → 1.2.0-dev.1703462992-0f1e02b3d
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 +51 -2
- package/dist/http-only.d.ts +51 -2
- package/dist/http-only.js +145 -64
- package/dist/http-only.js.map +1 -1
- package/dist/http-only.mjs +150 -65
- package/dist/http-only.mjs.map +1 -1
- package/dist/index.d.mts +54 -2
- package/dist/index.d.ts +54 -2
- package/dist/index.js +151 -71
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +151 -67
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1610,7 +1610,10 @@ var GuildsAPI = class {
|
|
|
1610
1610
|
};
|
|
1611
1611
|
|
|
1612
1612
|
// src/api/interactions.ts
|
|
1613
|
-
import {
|
|
1613
|
+
import {
|
|
1614
|
+
InteractionResponseType,
|
|
1615
|
+
Routes as Routes5
|
|
1616
|
+
} from "discord-api-types/v10";
|
|
1614
1617
|
var InteractionsAPI = class {
|
|
1615
1618
|
constructor(rest, webhooks) {
|
|
1616
1619
|
this.rest = rest;
|
|
@@ -1791,6 +1794,23 @@ var InteractionsAPI = class {
|
|
|
1791
1794
|
signal
|
|
1792
1795
|
});
|
|
1793
1796
|
}
|
|
1797
|
+
/**
|
|
1798
|
+
* Sends a premium required response to an interaction
|
|
1799
|
+
*
|
|
1800
|
+
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1801
|
+
* @param interactionId - The id of the interaction
|
|
1802
|
+
* @param interactionToken - The token of the interaction
|
|
1803
|
+
* @param options - The options for sending the premium required response
|
|
1804
|
+
*/
|
|
1805
|
+
async sendPremiumRequired(interactionId, interactionToken, { signal } = {}) {
|
|
1806
|
+
await this.rest.post(Routes5.interactionCallback(interactionId, interactionToken), {
|
|
1807
|
+
auth: false,
|
|
1808
|
+
body: {
|
|
1809
|
+
type: InteractionResponseType.PremiumRequired
|
|
1810
|
+
},
|
|
1811
|
+
signal
|
|
1812
|
+
});
|
|
1813
|
+
}
|
|
1794
1814
|
};
|
|
1795
1815
|
|
|
1796
1816
|
// src/api/invite.ts
|
|
@@ -1829,11 +1849,73 @@ var InvitesAPI = class {
|
|
|
1829
1849
|
}
|
|
1830
1850
|
};
|
|
1831
1851
|
|
|
1852
|
+
// src/api/monetization.ts
|
|
1853
|
+
import { makeURLSearchParams as makeURLSearchParams5 } from "@discordjs/rest";
|
|
1854
|
+
import {
|
|
1855
|
+
Routes as Routes7
|
|
1856
|
+
} from "discord-api-types/v10";
|
|
1857
|
+
var MonetizationAPI = class {
|
|
1858
|
+
constructor(rest) {
|
|
1859
|
+
this.rest = rest;
|
|
1860
|
+
}
|
|
1861
|
+
static {
|
|
1862
|
+
__name(this, "MonetizationAPI");
|
|
1863
|
+
}
|
|
1864
|
+
/**
|
|
1865
|
+
* Fetches the SKUs for an application.
|
|
1866
|
+
*
|
|
1867
|
+
* @see {@link https://discord.com/developers/docs/monetization/skus#list-skus}
|
|
1868
|
+
* @param options - The options for fetching the SKUs.
|
|
1869
|
+
*/
|
|
1870
|
+
async getSKUs(applicationId, { signal } = {}) {
|
|
1871
|
+
return this.rest.get(Routes7.skus(applicationId), { signal });
|
|
1872
|
+
}
|
|
1873
|
+
/**
|
|
1874
|
+
* Fetches the entitlements for an application.
|
|
1875
|
+
*
|
|
1876
|
+
* @see {@link https://discord.com/developers/docs/monetization/entitlements#list-entitlements}
|
|
1877
|
+
* @param applicationId - The application id to fetch entitlements for
|
|
1878
|
+
* @param query - The query options for fetching entitlements
|
|
1879
|
+
* @param options - The options for fetching entitlements
|
|
1880
|
+
*/
|
|
1881
|
+
async getEntitlements(applicationId, query, { signal } = {}) {
|
|
1882
|
+
return this.rest.get(Routes7.entitlements(applicationId), {
|
|
1883
|
+
signal,
|
|
1884
|
+
query: makeURLSearchParams5(query)
|
|
1885
|
+
});
|
|
1886
|
+
}
|
|
1887
|
+
/**
|
|
1888
|
+
* Creates a test entitlement for an application's SKU.
|
|
1889
|
+
*
|
|
1890
|
+
* @see {@link https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement}
|
|
1891
|
+
* @param applicationId - The application id to create the entitlement for
|
|
1892
|
+
* @param body - The data for creating the entitlement
|
|
1893
|
+
* @param options - The options for creating the entitlement
|
|
1894
|
+
*/
|
|
1895
|
+
async createTestEntitlement(applicationId, body, { signal } = {}) {
|
|
1896
|
+
return this.rest.post(Routes7.entitlements(applicationId), {
|
|
1897
|
+
body,
|
|
1898
|
+
signal
|
|
1899
|
+
});
|
|
1900
|
+
}
|
|
1901
|
+
/**
|
|
1902
|
+
* Deletes a test entitlement for an application's SKU.
|
|
1903
|
+
*
|
|
1904
|
+
* @see {@link https://discord.com/developers/docs/monetization/entitlements#delete-test-entitlement}
|
|
1905
|
+
* @param applicationId - The application id to delete the entitlement for
|
|
1906
|
+
* @param entitlementId - The entitlement id to delete
|
|
1907
|
+
* @param options - The options for deleting the entitlement
|
|
1908
|
+
*/
|
|
1909
|
+
async deleteTestEntitlement(applicationId, entitlementId, { signal } = {}) {
|
|
1910
|
+
await this.rest.delete(Routes7.entitlement(applicationId, entitlementId), { signal });
|
|
1911
|
+
}
|
|
1912
|
+
};
|
|
1913
|
+
|
|
1832
1914
|
// src/api/oauth2.ts
|
|
1833
1915
|
import { URL } from "node:url";
|
|
1834
|
-
import { makeURLSearchParams as
|
|
1916
|
+
import { makeURLSearchParams as makeURLSearchParams6 } from "@discordjs/rest";
|
|
1835
1917
|
import {
|
|
1836
|
-
Routes as
|
|
1918
|
+
Routes as Routes8,
|
|
1837
1919
|
RouteBases
|
|
1838
1920
|
} from "discord-api-types/v10";
|
|
1839
1921
|
var OAuth2API = class {
|
|
@@ -1850,8 +1932,8 @@ var OAuth2API = class {
|
|
|
1850
1932
|
* @param options - The options for creating the authorization URL
|
|
1851
1933
|
*/
|
|
1852
1934
|
generateAuthorizationURL(options) {
|
|
1853
|
-
const url = new URL(`${RouteBases.api}${
|
|
1854
|
-
url.search =
|
|
1935
|
+
const url = new URL(`${RouteBases.api}${Routes8.oauth2Authorization()}`);
|
|
1936
|
+
url.search = makeURLSearchParams6(options).toString();
|
|
1855
1937
|
return url.toString();
|
|
1856
1938
|
}
|
|
1857
1939
|
/**
|
|
@@ -1862,8 +1944,8 @@ var OAuth2API = class {
|
|
|
1862
1944
|
* @param options - The options for the token exchange request
|
|
1863
1945
|
*/
|
|
1864
1946
|
async tokenExchange(body, { signal } = {}) {
|
|
1865
|
-
return this.rest.post(
|
|
1866
|
-
body:
|
|
1947
|
+
return this.rest.post(Routes8.oauth2TokenExchange(), {
|
|
1948
|
+
body: makeURLSearchParams6(body),
|
|
1867
1949
|
passThroughBody: true,
|
|
1868
1950
|
headers: {
|
|
1869
1951
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
@@ -1879,8 +1961,8 @@ var OAuth2API = class {
|
|
|
1879
1961
|
* @param options - The options for the refresh token request
|
|
1880
1962
|
*/
|
|
1881
1963
|
async refreshToken(body, { signal } = {}) {
|
|
1882
|
-
return this.rest.post(
|
|
1883
|
-
body:
|
|
1964
|
+
return this.rest.post(Routes8.oauth2TokenExchange(), {
|
|
1965
|
+
body: makeURLSearchParams6(body),
|
|
1884
1966
|
passThroughBody: true,
|
|
1885
1967
|
headers: {
|
|
1886
1968
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
@@ -1898,8 +1980,8 @@ var OAuth2API = class {
|
|
|
1898
1980
|
* @param options - The options for the client credentials grant request
|
|
1899
1981
|
*/
|
|
1900
1982
|
async getToken(body, { signal } = {}) {
|
|
1901
|
-
return this.rest.post(
|
|
1902
|
-
body:
|
|
1983
|
+
return this.rest.post(Routes8.oauth2TokenExchange(), {
|
|
1984
|
+
body: makeURLSearchParams6(body),
|
|
1903
1985
|
passThroughBody: true,
|
|
1904
1986
|
headers: {
|
|
1905
1987
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
@@ -1914,7 +1996,7 @@ var OAuth2API = class {
|
|
|
1914
1996
|
* @param options - The options for the current bot application information request
|
|
1915
1997
|
*/
|
|
1916
1998
|
async getCurrentBotApplicationInformation({ signal } = {}) {
|
|
1917
|
-
return this.rest.get(
|
|
1999
|
+
return this.rest.get(Routes8.oauth2CurrentApplication(), {
|
|
1918
2000
|
signal
|
|
1919
2001
|
});
|
|
1920
2002
|
}
|
|
@@ -1925,7 +2007,7 @@ var OAuth2API = class {
|
|
|
1925
2007
|
* @param options - The options for the current authorization information request
|
|
1926
2008
|
*/
|
|
1927
2009
|
async getCurrentAuthorizationInformation({ signal } = {}) {
|
|
1928
|
-
return this.rest.get(
|
|
2010
|
+
return this.rest.get(Routes8.oauth2CurrentAuthorization(), {
|
|
1929
2011
|
signal
|
|
1930
2012
|
});
|
|
1931
2013
|
}
|
|
@@ -1933,7 +2015,7 @@ var OAuth2API = class {
|
|
|
1933
2015
|
|
|
1934
2016
|
// src/api/roleConnections.ts
|
|
1935
2017
|
import {
|
|
1936
|
-
Routes as
|
|
2018
|
+
Routes as Routes9
|
|
1937
2019
|
} from "discord-api-types/v10";
|
|
1938
2020
|
var RoleConnectionsAPI = class {
|
|
1939
2021
|
constructor(rest) {
|
|
@@ -1950,7 +2032,7 @@ var RoleConnectionsAPI = class {
|
|
|
1950
2032
|
* @param options - The options for fetching the role connection metadata records
|
|
1951
2033
|
*/
|
|
1952
2034
|
async getMetadataRecords(applicationId, { signal } = {}) {
|
|
1953
|
-
return this.rest.get(
|
|
2035
|
+
return this.rest.get(Routes9.applicationRoleConnectionMetadata(applicationId), {
|
|
1954
2036
|
signal
|
|
1955
2037
|
});
|
|
1956
2038
|
}
|
|
@@ -1963,7 +2045,7 @@ var RoleConnectionsAPI = class {
|
|
|
1963
2045
|
* @param options - The options for updating the role connection metadata records
|
|
1964
2046
|
*/
|
|
1965
2047
|
async updateMetadataRecords(applicationId, body, { signal } = {}) {
|
|
1966
|
-
return this.rest.put(
|
|
2048
|
+
return this.rest.put(Routes9.applicationRoleConnectionMetadata(applicationId), {
|
|
1967
2049
|
body,
|
|
1968
2050
|
signal
|
|
1969
2051
|
});
|
|
@@ -1972,7 +2054,7 @@ var RoleConnectionsAPI = class {
|
|
|
1972
2054
|
|
|
1973
2055
|
// src/api/stageInstances.ts
|
|
1974
2056
|
import {
|
|
1975
|
-
Routes as
|
|
2057
|
+
Routes as Routes10
|
|
1976
2058
|
} from "discord-api-types/v10";
|
|
1977
2059
|
var StageInstancesAPI = class {
|
|
1978
2060
|
constructor(rest) {
|
|
@@ -1989,7 +2071,7 @@ var StageInstancesAPI = class {
|
|
|
1989
2071
|
* @param options - The options for creating the new stage instance
|
|
1990
2072
|
*/
|
|
1991
2073
|
async create(body, { reason, signal } = {}) {
|
|
1992
|
-
return this.rest.post(
|
|
2074
|
+
return this.rest.post(Routes10.stageInstances(), {
|
|
1993
2075
|
body,
|
|
1994
2076
|
reason,
|
|
1995
2077
|
signal
|
|
@@ -2003,7 +2085,7 @@ var StageInstancesAPI = class {
|
|
|
2003
2085
|
* @param options - The options for fetching the stage instance
|
|
2004
2086
|
*/
|
|
2005
2087
|
async get(channelId, { signal } = {}) {
|
|
2006
|
-
return this.rest.get(
|
|
2088
|
+
return this.rest.get(Routes10.stageInstance(channelId), { signal });
|
|
2007
2089
|
}
|
|
2008
2090
|
/**
|
|
2009
2091
|
* Edits a stage instance
|
|
@@ -2014,7 +2096,7 @@ var StageInstancesAPI = class {
|
|
|
2014
2096
|
* @param options - The options for editing the stage instance
|
|
2015
2097
|
*/
|
|
2016
2098
|
async edit(channelId, body, { reason, signal } = {}) {
|
|
2017
|
-
return this.rest.patch(
|
|
2099
|
+
return this.rest.patch(Routes10.stageInstance(channelId), {
|
|
2018
2100
|
body,
|
|
2019
2101
|
reason,
|
|
2020
2102
|
signal
|
|
@@ -2028,13 +2110,13 @@ var StageInstancesAPI = class {
|
|
|
2028
2110
|
* @param options - The options for deleting the stage instance
|
|
2029
2111
|
*/
|
|
2030
2112
|
async delete(channelId, { reason, signal } = {}) {
|
|
2031
|
-
await this.rest.delete(
|
|
2113
|
+
await this.rest.delete(Routes10.stageInstance(channelId), { reason, signal });
|
|
2032
2114
|
}
|
|
2033
2115
|
};
|
|
2034
2116
|
|
|
2035
2117
|
// src/api/sticker.ts
|
|
2036
2118
|
import {
|
|
2037
|
-
Routes as
|
|
2119
|
+
Routes as Routes11
|
|
2038
2120
|
} from "discord-api-types/v10";
|
|
2039
2121
|
var StickersAPI = class {
|
|
2040
2122
|
constructor(rest) {
|
|
@@ -2050,7 +2132,7 @@ var StickersAPI = class {
|
|
|
2050
2132
|
* @param options - The options for fetching the sticker packs
|
|
2051
2133
|
*/
|
|
2052
2134
|
async getStickers({ signal } = {}) {
|
|
2053
|
-
return this.rest.get(
|
|
2135
|
+
return this.rest.get(Routes11.stickerPacks(), { signal });
|
|
2054
2136
|
}
|
|
2055
2137
|
/**
|
|
2056
2138
|
* Fetches all of the sticker packs
|
|
@@ -2070,13 +2152,13 @@ var StickersAPI = class {
|
|
|
2070
2152
|
* @param options - The options for fetching the sticker
|
|
2071
2153
|
*/
|
|
2072
2154
|
async get(stickerId, { signal } = {}) {
|
|
2073
|
-
return this.rest.get(
|
|
2155
|
+
return this.rest.get(Routes11.sticker(stickerId), { signal });
|
|
2074
2156
|
}
|
|
2075
2157
|
};
|
|
2076
2158
|
|
|
2077
2159
|
// src/api/thread.ts
|
|
2078
2160
|
import {
|
|
2079
|
-
Routes as
|
|
2161
|
+
Routes as Routes12
|
|
2080
2162
|
} from "discord-api-types/v10";
|
|
2081
2163
|
var ThreadsAPI = class {
|
|
2082
2164
|
constructor(rest) {
|
|
@@ -2093,7 +2175,7 @@ var ThreadsAPI = class {
|
|
|
2093
2175
|
* @param options - The options for joining the thread
|
|
2094
2176
|
*/
|
|
2095
2177
|
async join(threadId, { signal } = {}) {
|
|
2096
|
-
await this.rest.put(
|
|
2178
|
+
await this.rest.put(Routes12.threadMembers(threadId, "@me"), { signal });
|
|
2097
2179
|
}
|
|
2098
2180
|
/**
|
|
2099
2181
|
* Adds a member to a thread
|
|
@@ -2104,7 +2186,7 @@ var ThreadsAPI = class {
|
|
|
2104
2186
|
* @param options - The options for adding the member to the thread
|
|
2105
2187
|
*/
|
|
2106
2188
|
async addMember(threadId, userId, { signal } = {}) {
|
|
2107
|
-
await this.rest.put(
|
|
2189
|
+
await this.rest.put(Routes12.threadMembers(threadId, userId), { signal });
|
|
2108
2190
|
}
|
|
2109
2191
|
/**
|
|
2110
2192
|
* Removes the current user from a thread
|
|
@@ -2114,7 +2196,7 @@ var ThreadsAPI = class {
|
|
|
2114
2196
|
* @param options - The options for leaving the thread
|
|
2115
2197
|
*/
|
|
2116
2198
|
async leave(threadId, { signal } = {}) {
|
|
2117
|
-
await this.rest.delete(
|
|
2199
|
+
await this.rest.delete(Routes12.threadMembers(threadId, "@me"), { signal });
|
|
2118
2200
|
}
|
|
2119
2201
|
/**
|
|
2120
2202
|
* Removes a member from a thread
|
|
@@ -2125,7 +2207,7 @@ var ThreadsAPI = class {
|
|
|
2125
2207
|
* @param options - The options for removing the member from the thread
|
|
2126
2208
|
*/
|
|
2127
2209
|
async removeMember(threadId, userId, { signal } = {}) {
|
|
2128
|
-
await this.rest.delete(
|
|
2210
|
+
await this.rest.delete(Routes12.threadMembers(threadId, userId), { signal });
|
|
2129
2211
|
}
|
|
2130
2212
|
/**
|
|
2131
2213
|
* Fetches a member of a thread
|
|
@@ -2136,7 +2218,7 @@ var ThreadsAPI = class {
|
|
|
2136
2218
|
* @param options - The options for fetching the member
|
|
2137
2219
|
*/
|
|
2138
2220
|
async getMember(threadId, userId, { signal } = {}) {
|
|
2139
|
-
return this.rest.get(
|
|
2221
|
+
return this.rest.get(Routes12.threadMembers(threadId, userId), { signal });
|
|
2140
2222
|
}
|
|
2141
2223
|
/**
|
|
2142
2224
|
* Fetches all members of a thread
|
|
@@ -2146,14 +2228,14 @@ var ThreadsAPI = class {
|
|
|
2146
2228
|
* @param options - The options for fetching the members
|
|
2147
2229
|
*/
|
|
2148
2230
|
async getAllMembers(threadId, { signal } = {}) {
|
|
2149
|
-
return this.rest.get(
|
|
2231
|
+
return this.rest.get(Routes12.threadMembers(threadId), { signal });
|
|
2150
2232
|
}
|
|
2151
2233
|
};
|
|
2152
2234
|
|
|
2153
2235
|
// src/api/user.ts
|
|
2154
|
-
import { makeURLSearchParams as
|
|
2236
|
+
import { makeURLSearchParams as makeURLSearchParams7 } from "@discordjs/rest";
|
|
2155
2237
|
import {
|
|
2156
|
-
Routes as
|
|
2238
|
+
Routes as Routes13
|
|
2157
2239
|
} from "discord-api-types/v10";
|
|
2158
2240
|
var UsersAPI = class {
|
|
2159
2241
|
constructor(rest) {
|
|
@@ -2170,7 +2252,7 @@ var UsersAPI = class {
|
|
|
2170
2252
|
* @param options - The options for fetching the user
|
|
2171
2253
|
*/
|
|
2172
2254
|
async get(userId, { signal } = {}) {
|
|
2173
|
-
return this.rest.get(
|
|
2255
|
+
return this.rest.get(Routes13.user(userId), { signal });
|
|
2174
2256
|
}
|
|
2175
2257
|
/**
|
|
2176
2258
|
* Returns the user object of the requester's account
|
|
@@ -2179,7 +2261,7 @@ var UsersAPI = class {
|
|
|
2179
2261
|
* @param options - The options for fetching the current user
|
|
2180
2262
|
*/
|
|
2181
2263
|
async getCurrent({ signal } = {}) {
|
|
2182
|
-
return this.rest.get(
|
|
2264
|
+
return this.rest.get(Routes13.user("@me"), { signal });
|
|
2183
2265
|
}
|
|
2184
2266
|
/**
|
|
2185
2267
|
* Returns a list of partial guild objects the current user is a member of
|
|
@@ -2189,8 +2271,8 @@ var UsersAPI = class {
|
|
|
2189
2271
|
* @param options - The options for fetching the guilds
|
|
2190
2272
|
*/
|
|
2191
2273
|
async getGuilds(query = {}, { signal } = {}) {
|
|
2192
|
-
return this.rest.get(
|
|
2193
|
-
query:
|
|
2274
|
+
return this.rest.get(Routes13.userGuilds(), {
|
|
2275
|
+
query: makeURLSearchParams7(query),
|
|
2194
2276
|
signal
|
|
2195
2277
|
});
|
|
2196
2278
|
}
|
|
@@ -2202,7 +2284,7 @@ var UsersAPI = class {
|
|
|
2202
2284
|
* @param options - The options for leaving the guild
|
|
2203
2285
|
*/
|
|
2204
2286
|
async leaveGuild(guildId, { signal } = {}) {
|
|
2205
|
-
await this.rest.delete(
|
|
2287
|
+
await this.rest.delete(Routes13.userGuild(guildId), { signal });
|
|
2206
2288
|
}
|
|
2207
2289
|
/**
|
|
2208
2290
|
* Edits the current user
|
|
@@ -2212,7 +2294,7 @@ var UsersAPI = class {
|
|
|
2212
2294
|
* @param options - The options for editing the user
|
|
2213
2295
|
*/
|
|
2214
2296
|
async edit(body, { signal } = {}) {
|
|
2215
|
-
return this.rest.patch(
|
|
2297
|
+
return this.rest.patch(Routes13.user("@me"), { body, signal });
|
|
2216
2298
|
}
|
|
2217
2299
|
/**
|
|
2218
2300
|
* Fetches the guild member for the current user
|
|
@@ -2222,7 +2304,7 @@ var UsersAPI = class {
|
|
|
2222
2304
|
* @param options - The options for fetching the guild member
|
|
2223
2305
|
*/
|
|
2224
2306
|
async getGuildMember(guildId, { signal } = {}) {
|
|
2225
|
-
return this.rest.get(
|
|
2307
|
+
return this.rest.get(Routes13.userGuildMember(guildId), { signal });
|
|
2226
2308
|
}
|
|
2227
2309
|
/**
|
|
2228
2310
|
* Edits the guild member for the current user
|
|
@@ -2233,7 +2315,7 @@ var UsersAPI = class {
|
|
|
2233
2315
|
* @param options - The options for editing the guild member
|
|
2234
2316
|
*/
|
|
2235
2317
|
async editCurrentGuildMember(guildId, body = {}, { reason, signal } = {}) {
|
|
2236
|
-
return this.rest.patch(
|
|
2318
|
+
return this.rest.patch(Routes13.guildMember(guildId, "@me"), {
|
|
2237
2319
|
reason,
|
|
2238
2320
|
body,
|
|
2239
2321
|
signal
|
|
@@ -2247,7 +2329,7 @@ var UsersAPI = class {
|
|
|
2247
2329
|
* @param options - The options for opening the DM
|
|
2248
2330
|
*/
|
|
2249
2331
|
async createDM(userId, { signal } = {}) {
|
|
2250
|
-
return this.rest.post(
|
|
2332
|
+
return this.rest.post(Routes13.userChannels(), {
|
|
2251
2333
|
body: { recipient_id: userId },
|
|
2252
2334
|
signal
|
|
2253
2335
|
});
|
|
@@ -2259,7 +2341,7 @@ var UsersAPI = class {
|
|
|
2259
2341
|
* @param options - The options for fetching the user's connections
|
|
2260
2342
|
*/
|
|
2261
2343
|
async getConnections({ signal } = {}) {
|
|
2262
|
-
return this.rest.get(
|
|
2344
|
+
return this.rest.get(Routes13.userConnections(), { signal });
|
|
2263
2345
|
}
|
|
2264
2346
|
/**
|
|
2265
2347
|
* Gets the current user's active application role connection
|
|
@@ -2269,7 +2351,7 @@ var UsersAPI = class {
|
|
|
2269
2351
|
* @param options - The options for fetching the role connections
|
|
2270
2352
|
*/
|
|
2271
2353
|
async getApplicationRoleConnection(applicationId, { signal } = {}) {
|
|
2272
|
-
return this.rest.get(
|
|
2354
|
+
return this.rest.get(Routes13.userApplicationRoleConnection(applicationId), {
|
|
2273
2355
|
signal
|
|
2274
2356
|
});
|
|
2275
2357
|
}
|
|
@@ -2282,7 +2364,7 @@ var UsersAPI = class {
|
|
|
2282
2364
|
* @param options - The options for updating the application role connection
|
|
2283
2365
|
*/
|
|
2284
2366
|
async updateApplicationRoleConnection(applicationId, body, { signal } = {}) {
|
|
2285
|
-
return this.rest.put(
|
|
2367
|
+
return this.rest.put(Routes13.userApplicationRoleConnection(applicationId), {
|
|
2286
2368
|
body,
|
|
2287
2369
|
signal
|
|
2288
2370
|
});
|
|
@@ -2290,7 +2372,7 @@ var UsersAPI = class {
|
|
|
2290
2372
|
};
|
|
2291
2373
|
|
|
2292
2374
|
// src/api/voice.ts
|
|
2293
|
-
import { Routes as
|
|
2375
|
+
import { Routes as Routes14 } from "discord-api-types/v10";
|
|
2294
2376
|
var VoiceAPI = class {
|
|
2295
2377
|
constructor(rest) {
|
|
2296
2378
|
this.rest = rest;
|
|
@@ -2305,14 +2387,14 @@ var VoiceAPI = class {
|
|
|
2305
2387
|
* @param options - The options for fetching the voice regions
|
|
2306
2388
|
*/
|
|
2307
2389
|
async getVoiceRegions({ signal } = {}) {
|
|
2308
|
-
return this.rest.get(
|
|
2390
|
+
return this.rest.get(Routes14.voiceRegions(), { signal });
|
|
2309
2391
|
}
|
|
2310
2392
|
};
|
|
2311
2393
|
|
|
2312
2394
|
// src/api/webhook.ts
|
|
2313
|
-
import { makeURLSearchParams as
|
|
2395
|
+
import { makeURLSearchParams as makeURLSearchParams8 } from "@discordjs/rest";
|
|
2314
2396
|
import {
|
|
2315
|
-
Routes as
|
|
2397
|
+
Routes as Routes15
|
|
2316
2398
|
} from "discord-api-types/v10";
|
|
2317
2399
|
var WebhooksAPI = class {
|
|
2318
2400
|
constructor(rest) {
|
|
@@ -2330,7 +2412,7 @@ var WebhooksAPI = class {
|
|
|
2330
2412
|
* @param options - The options for fetching the webhook
|
|
2331
2413
|
*/
|
|
2332
2414
|
async get(id, { token, signal } = {}) {
|
|
2333
|
-
return this.rest.get(
|
|
2415
|
+
return this.rest.get(Routes15.webhook(id, token), {
|
|
2334
2416
|
signal,
|
|
2335
2417
|
auth: !token
|
|
2336
2418
|
});
|
|
@@ -2345,7 +2427,7 @@ var WebhooksAPI = class {
|
|
|
2345
2427
|
* @param options - The options for editing the webhook
|
|
2346
2428
|
*/
|
|
2347
2429
|
async edit(id, body, { token, reason, signal } = {}) {
|
|
2348
|
-
return this.rest.patch(
|
|
2430
|
+
return this.rest.patch(Routes15.webhook(id, token), {
|
|
2349
2431
|
reason,
|
|
2350
2432
|
body,
|
|
2351
2433
|
signal,
|
|
@@ -2361,7 +2443,7 @@ var WebhooksAPI = class {
|
|
|
2361
2443
|
* @param options - The options for deleting the webhook
|
|
2362
2444
|
*/
|
|
2363
2445
|
async delete(id, { token, reason, signal } = {}) {
|
|
2364
|
-
await this.rest.delete(
|
|
2446
|
+
await this.rest.delete(Routes15.webhook(id, token), {
|
|
2365
2447
|
reason,
|
|
2366
2448
|
signal,
|
|
2367
2449
|
auth: !token
|
|
@@ -2382,8 +2464,8 @@ var WebhooksAPI = class {
|
|
|
2382
2464
|
files,
|
|
2383
2465
|
...body
|
|
2384
2466
|
}, { signal } = {}) {
|
|
2385
|
-
return this.rest.post(
|
|
2386
|
-
query:
|
|
2467
|
+
return this.rest.post(Routes15.webhook(id, token), {
|
|
2468
|
+
query: makeURLSearchParams8({ wait, thread_id }),
|
|
2387
2469
|
files,
|
|
2388
2470
|
body,
|
|
2389
2471
|
auth: false,
|
|
@@ -2402,8 +2484,8 @@ var WebhooksAPI = class {
|
|
|
2402
2484
|
* @param options - The options for executing the webhook
|
|
2403
2485
|
*/
|
|
2404
2486
|
async executeSlack(id, token, body, query = {}, { signal } = {}) {
|
|
2405
|
-
await this.rest.post(
|
|
2406
|
-
query:
|
|
2487
|
+
await this.rest.post(Routes15.webhookPlatform(id, token, "slack"), {
|
|
2488
|
+
query: makeURLSearchParams8(query),
|
|
2407
2489
|
body,
|
|
2408
2490
|
auth: false,
|
|
2409
2491
|
signal
|
|
@@ -2420,8 +2502,8 @@ var WebhooksAPI = class {
|
|
|
2420
2502
|
* @param options - The options for executing the webhook
|
|
2421
2503
|
*/
|
|
2422
2504
|
async executeGitHub(id, token, body, query = {}, { signal } = {}) {
|
|
2423
|
-
await this.rest.post(
|
|
2424
|
-
query:
|
|
2505
|
+
await this.rest.post(Routes15.webhookPlatform(id, token, "github"), {
|
|
2506
|
+
query: makeURLSearchParams8(query),
|
|
2425
2507
|
body,
|
|
2426
2508
|
signal,
|
|
2427
2509
|
auth: false
|
|
@@ -2438,8 +2520,8 @@ var WebhooksAPI = class {
|
|
|
2438
2520
|
* @param options - The options for fetching the message
|
|
2439
2521
|
*/
|
|
2440
2522
|
async getMessage(id, token, messageId, query = {}, { signal } = {}) {
|
|
2441
|
-
return this.rest.get(
|
|
2442
|
-
query:
|
|
2523
|
+
return this.rest.get(Routes15.webhookMessage(id, token, messageId), {
|
|
2524
|
+
query: makeURLSearchParams8(query),
|
|
2443
2525
|
auth: false,
|
|
2444
2526
|
signal
|
|
2445
2527
|
});
|
|
@@ -2459,8 +2541,8 @@ var WebhooksAPI = class {
|
|
|
2459
2541
|
files,
|
|
2460
2542
|
...body
|
|
2461
2543
|
}, { signal } = {}) {
|
|
2462
|
-
return this.rest.patch(
|
|
2463
|
-
query:
|
|
2544
|
+
return this.rest.patch(Routes15.webhookMessage(id, token, messageId), {
|
|
2545
|
+
query: makeURLSearchParams8({ thread_id }),
|
|
2464
2546
|
auth: false,
|
|
2465
2547
|
body,
|
|
2466
2548
|
signal,
|
|
@@ -2478,8 +2560,8 @@ var WebhooksAPI = class {
|
|
|
2478
2560
|
* @param options - The options for deleting the message
|
|
2479
2561
|
*/
|
|
2480
2562
|
async deleteMessage(id, token, messageId, query = {}, { signal } = {}) {
|
|
2481
|
-
await this.rest.delete(
|
|
2482
|
-
query:
|
|
2563
|
+
await this.rest.delete(Routes15.webhookMessage(id, token, messageId), {
|
|
2564
|
+
query: makeURLSearchParams8(query),
|
|
2483
2565
|
auth: false,
|
|
2484
2566
|
signal
|
|
2485
2567
|
});
|
|
@@ -2495,6 +2577,7 @@ var API = class {
|
|
|
2495
2577
|
this.channels = new ChannelsAPI(rest);
|
|
2496
2578
|
this.guilds = new GuildsAPI(rest);
|
|
2497
2579
|
this.invites = new InvitesAPI(rest);
|
|
2580
|
+
this.monetization = new MonetizationAPI(rest);
|
|
2498
2581
|
this.roleConnections = new RoleConnectionsAPI(rest);
|
|
2499
2582
|
this.oauth2 = new OAuth2API(rest);
|
|
2500
2583
|
this.stageInstances = new StageInstancesAPI(rest);
|
|
@@ -2514,6 +2597,7 @@ var API = class {
|
|
|
2514
2597
|
guilds;
|
|
2515
2598
|
interactions;
|
|
2516
2599
|
invites;
|
|
2600
|
+
monetization;
|
|
2517
2601
|
oauth2;
|
|
2518
2602
|
roleConnections;
|
|
2519
2603
|
stageInstances;
|
|
@@ -2548,9 +2632,8 @@ var Client = class extends AsyncEventEmitter {
|
|
|
2548
2632
|
this.api = new API(rest);
|
|
2549
2633
|
this.gateway.on(WebSocketShardEvents.Dispatch, ({ data: dispatch, shardId }) => {
|
|
2550
2634
|
this.emit(
|
|
2551
|
-
// TODO: move this expect-error down to the next line once entitlements get merged, so missing dispatch types result in errors
|
|
2552
|
-
// @ts-expect-error event props can't be resolved properly, but they are correct
|
|
2553
2635
|
dispatch.t,
|
|
2636
|
+
// @ts-expect-error event props can't be resolved properly, but they are correct
|
|
2554
2637
|
this.wrapIntrinsicProps(dispatch.d, shardId)
|
|
2555
2638
|
);
|
|
2556
2639
|
});
|
|
@@ -2698,7 +2781,7 @@ __name(withFiles, "withFiles");
|
|
|
2698
2781
|
|
|
2699
2782
|
// src/index.ts
|
|
2700
2783
|
export * from "discord-api-types/v10";
|
|
2701
|
-
var version = "1.
|
|
2784
|
+
var version = "1.2.0-dev.1703462992-0f1e02b3d";
|
|
2702
2785
|
export {
|
|
2703
2786
|
API,
|
|
2704
2787
|
ApplicationCommandsAPI,
|
|
@@ -2708,6 +2791,7 @@ export {
|
|
|
2708
2791
|
GuildsAPI,
|
|
2709
2792
|
InteractionsAPI,
|
|
2710
2793
|
InvitesAPI,
|
|
2794
|
+
MonetizationAPI,
|
|
2711
2795
|
OAuth2API,
|
|
2712
2796
|
RoleConnectionsAPI,
|
|
2713
2797
|
StageInstancesAPI,
|