@discordjs/core 3.0.0-dev.1759363313-f510b5ffa → 3.0.0-dev.1759622511-ffbb7b693
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 +21 -1
- package/dist/http-only.d.ts +21 -1
- package/dist/http-only.js +203 -164
- package/dist/http-only.js.map +1 -1
- package/dist/http-only.mjs +195 -157
- package/dist/http-only.mjs.map +1 -1
- package/dist/index.d.mts +21 -1
- package/dist/index.d.ts +21 -1
- package/dist/index.js +210 -171
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +195 -157
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/http-only.js
CHANGED
|
@@ -26,6 +26,7 @@ __export(http_only_exports, {
|
|
|
26
26
|
ApplicationCommandsAPI: () => ApplicationCommandsAPI,
|
|
27
27
|
ApplicationsAPI: () => ApplicationsAPI,
|
|
28
28
|
ChannelsAPI: () => ChannelsAPI,
|
|
29
|
+
GatewayAPI: () => GatewayAPI,
|
|
29
30
|
GuildsAPI: () => GuildsAPI,
|
|
30
31
|
InteractionsAPI: () => InteractionsAPI,
|
|
31
32
|
InvitesAPI: () => InvitesAPI,
|
|
@@ -898,9 +899,44 @@ var ChannelsAPI = class {
|
|
|
898
899
|
}
|
|
899
900
|
};
|
|
900
901
|
|
|
902
|
+
// src/api/gateway.ts
|
|
903
|
+
var import_v104 = require("discord-api-types/v10");
|
|
904
|
+
var GatewayAPI = class {
|
|
905
|
+
constructor(rest) {
|
|
906
|
+
this.rest = rest;
|
|
907
|
+
}
|
|
908
|
+
static {
|
|
909
|
+
__name(this, "GatewayAPI");
|
|
910
|
+
}
|
|
911
|
+
/**
|
|
912
|
+
* Gets gateway information.
|
|
913
|
+
*
|
|
914
|
+
* @see {@link https://discord.com/developers/docs/events/gateway#get-gateway}
|
|
915
|
+
* @param options - The options for fetching the gateway information
|
|
916
|
+
*/
|
|
917
|
+
async get({ signal } = {}) {
|
|
918
|
+
return this.rest.get(import_v104.Routes.gateway(), {
|
|
919
|
+
auth: false,
|
|
920
|
+
signal
|
|
921
|
+
});
|
|
922
|
+
}
|
|
923
|
+
/**
|
|
924
|
+
* Gets gateway information with additional metadata.
|
|
925
|
+
*
|
|
926
|
+
* @see {@link https://discord.com/developers/docs/events/gateway#get-gateway-bot}
|
|
927
|
+
* @param options - The options for fetching the gateway information
|
|
928
|
+
*/
|
|
929
|
+
async getBot({ auth, signal } = {}) {
|
|
930
|
+
return this.rest.get(import_v104.Routes.gatewayBot(), {
|
|
931
|
+
auth,
|
|
932
|
+
signal
|
|
933
|
+
});
|
|
934
|
+
}
|
|
935
|
+
};
|
|
936
|
+
|
|
901
937
|
// src/api/guild.ts
|
|
902
938
|
var import_rest3 = require("@discordjs/rest");
|
|
903
|
-
var
|
|
939
|
+
var import_v105 = require("discord-api-types/v10");
|
|
904
940
|
var GuildsAPI = class {
|
|
905
941
|
constructor(rest) {
|
|
906
942
|
this.rest = rest;
|
|
@@ -917,7 +953,7 @@ var GuildsAPI = class {
|
|
|
917
953
|
* @param options - The options for fetching the guild
|
|
918
954
|
*/
|
|
919
955
|
async get(guildId, query = {}, { auth, signal } = {}) {
|
|
920
|
-
return this.rest.get(
|
|
956
|
+
return this.rest.get(import_v105.Routes.guild(guildId), {
|
|
921
957
|
auth,
|
|
922
958
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
923
959
|
signal
|
|
@@ -931,7 +967,7 @@ var GuildsAPI = class {
|
|
|
931
967
|
* @param options - The options for fetching the guild preview
|
|
932
968
|
*/
|
|
933
969
|
async getPreview(guildId, { auth, signal } = {}) {
|
|
934
|
-
return this.rest.get(
|
|
970
|
+
return this.rest.get(import_v105.Routes.guildPreview(guildId), {
|
|
935
971
|
auth,
|
|
936
972
|
signal
|
|
937
973
|
});
|
|
@@ -945,7 +981,7 @@ var GuildsAPI = class {
|
|
|
945
981
|
* @param options - The options for editing the guild
|
|
946
982
|
*/
|
|
947
983
|
async edit(guildId, body, { auth, reason, signal } = {}) {
|
|
948
|
-
return this.rest.patch(
|
|
984
|
+
return this.rest.patch(import_v105.Routes.guild(guildId), {
|
|
949
985
|
auth,
|
|
950
986
|
reason,
|
|
951
987
|
body,
|
|
@@ -962,7 +998,7 @@ var GuildsAPI = class {
|
|
|
962
998
|
* @param options - The options for adding users to the guild
|
|
963
999
|
*/
|
|
964
1000
|
async addMember(guildId, userId, body, { auth, signal } = {}) {
|
|
965
|
-
return this.rest.put(
|
|
1001
|
+
return this.rest.put(import_v105.Routes.guildMember(guildId, userId), {
|
|
966
1002
|
auth,
|
|
967
1003
|
body,
|
|
968
1004
|
signal
|
|
@@ -977,7 +1013,7 @@ var GuildsAPI = class {
|
|
|
977
1013
|
* @param options - The options for fetching the guild members
|
|
978
1014
|
*/
|
|
979
1015
|
async getMembers(guildId, query = {}, { auth, signal } = {}) {
|
|
980
|
-
return this.rest.get(
|
|
1016
|
+
return this.rest.get(import_v105.Routes.guildMembers(guildId), {
|
|
981
1017
|
auth,
|
|
982
1018
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
983
1019
|
signal
|
|
@@ -991,7 +1027,7 @@ var GuildsAPI = class {
|
|
|
991
1027
|
* @param options - The options for fetching the guild channels
|
|
992
1028
|
*/
|
|
993
1029
|
async getChannels(guildId, { auth, signal } = {}) {
|
|
994
|
-
return this.rest.get(
|
|
1030
|
+
return this.rest.get(import_v105.Routes.guildChannels(guildId), {
|
|
995
1031
|
auth,
|
|
996
1032
|
signal
|
|
997
1033
|
});
|
|
@@ -1005,7 +1041,7 @@ var GuildsAPI = class {
|
|
|
1005
1041
|
* @param options - The options for creating the guild channel
|
|
1006
1042
|
*/
|
|
1007
1043
|
async createChannel(guildId, body, { auth, reason, signal } = {}) {
|
|
1008
|
-
return this.rest.post(
|
|
1044
|
+
return this.rest.post(import_v105.Routes.guildChannels(guildId), {
|
|
1009
1045
|
auth,
|
|
1010
1046
|
reason,
|
|
1011
1047
|
body,
|
|
@@ -1021,7 +1057,7 @@ var GuildsAPI = class {
|
|
|
1021
1057
|
* @param options - The options for editing the guild channel positions
|
|
1022
1058
|
*/
|
|
1023
1059
|
async setChannelPositions(guildId, body, { auth, reason, signal } = {}) {
|
|
1024
|
-
await this.rest.patch(
|
|
1060
|
+
await this.rest.patch(import_v105.Routes.guildChannels(guildId), { auth, reason, body, signal });
|
|
1025
1061
|
}
|
|
1026
1062
|
/**
|
|
1027
1063
|
* Fetches the active threads in a guild
|
|
@@ -1031,7 +1067,7 @@ var GuildsAPI = class {
|
|
|
1031
1067
|
* @param options - The options for fetching the active threads
|
|
1032
1068
|
*/
|
|
1033
1069
|
async getActiveThreads(guildId, { auth, signal } = {}) {
|
|
1034
|
-
return this.rest.get(
|
|
1070
|
+
return this.rest.get(import_v105.Routes.guildActiveThreads(guildId), { auth, signal });
|
|
1035
1071
|
}
|
|
1036
1072
|
/**
|
|
1037
1073
|
* Fetches a guild member ban
|
|
@@ -1042,7 +1078,7 @@ var GuildsAPI = class {
|
|
|
1042
1078
|
* @param options - The options for fetching the ban
|
|
1043
1079
|
*/
|
|
1044
1080
|
async getMemberBan(guildId, userId, { auth, signal } = {}) {
|
|
1045
|
-
return this.rest.get(
|
|
1081
|
+
return this.rest.get(import_v105.Routes.guildBan(guildId, userId), { auth, signal });
|
|
1046
1082
|
}
|
|
1047
1083
|
/**
|
|
1048
1084
|
* Fetches guild member bans
|
|
@@ -1053,7 +1089,7 @@ var GuildsAPI = class {
|
|
|
1053
1089
|
* @param options - The options for fetching the bans
|
|
1054
1090
|
*/
|
|
1055
1091
|
async getMemberBans(guildId, query = {}, { auth, signal } = {}) {
|
|
1056
|
-
return this.rest.get(
|
|
1092
|
+
return this.rest.get(import_v105.Routes.guildBans(guildId), {
|
|
1057
1093
|
auth,
|
|
1058
1094
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1059
1095
|
signal
|
|
@@ -1069,7 +1105,7 @@ var GuildsAPI = class {
|
|
|
1069
1105
|
* @param options - The options for banning the user
|
|
1070
1106
|
*/
|
|
1071
1107
|
async banUser(guildId, userId, body = {}, { auth, reason, signal } = {}) {
|
|
1072
|
-
await this.rest.put(
|
|
1108
|
+
await this.rest.put(import_v105.Routes.guildBan(guildId, userId), { auth, reason, body, signal });
|
|
1073
1109
|
}
|
|
1074
1110
|
/**
|
|
1075
1111
|
* Unbans a user from a guild
|
|
@@ -1080,7 +1116,7 @@ var GuildsAPI = class {
|
|
|
1080
1116
|
* @param options - The options for unbanning the user
|
|
1081
1117
|
*/
|
|
1082
1118
|
async unbanUser(guildId, userId, { auth, reason, signal } = {}) {
|
|
1083
|
-
await this.rest.delete(
|
|
1119
|
+
await this.rest.delete(import_v105.Routes.guildBan(guildId, userId), { auth, reason, signal });
|
|
1084
1120
|
}
|
|
1085
1121
|
/**
|
|
1086
1122
|
* Bulk ban users from a guild
|
|
@@ -1091,7 +1127,7 @@ var GuildsAPI = class {
|
|
|
1091
1127
|
* @param options - The options for bulk banning users
|
|
1092
1128
|
*/
|
|
1093
1129
|
async bulkBanUsers(guildId, body, { auth, reason, signal } = {}) {
|
|
1094
|
-
return this.rest.post(
|
|
1130
|
+
return this.rest.post(import_v105.Routes.guildBulkBan(guildId), {
|
|
1095
1131
|
auth,
|
|
1096
1132
|
reason,
|
|
1097
1133
|
body,
|
|
@@ -1106,7 +1142,7 @@ var GuildsAPI = class {
|
|
|
1106
1142
|
* @param options - The options for fetching the guild roles
|
|
1107
1143
|
*/
|
|
1108
1144
|
async getRoles(guildId, { auth, signal } = {}) {
|
|
1109
|
-
return this.rest.get(
|
|
1145
|
+
return this.rest.get(import_v105.Routes.guildRoles(guildId), { auth, signal });
|
|
1110
1146
|
}
|
|
1111
1147
|
/**
|
|
1112
1148
|
* Get a role in a guild
|
|
@@ -1117,7 +1153,7 @@ var GuildsAPI = class {
|
|
|
1117
1153
|
* @param options - The options for fetching the guild role
|
|
1118
1154
|
*/
|
|
1119
1155
|
async getRole(guildId, roleId, { auth, signal } = {}) {
|
|
1120
|
-
return this.rest.get(
|
|
1156
|
+
return this.rest.get(import_v105.Routes.guildRole(guildId, roleId), { auth, signal });
|
|
1121
1157
|
}
|
|
1122
1158
|
/**
|
|
1123
1159
|
* Creates a guild role
|
|
@@ -1128,7 +1164,7 @@ var GuildsAPI = class {
|
|
|
1128
1164
|
* @param options - The options for creating the guild role
|
|
1129
1165
|
*/
|
|
1130
1166
|
async createRole(guildId, body, { auth, reason, signal } = {}) {
|
|
1131
|
-
return this.rest.post(
|
|
1167
|
+
return this.rest.post(import_v105.Routes.guildRoles(guildId), {
|
|
1132
1168
|
auth,
|
|
1133
1169
|
reason,
|
|
1134
1170
|
body,
|
|
@@ -1144,7 +1180,7 @@ var GuildsAPI = class {
|
|
|
1144
1180
|
* @param options - The options for setting role positions
|
|
1145
1181
|
*/
|
|
1146
1182
|
async setRolePositions(guildId, body, { auth, reason, signal } = {}) {
|
|
1147
|
-
return this.rest.patch(
|
|
1183
|
+
return this.rest.patch(import_v105.Routes.guildRoles(guildId), {
|
|
1148
1184
|
auth,
|
|
1149
1185
|
reason,
|
|
1150
1186
|
body,
|
|
@@ -1161,7 +1197,7 @@ var GuildsAPI = class {
|
|
|
1161
1197
|
* @param options - The options for editing the guild role
|
|
1162
1198
|
*/
|
|
1163
1199
|
async editRole(guildId, roleId, body, { auth, reason, signal } = {}) {
|
|
1164
|
-
return this.rest.patch(
|
|
1200
|
+
return this.rest.patch(import_v105.Routes.guildRole(guildId, roleId), {
|
|
1165
1201
|
auth,
|
|
1166
1202
|
reason,
|
|
1167
1203
|
body,
|
|
@@ -1177,7 +1213,7 @@ var GuildsAPI = class {
|
|
|
1177
1213
|
* @param options - The options for deleting the guild role
|
|
1178
1214
|
*/
|
|
1179
1215
|
async deleteRole(guildId, roleId, { auth, reason, signal } = {}) {
|
|
1180
|
-
await this.rest.delete(
|
|
1216
|
+
await this.rest.delete(import_v105.Routes.guildRole(guildId, roleId), { auth, reason, signal });
|
|
1181
1217
|
}
|
|
1182
1218
|
/**
|
|
1183
1219
|
* Fetch the number of members that can be pruned from a guild
|
|
@@ -1188,7 +1224,7 @@ var GuildsAPI = class {
|
|
|
1188
1224
|
* @param options - The options for fetching the number of pruned members
|
|
1189
1225
|
*/
|
|
1190
1226
|
async getPruneCount(guildId, query = {}, { auth, signal } = {}) {
|
|
1191
|
-
return this.rest.get(
|
|
1227
|
+
return this.rest.get(import_v105.Routes.guildPrune(guildId), {
|
|
1192
1228
|
auth,
|
|
1193
1229
|
signal,
|
|
1194
1230
|
query: (0, import_rest3.makeURLSearchParams)(query)
|
|
@@ -1203,7 +1239,7 @@ var GuildsAPI = class {
|
|
|
1203
1239
|
* @param options - The options for initiating the prune
|
|
1204
1240
|
*/
|
|
1205
1241
|
async beginPrune(guildId, body = {}, { auth, reason, signal } = {}) {
|
|
1206
|
-
return this.rest.post(
|
|
1242
|
+
return this.rest.post(import_v105.Routes.guildPrune(guildId), {
|
|
1207
1243
|
auth,
|
|
1208
1244
|
body,
|
|
1209
1245
|
reason,
|
|
@@ -1218,7 +1254,7 @@ var GuildsAPI = class {
|
|
|
1218
1254
|
* @param options - The options for fetching the voice regions
|
|
1219
1255
|
*/
|
|
1220
1256
|
async getVoiceRegions(guildId, { auth, signal } = {}) {
|
|
1221
|
-
return this.rest.get(
|
|
1257
|
+
return this.rest.get(import_v105.Routes.guildVoiceRegions(guildId), {
|
|
1222
1258
|
auth,
|
|
1223
1259
|
signal
|
|
1224
1260
|
});
|
|
@@ -1231,7 +1267,7 @@ var GuildsAPI = class {
|
|
|
1231
1267
|
* @param options - The options for fetching the invites
|
|
1232
1268
|
*/
|
|
1233
1269
|
async getInvites(guildId, { auth, signal } = {}) {
|
|
1234
|
-
return this.rest.get(
|
|
1270
|
+
return this.rest.get(import_v105.Routes.guildInvites(guildId), { auth, signal });
|
|
1235
1271
|
}
|
|
1236
1272
|
/**
|
|
1237
1273
|
* Fetches the integrations for a guild
|
|
@@ -1241,7 +1277,7 @@ var GuildsAPI = class {
|
|
|
1241
1277
|
* @param options - The options for fetching the integrations
|
|
1242
1278
|
*/
|
|
1243
1279
|
async getIntegrations(guildId, { auth, signal } = {}) {
|
|
1244
|
-
return this.rest.get(
|
|
1280
|
+
return this.rest.get(import_v105.Routes.guildIntegrations(guildId), {
|
|
1245
1281
|
auth,
|
|
1246
1282
|
signal
|
|
1247
1283
|
});
|
|
@@ -1255,7 +1291,7 @@ var GuildsAPI = class {
|
|
|
1255
1291
|
* @param options - The options for deleting the integration
|
|
1256
1292
|
*/
|
|
1257
1293
|
async deleteIntegration(guildId, integrationId, { auth, reason, signal } = {}) {
|
|
1258
|
-
await this.rest.delete(
|
|
1294
|
+
await this.rest.delete(import_v105.Routes.guildIntegration(guildId, integrationId), { auth, reason, signal });
|
|
1259
1295
|
}
|
|
1260
1296
|
/**
|
|
1261
1297
|
* Fetches the widget settings for a guild
|
|
@@ -1265,7 +1301,7 @@ var GuildsAPI = class {
|
|
|
1265
1301
|
* @param options - The options for fetching the widget settings
|
|
1266
1302
|
*/
|
|
1267
1303
|
async getWidgetSettings(guildId, { auth, signal } = {}) {
|
|
1268
|
-
return this.rest.get(
|
|
1304
|
+
return this.rest.get(import_v105.Routes.guildWidgetSettings(guildId), {
|
|
1269
1305
|
auth,
|
|
1270
1306
|
signal
|
|
1271
1307
|
});
|
|
@@ -1279,7 +1315,7 @@ var GuildsAPI = class {
|
|
|
1279
1315
|
* @param options - The options for editing the widget settings
|
|
1280
1316
|
*/
|
|
1281
1317
|
async editWidgetSettings(guildId, body, { auth, reason, signal } = {}) {
|
|
1282
|
-
return this.rest.patch(
|
|
1318
|
+
return this.rest.patch(import_v105.Routes.guildWidgetSettings(guildId), {
|
|
1283
1319
|
auth,
|
|
1284
1320
|
reason,
|
|
1285
1321
|
body,
|
|
@@ -1294,7 +1330,7 @@ var GuildsAPI = class {
|
|
|
1294
1330
|
* @param options - The options for fetching the widget
|
|
1295
1331
|
*/
|
|
1296
1332
|
async getWidget(guildId, { auth, signal } = {}) {
|
|
1297
|
-
return this.rest.get(
|
|
1333
|
+
return this.rest.get(import_v105.Routes.guildWidgetJSON(guildId), { auth, signal });
|
|
1298
1334
|
}
|
|
1299
1335
|
/**
|
|
1300
1336
|
* Fetches the vanity url for a guild
|
|
@@ -1304,7 +1340,7 @@ var GuildsAPI = class {
|
|
|
1304
1340
|
* @param options - The options for fetching the vanity url
|
|
1305
1341
|
*/
|
|
1306
1342
|
async getVanityURL(guildId, { auth, signal } = {}) {
|
|
1307
|
-
return this.rest.get(
|
|
1343
|
+
return this.rest.get(import_v105.Routes.guildVanityUrl(guildId), { auth, signal });
|
|
1308
1344
|
}
|
|
1309
1345
|
/**
|
|
1310
1346
|
* Fetches the widget image for a guild
|
|
@@ -1315,7 +1351,7 @@ var GuildsAPI = class {
|
|
|
1315
1351
|
* @param options - The options for fetching the widget image
|
|
1316
1352
|
*/
|
|
1317
1353
|
async getWidgetImage(guildId, style, { auth, signal } = {}) {
|
|
1318
|
-
return this.rest.get(
|
|
1354
|
+
return this.rest.get(import_v105.Routes.guildWidgetImage(guildId), {
|
|
1319
1355
|
auth,
|
|
1320
1356
|
query: (0, import_rest3.makeURLSearchParams)({ style }),
|
|
1321
1357
|
signal
|
|
@@ -1329,7 +1365,7 @@ var GuildsAPI = class {
|
|
|
1329
1365
|
* @param options - The options for fetching the welcome screen
|
|
1330
1366
|
*/
|
|
1331
1367
|
async getWelcomeScreen(guildId, { auth, signal } = {}) {
|
|
1332
|
-
return this.rest.get(
|
|
1368
|
+
return this.rest.get(import_v105.Routes.guildWelcomeScreen(guildId), {
|
|
1333
1369
|
auth,
|
|
1334
1370
|
signal
|
|
1335
1371
|
});
|
|
@@ -1343,7 +1379,7 @@ var GuildsAPI = class {
|
|
|
1343
1379
|
* @param options - The options for editing the welcome screen
|
|
1344
1380
|
*/
|
|
1345
1381
|
async editWelcomeScreen(guildId, body, { auth, reason, signal } = {}) {
|
|
1346
|
-
return this.rest.patch(
|
|
1382
|
+
return this.rest.patch(import_v105.Routes.guildWelcomeScreen(guildId), {
|
|
1347
1383
|
auth,
|
|
1348
1384
|
reason,
|
|
1349
1385
|
body,
|
|
@@ -1358,7 +1394,7 @@ var GuildsAPI = class {
|
|
|
1358
1394
|
* @param options - The options for fetching the emojis
|
|
1359
1395
|
*/
|
|
1360
1396
|
async getEmojis(guildId, { auth, signal } = {}) {
|
|
1361
|
-
return this.rest.get(
|
|
1397
|
+
return this.rest.get(import_v105.Routes.guildEmojis(guildId), { auth, signal });
|
|
1362
1398
|
}
|
|
1363
1399
|
/**
|
|
1364
1400
|
* Fetches an emoji for a guild
|
|
@@ -1369,7 +1405,7 @@ var GuildsAPI = class {
|
|
|
1369
1405
|
* @param options - The options for fetching the emoji
|
|
1370
1406
|
*/
|
|
1371
1407
|
async getEmoji(guildId, emojiId, { auth, signal } = {}) {
|
|
1372
|
-
return this.rest.get(
|
|
1408
|
+
return this.rest.get(import_v105.Routes.guildEmoji(guildId, emojiId), { auth, signal });
|
|
1373
1409
|
}
|
|
1374
1410
|
/**
|
|
1375
1411
|
* Creates a new emoji for a guild
|
|
@@ -1380,7 +1416,7 @@ var GuildsAPI = class {
|
|
|
1380
1416
|
* @param options - The options for creating the emoji
|
|
1381
1417
|
*/
|
|
1382
1418
|
async createEmoji(guildId, body, { auth, reason, signal } = {}) {
|
|
1383
|
-
return this.rest.post(
|
|
1419
|
+
return this.rest.post(import_v105.Routes.guildEmojis(guildId), {
|
|
1384
1420
|
auth,
|
|
1385
1421
|
reason,
|
|
1386
1422
|
body,
|
|
@@ -1397,7 +1433,7 @@ var GuildsAPI = class {
|
|
|
1397
1433
|
* @param options - The options for editing the emoji
|
|
1398
1434
|
*/
|
|
1399
1435
|
async editEmoji(guildId, emojiId, body, { auth, reason, signal } = {}) {
|
|
1400
|
-
return this.rest.patch(
|
|
1436
|
+
return this.rest.patch(import_v105.Routes.guildEmoji(guildId, emojiId), {
|
|
1401
1437
|
auth,
|
|
1402
1438
|
reason,
|
|
1403
1439
|
body,
|
|
@@ -1413,7 +1449,7 @@ var GuildsAPI = class {
|
|
|
1413
1449
|
* @param options - The options for deleting the emoji
|
|
1414
1450
|
*/
|
|
1415
1451
|
async deleteEmoji(guildId, emojiId, { auth, reason, signal } = {}) {
|
|
1416
|
-
await this.rest.delete(
|
|
1452
|
+
await this.rest.delete(import_v105.Routes.guildEmoji(guildId, emojiId), { auth, reason, signal });
|
|
1417
1453
|
}
|
|
1418
1454
|
/**
|
|
1419
1455
|
* Fetches all scheduled events for a guild
|
|
@@ -1424,7 +1460,7 @@ var GuildsAPI = class {
|
|
|
1424
1460
|
* @param options - The options for fetching the scheduled events
|
|
1425
1461
|
*/
|
|
1426
1462
|
async getScheduledEvents(guildId, query = {}, { auth, signal } = {}) {
|
|
1427
|
-
return this.rest.get(
|
|
1463
|
+
return this.rest.get(import_v105.Routes.guildScheduledEvents(guildId), {
|
|
1428
1464
|
auth,
|
|
1429
1465
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1430
1466
|
signal
|
|
@@ -1439,7 +1475,7 @@ var GuildsAPI = class {
|
|
|
1439
1475
|
* @param options - The options for creating the scheduled event
|
|
1440
1476
|
*/
|
|
1441
1477
|
async createScheduledEvent(guildId, body, { auth, reason, signal } = {}) {
|
|
1442
|
-
return this.rest.post(
|
|
1478
|
+
return this.rest.post(import_v105.Routes.guildScheduledEvents(guildId), {
|
|
1443
1479
|
auth,
|
|
1444
1480
|
reason,
|
|
1445
1481
|
body,
|
|
@@ -1456,7 +1492,7 @@ var GuildsAPI = class {
|
|
|
1456
1492
|
* @param options - The options for fetching the scheduled event
|
|
1457
1493
|
*/
|
|
1458
1494
|
async getScheduledEvent(guildId, eventId, query = {}, { auth, signal } = {}) {
|
|
1459
|
-
return this.rest.get(
|
|
1495
|
+
return this.rest.get(import_v105.Routes.guildScheduledEvent(guildId, eventId), {
|
|
1460
1496
|
auth,
|
|
1461
1497
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1462
1498
|
signal
|
|
@@ -1472,7 +1508,7 @@ var GuildsAPI = class {
|
|
|
1472
1508
|
* @param options - The options for editing the scheduled event
|
|
1473
1509
|
*/
|
|
1474
1510
|
async editScheduledEvent(guildId, eventId, body, { auth, reason, signal } = {}) {
|
|
1475
|
-
return this.rest.patch(
|
|
1511
|
+
return this.rest.patch(import_v105.Routes.guildScheduledEvent(guildId, eventId), {
|
|
1476
1512
|
auth,
|
|
1477
1513
|
reason,
|
|
1478
1514
|
body,
|
|
@@ -1488,7 +1524,7 @@ var GuildsAPI = class {
|
|
|
1488
1524
|
* @param options - The options for deleting the scheduled event
|
|
1489
1525
|
*/
|
|
1490
1526
|
async deleteScheduledEvent(guildId, eventId, { auth, reason, signal } = {}) {
|
|
1491
|
-
await this.rest.delete(
|
|
1527
|
+
await this.rest.delete(import_v105.Routes.guildScheduledEvent(guildId, eventId), { auth, reason, signal });
|
|
1492
1528
|
}
|
|
1493
1529
|
/**
|
|
1494
1530
|
* Gets all users that are interested in a scheduled event
|
|
@@ -1500,7 +1536,7 @@ var GuildsAPI = class {
|
|
|
1500
1536
|
* @param options - The options for fetching the scheduled event users
|
|
1501
1537
|
*/
|
|
1502
1538
|
async getScheduledEventUsers(guildId, eventId, query = {}, { auth, signal } = {}) {
|
|
1503
|
-
return this.rest.get(
|
|
1539
|
+
return this.rest.get(import_v105.Routes.guildScheduledEventUsers(guildId, eventId), {
|
|
1504
1540
|
auth,
|
|
1505
1541
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1506
1542
|
signal
|
|
@@ -1514,7 +1550,7 @@ var GuildsAPI = class {
|
|
|
1514
1550
|
* @param options - The options for fetching the templates
|
|
1515
1551
|
*/
|
|
1516
1552
|
async getTemplates(guildId, { auth, signal } = {}) {
|
|
1517
|
-
return this.rest.get(
|
|
1553
|
+
return this.rest.get(import_v105.Routes.guildTemplates(guildId), { auth, signal });
|
|
1518
1554
|
}
|
|
1519
1555
|
/**
|
|
1520
1556
|
* Syncs a template for a guild
|
|
@@ -1525,7 +1561,7 @@ var GuildsAPI = class {
|
|
|
1525
1561
|
* @param options - The options for syncing the template
|
|
1526
1562
|
*/
|
|
1527
1563
|
async syncTemplate(guildId, templateCode, { auth, signal } = {}) {
|
|
1528
|
-
return this.rest.put(
|
|
1564
|
+
return this.rest.put(import_v105.Routes.guildTemplate(guildId, templateCode), {
|
|
1529
1565
|
auth,
|
|
1530
1566
|
signal
|
|
1531
1567
|
});
|
|
@@ -1540,7 +1576,7 @@ var GuildsAPI = class {
|
|
|
1540
1576
|
* @param options - The options for editing the template
|
|
1541
1577
|
*/
|
|
1542
1578
|
async editTemplate(guildId, templateCode, body, { auth, signal } = {}) {
|
|
1543
|
-
return this.rest.patch(
|
|
1579
|
+
return this.rest.patch(import_v105.Routes.guildTemplate(guildId, templateCode), {
|
|
1544
1580
|
auth,
|
|
1545
1581
|
body,
|
|
1546
1582
|
signal
|
|
@@ -1555,7 +1591,7 @@ var GuildsAPI = class {
|
|
|
1555
1591
|
* @param options - The options for deleting the template
|
|
1556
1592
|
*/
|
|
1557
1593
|
async deleteTemplate(guildId, templateCode, { auth, signal } = {}) {
|
|
1558
|
-
await this.rest.delete(
|
|
1594
|
+
await this.rest.delete(import_v105.Routes.guildTemplate(guildId, templateCode), { auth, signal });
|
|
1559
1595
|
}
|
|
1560
1596
|
/**
|
|
1561
1597
|
* Fetches all the stickers for a guild
|
|
@@ -1565,7 +1601,7 @@ var GuildsAPI = class {
|
|
|
1565
1601
|
* @param options - The options for fetching the stickers
|
|
1566
1602
|
*/
|
|
1567
1603
|
async getStickers(guildId, { auth, signal } = {}) {
|
|
1568
|
-
return this.rest.get(
|
|
1604
|
+
return this.rest.get(import_v105.Routes.guildStickers(guildId), { auth, signal });
|
|
1569
1605
|
}
|
|
1570
1606
|
/**
|
|
1571
1607
|
* Fetches a sticker for a guild
|
|
@@ -1576,7 +1612,7 @@ var GuildsAPI = class {
|
|
|
1576
1612
|
* @param options - The options for fetching the sticker
|
|
1577
1613
|
*/
|
|
1578
1614
|
async getSticker(guildId, stickerId, { auth, signal } = {}) {
|
|
1579
|
-
return this.rest.get(
|
|
1615
|
+
return this.rest.get(import_v105.Routes.guildSticker(guildId, stickerId), {
|
|
1580
1616
|
auth,
|
|
1581
1617
|
signal
|
|
1582
1618
|
});
|
|
@@ -1591,7 +1627,7 @@ var GuildsAPI = class {
|
|
|
1591
1627
|
*/
|
|
1592
1628
|
async createSticker(guildId, { file, ...body }, { auth, reason, signal } = {}) {
|
|
1593
1629
|
const fileData = { ...file, key: "file" };
|
|
1594
|
-
return this.rest.post(
|
|
1630
|
+
return this.rest.post(import_v105.Routes.guildStickers(guildId), {
|
|
1595
1631
|
auth,
|
|
1596
1632
|
appendToFormData: true,
|
|
1597
1633
|
body,
|
|
@@ -1610,7 +1646,7 @@ var GuildsAPI = class {
|
|
|
1610
1646
|
* @param options - The options for editing the sticker
|
|
1611
1647
|
*/
|
|
1612
1648
|
async editSticker(guildId, stickerId, body, { auth, reason, signal } = {}) {
|
|
1613
|
-
return this.rest.patch(
|
|
1649
|
+
return this.rest.patch(import_v105.Routes.guildSticker(guildId, stickerId), {
|
|
1614
1650
|
auth,
|
|
1615
1651
|
reason,
|
|
1616
1652
|
body,
|
|
@@ -1626,7 +1662,7 @@ var GuildsAPI = class {
|
|
|
1626
1662
|
* @param options - The options for deleting the sticker
|
|
1627
1663
|
*/
|
|
1628
1664
|
async deleteSticker(guildId, stickerId, { auth, reason, signal } = {}) {
|
|
1629
|
-
await this.rest.delete(
|
|
1665
|
+
await this.rest.delete(import_v105.Routes.guildSticker(guildId, stickerId), { auth, reason, signal });
|
|
1630
1666
|
}
|
|
1631
1667
|
/**
|
|
1632
1668
|
* Fetches the audit logs for a guild
|
|
@@ -1637,7 +1673,7 @@ var GuildsAPI = class {
|
|
|
1637
1673
|
* @param options - The options for fetching the audit logs
|
|
1638
1674
|
*/
|
|
1639
1675
|
async getAuditLogs(guildId, query = {}, { auth, signal } = {}) {
|
|
1640
|
-
return this.rest.get(
|
|
1676
|
+
return this.rest.get(import_v105.Routes.guildAuditLog(guildId), {
|
|
1641
1677
|
auth,
|
|
1642
1678
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1643
1679
|
signal
|
|
@@ -1651,7 +1687,7 @@ var GuildsAPI = class {
|
|
|
1651
1687
|
* @param options - The options for fetching the auto moderation rules
|
|
1652
1688
|
*/
|
|
1653
1689
|
async getAutoModerationRules(guildId, { auth, signal } = {}) {
|
|
1654
|
-
return this.rest.get(
|
|
1690
|
+
return this.rest.get(import_v105.Routes.guildAutoModerationRules(guildId), {
|
|
1655
1691
|
auth,
|
|
1656
1692
|
signal
|
|
1657
1693
|
});
|
|
@@ -1665,7 +1701,7 @@ var GuildsAPI = class {
|
|
|
1665
1701
|
* @param options - The options for fetching the auto moderation rule
|
|
1666
1702
|
*/
|
|
1667
1703
|
async getAutoModerationRule(guildId, ruleId, { auth, signal } = {}) {
|
|
1668
|
-
return this.rest.get(
|
|
1704
|
+
return this.rest.get(import_v105.Routes.guildAutoModerationRule(guildId, ruleId), {
|
|
1669
1705
|
auth,
|
|
1670
1706
|
signal
|
|
1671
1707
|
});
|
|
@@ -1679,7 +1715,7 @@ var GuildsAPI = class {
|
|
|
1679
1715
|
* @param options - The options for creating the auto moderation rule
|
|
1680
1716
|
*/
|
|
1681
1717
|
async createAutoModerationRule(guildId, body, { auth, reason, signal } = {}) {
|
|
1682
|
-
return this.rest.post(
|
|
1718
|
+
return this.rest.post(import_v105.Routes.guildAutoModerationRules(guildId), {
|
|
1683
1719
|
auth,
|
|
1684
1720
|
reason,
|
|
1685
1721
|
body,
|
|
@@ -1696,7 +1732,7 @@ var GuildsAPI = class {
|
|
|
1696
1732
|
* @param options - The options for editing the auto moderation rule
|
|
1697
1733
|
*/
|
|
1698
1734
|
async editAutoModerationRule(guildId, ruleId, body, { auth, reason, signal } = {}) {
|
|
1699
|
-
return this.rest.patch(
|
|
1735
|
+
return this.rest.patch(import_v105.Routes.guildAutoModerationRule(guildId, ruleId), {
|
|
1700
1736
|
auth,
|
|
1701
1737
|
reason,
|
|
1702
1738
|
body,
|
|
@@ -1712,7 +1748,7 @@ var GuildsAPI = class {
|
|
|
1712
1748
|
* @param options - The options for deleting the auto moderation rule
|
|
1713
1749
|
*/
|
|
1714
1750
|
async deleteAutoModerationRule(guildId, ruleId, { auth, reason, signal } = {}) {
|
|
1715
|
-
await this.rest.delete(
|
|
1751
|
+
await this.rest.delete(import_v105.Routes.guildAutoModerationRule(guildId, ruleId), { auth, reason, signal });
|
|
1716
1752
|
}
|
|
1717
1753
|
/**
|
|
1718
1754
|
* Fetches a guild member
|
|
@@ -1723,7 +1759,7 @@ var GuildsAPI = class {
|
|
|
1723
1759
|
* @param options - The options for fetching the guild member
|
|
1724
1760
|
*/
|
|
1725
1761
|
async getMember(guildId, userId, { auth, signal } = {}) {
|
|
1726
|
-
return this.rest.get(
|
|
1762
|
+
return this.rest.get(import_v105.Routes.guildMember(guildId, userId), { auth, signal });
|
|
1727
1763
|
}
|
|
1728
1764
|
/**
|
|
1729
1765
|
* Searches for guild members
|
|
@@ -1734,7 +1770,7 @@ var GuildsAPI = class {
|
|
|
1734
1770
|
* @param options - The options for searching for guild members
|
|
1735
1771
|
*/
|
|
1736
1772
|
async searchForMembers(guildId, query, { auth, signal } = {}) {
|
|
1737
|
-
return this.rest.get(
|
|
1773
|
+
return this.rest.get(import_v105.Routes.guildMembersSearch(guildId), {
|
|
1738
1774
|
auth,
|
|
1739
1775
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1740
1776
|
signal
|
|
@@ -1750,7 +1786,7 @@ var GuildsAPI = class {
|
|
|
1750
1786
|
* @param options - The options for editing the guild member
|
|
1751
1787
|
*/
|
|
1752
1788
|
async editMember(guildId, userId, body = {}, { auth, reason, signal } = {}) {
|
|
1753
|
-
return this.rest.patch(
|
|
1789
|
+
return this.rest.patch(import_v105.Routes.guildMember(guildId, userId), {
|
|
1754
1790
|
auth,
|
|
1755
1791
|
reason,
|
|
1756
1792
|
body,
|
|
@@ -1766,7 +1802,7 @@ var GuildsAPI = class {
|
|
|
1766
1802
|
* @param options - The options for removing the guild member
|
|
1767
1803
|
*/
|
|
1768
1804
|
async removeMember(guildId, userId, { auth, reason, signal } = {}) {
|
|
1769
|
-
return this.rest.delete(
|
|
1805
|
+
return this.rest.delete(import_v105.Routes.guildMember(guildId, userId), { auth, reason, signal });
|
|
1770
1806
|
}
|
|
1771
1807
|
/**
|
|
1772
1808
|
* Adds a role to a guild member
|
|
@@ -1778,7 +1814,7 @@ var GuildsAPI = class {
|
|
|
1778
1814
|
* @param options - The options for adding a role to a guild member
|
|
1779
1815
|
*/
|
|
1780
1816
|
async addRoleToMember(guildId, userId, roleId, { auth, reason, signal } = {}) {
|
|
1781
|
-
await this.rest.put(
|
|
1817
|
+
await this.rest.put(import_v105.Routes.guildMemberRole(guildId, userId, roleId), { auth, reason, signal });
|
|
1782
1818
|
}
|
|
1783
1819
|
/**
|
|
1784
1820
|
* Removes a role from a guild member
|
|
@@ -1790,7 +1826,7 @@ var GuildsAPI = class {
|
|
|
1790
1826
|
* @param options - The options for removing a role from a guild member
|
|
1791
1827
|
*/
|
|
1792
1828
|
async removeRoleFromMember(guildId, userId, roleId, { auth, reason, signal } = {}) {
|
|
1793
|
-
await this.rest.delete(
|
|
1829
|
+
await this.rest.delete(import_v105.Routes.guildMemberRole(guildId, userId, roleId), { auth, reason, signal });
|
|
1794
1830
|
}
|
|
1795
1831
|
/**
|
|
1796
1832
|
* Fetches a guild template
|
|
@@ -1800,7 +1836,7 @@ var GuildsAPI = class {
|
|
|
1800
1836
|
* @param options - The options for fetching the guild template
|
|
1801
1837
|
*/
|
|
1802
1838
|
async getTemplate(templateCode, { auth, signal } = {}) {
|
|
1803
|
-
return this.rest.get(
|
|
1839
|
+
return this.rest.get(import_v105.Routes.template(templateCode), { auth, signal });
|
|
1804
1840
|
}
|
|
1805
1841
|
/**
|
|
1806
1842
|
* Creates a new template
|
|
@@ -1811,7 +1847,7 @@ var GuildsAPI = class {
|
|
|
1811
1847
|
* @param options - The options for creating the template
|
|
1812
1848
|
*/
|
|
1813
1849
|
async createTemplate(guildId, body, { auth, signal } = {}) {
|
|
1814
|
-
return this.rest.post(
|
|
1850
|
+
return this.rest.post(import_v105.Routes.guildTemplates(guildId), {
|
|
1815
1851
|
auth,
|
|
1816
1852
|
body,
|
|
1817
1853
|
signal
|
|
@@ -1825,7 +1861,7 @@ var GuildsAPI = class {
|
|
|
1825
1861
|
* @param options - The options for fetching the webhooks
|
|
1826
1862
|
*/
|
|
1827
1863
|
async getWebhooks(id, { auth, signal } = {}) {
|
|
1828
|
-
return this.rest.get(
|
|
1864
|
+
return this.rest.get(import_v105.Routes.guildWebhooks(id), { auth, signal });
|
|
1829
1865
|
}
|
|
1830
1866
|
/**
|
|
1831
1867
|
* Fetches a guild onboarding
|
|
@@ -1835,7 +1871,7 @@ var GuildsAPI = class {
|
|
|
1835
1871
|
* @param options - The options for fetching the guild onboarding
|
|
1836
1872
|
*/
|
|
1837
1873
|
async getOnboarding(guildId, { auth, signal } = {}) {
|
|
1838
|
-
return this.rest.get(
|
|
1874
|
+
return this.rest.get(import_v105.Routes.guildOnboarding(guildId), { auth, signal });
|
|
1839
1875
|
}
|
|
1840
1876
|
/**
|
|
1841
1877
|
* Edits a guild onboarding
|
|
@@ -1846,7 +1882,7 @@ var GuildsAPI = class {
|
|
|
1846
1882
|
* @param options - The options for editing the guild onboarding
|
|
1847
1883
|
*/
|
|
1848
1884
|
async editOnboarding(guildId, body, { auth, reason, signal } = {}) {
|
|
1849
|
-
return this.rest.put(
|
|
1885
|
+
return this.rest.put(import_v105.Routes.guildOnboarding(guildId), {
|
|
1850
1886
|
auth,
|
|
1851
1887
|
reason,
|
|
1852
1888
|
body,
|
|
@@ -1861,7 +1897,7 @@ var GuildsAPI = class {
|
|
|
1861
1897
|
* @param options - The options for fetching the soundboard sounds
|
|
1862
1898
|
*/
|
|
1863
1899
|
async getSoundboardSounds(guildId, { auth, signal } = {}) {
|
|
1864
|
-
return this.rest.get(
|
|
1900
|
+
return this.rest.get(import_v105.Routes.guildSoundboardSounds(guildId), {
|
|
1865
1901
|
auth,
|
|
1866
1902
|
signal
|
|
1867
1903
|
});
|
|
@@ -1875,7 +1911,7 @@ var GuildsAPI = class {
|
|
|
1875
1911
|
* @param options - The options for fetching the soundboard sound
|
|
1876
1912
|
*/
|
|
1877
1913
|
async getSoundboardSound(guildId, soundId, { auth, signal } = {}) {
|
|
1878
|
-
return this.rest.get(
|
|
1914
|
+
return this.rest.get(import_v105.Routes.guildSoundboardSound(guildId, soundId), {
|
|
1879
1915
|
auth,
|
|
1880
1916
|
signal
|
|
1881
1917
|
});
|
|
@@ -1889,7 +1925,7 @@ var GuildsAPI = class {
|
|
|
1889
1925
|
* @param options - The options for creating the soundboard sound
|
|
1890
1926
|
*/
|
|
1891
1927
|
async createSoundboardSound(guildId, body, { auth, reason, signal } = {}) {
|
|
1892
|
-
return this.rest.post(
|
|
1928
|
+
return this.rest.post(import_v105.Routes.guildSoundboardSounds(guildId), {
|
|
1893
1929
|
auth,
|
|
1894
1930
|
body,
|
|
1895
1931
|
reason,
|
|
@@ -1906,7 +1942,7 @@ var GuildsAPI = class {
|
|
|
1906
1942
|
* @param options - The options for editing the soundboard sound
|
|
1907
1943
|
*/
|
|
1908
1944
|
async editSoundboardSound(guildId, soundId, body, { auth, reason, signal } = {}) {
|
|
1909
|
-
return this.rest.patch(
|
|
1945
|
+
return this.rest.patch(import_v105.Routes.guildSoundboardSound(guildId, soundId), {
|
|
1910
1946
|
auth,
|
|
1911
1947
|
body,
|
|
1912
1948
|
reason,
|
|
@@ -1922,13 +1958,13 @@ var GuildsAPI = class {
|
|
|
1922
1958
|
* @param options - The options for deleting the soundboard sound
|
|
1923
1959
|
*/
|
|
1924
1960
|
async deleteSoundboardSound(guildId, soundId, { auth, reason, signal } = {}) {
|
|
1925
|
-
await this.rest.delete(
|
|
1961
|
+
await this.rest.delete(import_v105.Routes.guildSoundboardSound(guildId, soundId), { auth, reason, signal });
|
|
1926
1962
|
}
|
|
1927
1963
|
};
|
|
1928
1964
|
|
|
1929
1965
|
// src/api/interactions.ts
|
|
1930
1966
|
var import_rest4 = require("@discordjs/rest");
|
|
1931
|
-
var
|
|
1967
|
+
var import_v106 = require("discord-api-types/v10");
|
|
1932
1968
|
var InteractionsAPI = class {
|
|
1933
1969
|
constructor(rest, webhooks) {
|
|
1934
1970
|
this.rest = rest;
|
|
@@ -1938,12 +1974,12 @@ var InteractionsAPI = class {
|
|
|
1938
1974
|
__name(this, "InteractionsAPI");
|
|
1939
1975
|
}
|
|
1940
1976
|
async reply(interactionId, interactionToken, { files, with_response, ...data }, { signal } = {}) {
|
|
1941
|
-
const response = await this.rest.post(
|
|
1977
|
+
const response = await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1942
1978
|
query: (0, import_rest4.makeURLSearchParams)({ with_response }),
|
|
1943
1979
|
files,
|
|
1944
1980
|
auth: false,
|
|
1945
1981
|
body: {
|
|
1946
|
-
type:
|
|
1982
|
+
type: import_v106.InteractionResponseType.ChannelMessageWithSource,
|
|
1947
1983
|
data
|
|
1948
1984
|
},
|
|
1949
1985
|
signal
|
|
@@ -1951,11 +1987,11 @@ var InteractionsAPI = class {
|
|
|
1951
1987
|
return with_response ? response : void 0;
|
|
1952
1988
|
}
|
|
1953
1989
|
async defer(interactionId, interactionToken, { with_response, ...data } = {}, { signal } = {}) {
|
|
1954
|
-
const response = await this.rest.post(
|
|
1990
|
+
const response = await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1955
1991
|
query: (0, import_rest4.makeURLSearchParams)({ with_response }),
|
|
1956
1992
|
auth: false,
|
|
1957
1993
|
body: {
|
|
1958
|
-
type:
|
|
1994
|
+
type: import_v106.InteractionResponseType.DeferredChannelMessageWithSource,
|
|
1959
1995
|
data
|
|
1960
1996
|
},
|
|
1961
1997
|
signal
|
|
@@ -1963,11 +1999,11 @@ var InteractionsAPI = class {
|
|
|
1963
1999
|
return with_response ? response : void 0;
|
|
1964
2000
|
}
|
|
1965
2001
|
async deferMessageUpdate(interactionId, interactionToken, { with_response } = {}, { signal } = {}) {
|
|
1966
|
-
const response = await this.rest.post(
|
|
2002
|
+
const response = await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1967
2003
|
query: (0, import_rest4.makeURLSearchParams)({ with_response }),
|
|
1968
2004
|
auth: false,
|
|
1969
2005
|
body: {
|
|
1970
|
-
type:
|
|
2006
|
+
type: import_v106.InteractionResponseType.DeferredMessageUpdate
|
|
1971
2007
|
},
|
|
1972
2008
|
signal
|
|
1973
2009
|
});
|
|
@@ -2032,12 +2068,12 @@ var InteractionsAPI = class {
|
|
|
2032
2068
|
await this.webhooks.deleteMessage(applicationId, interactionToken, messageId ?? "@original", {}, { signal });
|
|
2033
2069
|
}
|
|
2034
2070
|
async updateMessage(interactionId, interactionToken, { files, with_response, ...data }, { signal } = {}) {
|
|
2035
|
-
const response = await this.rest.post(
|
|
2071
|
+
const response = await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
|
|
2036
2072
|
query: (0, import_rest4.makeURLSearchParams)({ with_response }),
|
|
2037
2073
|
files,
|
|
2038
2074
|
auth: false,
|
|
2039
2075
|
body: {
|
|
2040
|
-
type:
|
|
2076
|
+
type: import_v106.InteractionResponseType.UpdateMessage,
|
|
2041
2077
|
data
|
|
2042
2078
|
},
|
|
2043
2079
|
signal
|
|
@@ -2045,11 +2081,11 @@ var InteractionsAPI = class {
|
|
|
2045
2081
|
return with_response ? response : void 0;
|
|
2046
2082
|
}
|
|
2047
2083
|
async createAutocompleteResponse(interactionId, interactionToken, { with_response, ...data }, { signal } = {}) {
|
|
2048
|
-
const response = await this.rest.post(
|
|
2084
|
+
const response = await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
|
|
2049
2085
|
query: (0, import_rest4.makeURLSearchParams)({ with_response }),
|
|
2050
2086
|
auth: false,
|
|
2051
2087
|
body: {
|
|
2052
|
-
type:
|
|
2088
|
+
type: import_v106.InteractionResponseType.ApplicationCommandAutocompleteResult,
|
|
2053
2089
|
data
|
|
2054
2090
|
},
|
|
2055
2091
|
signal
|
|
@@ -2057,11 +2093,11 @@ var InteractionsAPI = class {
|
|
|
2057
2093
|
return with_response ? response : void 0;
|
|
2058
2094
|
}
|
|
2059
2095
|
async createModal(interactionId, interactionToken, { with_response, ...data }, { signal } = {}) {
|
|
2060
|
-
const response = await this.rest.post(
|
|
2096
|
+
const response = await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
|
|
2061
2097
|
query: (0, import_rest4.makeURLSearchParams)({ with_response }),
|
|
2062
2098
|
auth: false,
|
|
2063
2099
|
body: {
|
|
2064
|
-
type:
|
|
2100
|
+
type: import_v106.InteractionResponseType.Modal,
|
|
2065
2101
|
data
|
|
2066
2102
|
},
|
|
2067
2103
|
signal
|
|
@@ -2069,11 +2105,11 @@ var InteractionsAPI = class {
|
|
|
2069
2105
|
return with_response ? response : void 0;
|
|
2070
2106
|
}
|
|
2071
2107
|
async launchActivity(interactionId, interactionToken, { with_response } = {}, { signal } = {}) {
|
|
2072
|
-
const response = await this.rest.post(
|
|
2108
|
+
const response = await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
|
|
2073
2109
|
query: (0, import_rest4.makeURLSearchParams)({ with_response }),
|
|
2074
2110
|
auth: false,
|
|
2075
2111
|
body: {
|
|
2076
|
-
type:
|
|
2112
|
+
type: import_v106.InteractionResponseType.LaunchActivity
|
|
2077
2113
|
},
|
|
2078
2114
|
signal
|
|
2079
2115
|
});
|
|
@@ -2083,7 +2119,7 @@ var InteractionsAPI = class {
|
|
|
2083
2119
|
|
|
2084
2120
|
// src/api/invite.ts
|
|
2085
2121
|
var import_rest5 = require("@discordjs/rest");
|
|
2086
|
-
var
|
|
2122
|
+
var import_v107 = require("discord-api-types/v10");
|
|
2087
2123
|
var InvitesAPI = class {
|
|
2088
2124
|
constructor(rest) {
|
|
2089
2125
|
this.rest = rest;
|
|
@@ -2100,7 +2136,7 @@ var InvitesAPI = class {
|
|
|
2100
2136
|
* @param options - The options for fetching the invite
|
|
2101
2137
|
*/
|
|
2102
2138
|
async get(code, query = {}, { auth, signal } = {}) {
|
|
2103
|
-
return this.rest.get(
|
|
2139
|
+
return this.rest.get(import_v107.Routes.invite(code), {
|
|
2104
2140
|
auth,
|
|
2105
2141
|
query: (0, import_rest5.makeURLSearchParams)(query),
|
|
2106
2142
|
signal
|
|
@@ -2114,13 +2150,13 @@ var InvitesAPI = class {
|
|
|
2114
2150
|
* @param options - The options for deleting the invite
|
|
2115
2151
|
*/
|
|
2116
2152
|
async delete(code, { auth, reason, signal } = {}) {
|
|
2117
|
-
await this.rest.delete(
|
|
2153
|
+
await this.rest.delete(import_v107.Routes.invite(code), { auth, reason, signal });
|
|
2118
2154
|
}
|
|
2119
2155
|
};
|
|
2120
2156
|
|
|
2121
2157
|
// src/api/monetization.ts
|
|
2122
2158
|
var import_rest6 = require("@discordjs/rest");
|
|
2123
|
-
var
|
|
2159
|
+
var import_v108 = require("discord-api-types/v10");
|
|
2124
2160
|
var MonetizationAPI = class {
|
|
2125
2161
|
constructor(rest) {
|
|
2126
2162
|
this.rest = rest;
|
|
@@ -2136,7 +2172,7 @@ var MonetizationAPI = class {
|
|
|
2136
2172
|
* @param options - The options for fetching the SKUs.
|
|
2137
2173
|
*/
|
|
2138
2174
|
async getSKUs(applicationId, { auth, signal } = {}) {
|
|
2139
|
-
return this.rest.get(
|
|
2175
|
+
return this.rest.get(import_v108.Routes.skus(applicationId), { auth, signal });
|
|
2140
2176
|
}
|
|
2141
2177
|
/**
|
|
2142
2178
|
* Fetches subscriptions for an SKU.
|
|
@@ -2147,7 +2183,7 @@ var MonetizationAPI = class {
|
|
|
2147
2183
|
* @param options - The options for fetching subscriptions
|
|
2148
2184
|
*/
|
|
2149
2185
|
async getSKUSubscriptions(skuId, query = {}, { auth, signal } = {}) {
|
|
2150
|
-
return this.rest.get(
|
|
2186
|
+
return this.rest.get(import_v108.Routes.skuSubscriptions(skuId), {
|
|
2151
2187
|
auth,
|
|
2152
2188
|
signal,
|
|
2153
2189
|
query: (0, import_rest6.makeURLSearchParams)(query)
|
|
@@ -2162,7 +2198,7 @@ var MonetizationAPI = class {
|
|
|
2162
2198
|
* @param options - The options for fetching the subscription
|
|
2163
2199
|
*/
|
|
2164
2200
|
async getSKUSubscription(skuId, subscriptionId, { auth, signal } = {}) {
|
|
2165
|
-
return this.rest.get(
|
|
2201
|
+
return this.rest.get(import_v108.Routes.skuSubscription(skuId, subscriptionId), {
|
|
2166
2202
|
auth,
|
|
2167
2203
|
signal
|
|
2168
2204
|
});
|
|
@@ -2176,7 +2212,7 @@ var MonetizationAPI = class {
|
|
|
2176
2212
|
* @param options - The options for fetching entitlements
|
|
2177
2213
|
*/
|
|
2178
2214
|
async getEntitlements(applicationId, query = {}, { auth, signal } = {}) {
|
|
2179
|
-
return this.rest.get(
|
|
2215
|
+
return this.rest.get(import_v108.Routes.entitlements(applicationId), {
|
|
2180
2216
|
auth,
|
|
2181
2217
|
signal,
|
|
2182
2218
|
query: (0, import_rest6.makeURLSearchParams)(query)
|
|
@@ -2191,7 +2227,7 @@ var MonetizationAPI = class {
|
|
|
2191
2227
|
* @param options - The options for fetching the entitlement
|
|
2192
2228
|
*/
|
|
2193
2229
|
async getEntitlement(applicationId, entitlementId, { auth, signal } = {}) {
|
|
2194
|
-
return this.rest.get(
|
|
2230
|
+
return this.rest.get(import_v108.Routes.entitlement(applicationId, entitlementId), {
|
|
2195
2231
|
auth,
|
|
2196
2232
|
signal
|
|
2197
2233
|
});
|
|
@@ -2205,7 +2241,7 @@ var MonetizationAPI = class {
|
|
|
2205
2241
|
* @param options - The options for creating the entitlement
|
|
2206
2242
|
*/
|
|
2207
2243
|
async createTestEntitlement(applicationId, body, { auth, signal } = {}) {
|
|
2208
|
-
return this.rest.post(
|
|
2244
|
+
return this.rest.post(import_v108.Routes.entitlements(applicationId), {
|
|
2209
2245
|
auth,
|
|
2210
2246
|
body,
|
|
2211
2247
|
signal
|
|
@@ -2220,7 +2256,7 @@ var MonetizationAPI = class {
|
|
|
2220
2256
|
* @param options - The options for deleting the entitlement
|
|
2221
2257
|
*/
|
|
2222
2258
|
async deleteTestEntitlement(applicationId, entitlementId, { auth, signal } = {}) {
|
|
2223
|
-
await this.rest.delete(
|
|
2259
|
+
await this.rest.delete(import_v108.Routes.entitlement(applicationId, entitlementId), { auth, signal });
|
|
2224
2260
|
}
|
|
2225
2261
|
/**
|
|
2226
2262
|
* Marks a given entitlement for the user as consumed. Only available for One-Time Purchase consumable SKUs.
|
|
@@ -2231,13 +2267,13 @@ var MonetizationAPI = class {
|
|
|
2231
2267
|
* @param options - The options for consuming the entitlement
|
|
2232
2268
|
*/
|
|
2233
2269
|
async consumeEntitlement(applicationId, entitlementId, { auth, signal } = {}) {
|
|
2234
|
-
await this.rest.post(
|
|
2270
|
+
await this.rest.post(import_v108.Routes.consumeEntitlement(applicationId, entitlementId), { auth, signal });
|
|
2235
2271
|
}
|
|
2236
2272
|
};
|
|
2237
2273
|
|
|
2238
2274
|
// src/api/oauth2.ts
|
|
2239
2275
|
var import_rest7 = require("@discordjs/rest");
|
|
2240
|
-
var
|
|
2276
|
+
var import_v109 = require("discord-api-types/v10");
|
|
2241
2277
|
var OAuth2API = class {
|
|
2242
2278
|
constructor(rest) {
|
|
2243
2279
|
this.rest = rest;
|
|
@@ -2252,7 +2288,7 @@ var OAuth2API = class {
|
|
|
2252
2288
|
* @param options - The options for creating the authorization URL
|
|
2253
2289
|
*/
|
|
2254
2290
|
generateAuthorizationURL(options) {
|
|
2255
|
-
const url = new URL(`${
|
|
2291
|
+
const url = new URL(`${import_v109.RouteBases.api}${import_v109.Routes.oauth2Authorization()}`);
|
|
2256
2292
|
url.search = (0, import_rest7.makeURLSearchParams)(options).toString();
|
|
2257
2293
|
return url.toString();
|
|
2258
2294
|
}
|
|
@@ -2264,7 +2300,7 @@ var OAuth2API = class {
|
|
|
2264
2300
|
* @param options - The options for the token exchange request
|
|
2265
2301
|
*/
|
|
2266
2302
|
async tokenExchange(body, { signal } = {}) {
|
|
2267
|
-
return this.rest.post(
|
|
2303
|
+
return this.rest.post(import_v109.Routes.oauth2TokenExchange(), {
|
|
2268
2304
|
body: (0, import_rest7.makeURLSearchParams)(body),
|
|
2269
2305
|
passThroughBody: true,
|
|
2270
2306
|
headers: {
|
|
@@ -2282,7 +2318,7 @@ var OAuth2API = class {
|
|
|
2282
2318
|
* @param options - The options for the refresh token request
|
|
2283
2319
|
*/
|
|
2284
2320
|
async refreshToken(body, { signal } = {}) {
|
|
2285
|
-
return this.rest.post(
|
|
2321
|
+
return this.rest.post(import_v109.Routes.oauth2TokenExchange(), {
|
|
2286
2322
|
body: (0, import_rest7.makeURLSearchParams)(body),
|
|
2287
2323
|
passThroughBody: true,
|
|
2288
2324
|
headers: {
|
|
@@ -2302,7 +2338,7 @@ var OAuth2API = class {
|
|
|
2302
2338
|
* @param options - The options for the client credentials grant request
|
|
2303
2339
|
*/
|
|
2304
2340
|
async getToken(body, { signal } = {}) {
|
|
2305
|
-
return this.rest.post(
|
|
2341
|
+
return this.rest.post(import_v109.Routes.oauth2TokenExchange(), {
|
|
2306
2342
|
body: (0, import_rest7.makeURLSearchParams)(body),
|
|
2307
2343
|
passThroughBody: true,
|
|
2308
2344
|
headers: {
|
|
@@ -2319,7 +2355,7 @@ var OAuth2API = class {
|
|
|
2319
2355
|
* @param options - The options for the current bot application information request
|
|
2320
2356
|
*/
|
|
2321
2357
|
async getCurrentBotApplicationInformation({ auth, signal } = {}) {
|
|
2322
|
-
return this.rest.get(
|
|
2358
|
+
return this.rest.get(import_v109.Routes.oauth2CurrentApplication(), {
|
|
2323
2359
|
auth,
|
|
2324
2360
|
signal
|
|
2325
2361
|
});
|
|
@@ -2331,7 +2367,7 @@ var OAuth2API = class {
|
|
|
2331
2367
|
* @param options - The options for the current authorization information request
|
|
2332
2368
|
*/
|
|
2333
2369
|
async getCurrentAuthorizationInformation({ auth, signal } = {}) {
|
|
2334
|
-
return this.rest.get(
|
|
2370
|
+
return this.rest.get(import_v109.Routes.oauth2CurrentAuthorization(), {
|
|
2335
2371
|
auth,
|
|
2336
2372
|
signal
|
|
2337
2373
|
});
|
|
@@ -2346,7 +2382,7 @@ var OAuth2API = class {
|
|
|
2346
2382
|
* @param options - The options for the token revocation request
|
|
2347
2383
|
*/
|
|
2348
2384
|
async revokeToken(applicationId, applicationSecret, body, { signal } = {}) {
|
|
2349
|
-
await this.rest.post(
|
|
2385
|
+
await this.rest.post(import_v109.Routes.oauth2TokenRevocation(), {
|
|
2350
2386
|
body: (0, import_rest7.makeURLSearchParams)(body),
|
|
2351
2387
|
passThroughBody: true,
|
|
2352
2388
|
headers: {
|
|
@@ -2361,7 +2397,7 @@ var OAuth2API = class {
|
|
|
2361
2397
|
|
|
2362
2398
|
// src/api/poll.ts
|
|
2363
2399
|
var import_rest8 = require("@discordjs/rest");
|
|
2364
|
-
var
|
|
2400
|
+
var import_v1010 = require("discord-api-types/v10");
|
|
2365
2401
|
var PollAPI = class {
|
|
2366
2402
|
constructor(rest) {
|
|
2367
2403
|
this.rest = rest;
|
|
@@ -2380,7 +2416,7 @@ var PollAPI = class {
|
|
|
2380
2416
|
* @param options - The options for getting the list of voters
|
|
2381
2417
|
*/
|
|
2382
2418
|
async getAnswerVoters(channelId, messageId, answerId, query = {}, { auth, signal } = {}) {
|
|
2383
|
-
return this.rest.get(
|
|
2419
|
+
return this.rest.get(import_v1010.Routes.pollAnswerVoters(channelId, messageId, answerId), {
|
|
2384
2420
|
auth,
|
|
2385
2421
|
signal,
|
|
2386
2422
|
query: (0, import_rest8.makeURLSearchParams)(query)
|
|
@@ -2395,7 +2431,7 @@ var PollAPI = class {
|
|
|
2395
2431
|
* @param options - The options for expiring the poll
|
|
2396
2432
|
*/
|
|
2397
2433
|
async expirePoll(channelId, messageId, { auth, signal } = {}) {
|
|
2398
|
-
return this.rest.post(
|
|
2434
|
+
return this.rest.post(import_v1010.Routes.expirePoll(channelId, messageId), {
|
|
2399
2435
|
auth,
|
|
2400
2436
|
signal
|
|
2401
2437
|
});
|
|
@@ -2403,7 +2439,7 @@ var PollAPI = class {
|
|
|
2403
2439
|
};
|
|
2404
2440
|
|
|
2405
2441
|
// src/api/roleConnections.ts
|
|
2406
|
-
var
|
|
2442
|
+
var import_v1011 = require("discord-api-types/v10");
|
|
2407
2443
|
var RoleConnectionsAPI = class {
|
|
2408
2444
|
constructor(rest) {
|
|
2409
2445
|
this.rest = rest;
|
|
@@ -2419,7 +2455,7 @@ var RoleConnectionsAPI = class {
|
|
|
2419
2455
|
* @param options - The options for fetching the role connection metadata records
|
|
2420
2456
|
*/
|
|
2421
2457
|
async getMetadataRecords(applicationId, { auth, signal } = {}) {
|
|
2422
|
-
return this.rest.get(
|
|
2458
|
+
return this.rest.get(import_v1011.Routes.applicationRoleConnectionMetadata(applicationId), {
|
|
2423
2459
|
auth,
|
|
2424
2460
|
signal
|
|
2425
2461
|
});
|
|
@@ -2433,7 +2469,7 @@ var RoleConnectionsAPI = class {
|
|
|
2433
2469
|
* @param options - The options for updating the role connection metadata records
|
|
2434
2470
|
*/
|
|
2435
2471
|
async updateMetadataRecords(applicationId, body, { auth, signal } = {}) {
|
|
2436
|
-
return this.rest.put(
|
|
2472
|
+
return this.rest.put(import_v1011.Routes.applicationRoleConnectionMetadata(applicationId), {
|
|
2437
2473
|
auth,
|
|
2438
2474
|
body,
|
|
2439
2475
|
signal
|
|
@@ -2442,7 +2478,7 @@ var RoleConnectionsAPI = class {
|
|
|
2442
2478
|
};
|
|
2443
2479
|
|
|
2444
2480
|
// src/api/soundboardSounds.ts
|
|
2445
|
-
var
|
|
2481
|
+
var import_v1012 = require("discord-api-types/v10");
|
|
2446
2482
|
var SoundboardSoundsAPI = class {
|
|
2447
2483
|
constructor(rest) {
|
|
2448
2484
|
this.rest = rest;
|
|
@@ -2457,7 +2493,7 @@ var SoundboardSoundsAPI = class {
|
|
|
2457
2493
|
* @param options - The options for fetching the soundboard default sounds.
|
|
2458
2494
|
*/
|
|
2459
2495
|
async getSoundboardDefaultSounds({ auth, signal } = {}) {
|
|
2460
|
-
return this.rest.get(
|
|
2496
|
+
return this.rest.get(import_v1012.Routes.soundboardDefaultSounds(), {
|
|
2461
2497
|
auth,
|
|
2462
2498
|
signal
|
|
2463
2499
|
});
|
|
@@ -2465,7 +2501,7 @@ var SoundboardSoundsAPI = class {
|
|
|
2465
2501
|
};
|
|
2466
2502
|
|
|
2467
2503
|
// src/api/stageInstances.ts
|
|
2468
|
-
var
|
|
2504
|
+
var import_v1013 = require("discord-api-types/v10");
|
|
2469
2505
|
var StageInstancesAPI = class {
|
|
2470
2506
|
constructor(rest) {
|
|
2471
2507
|
this.rest = rest;
|
|
@@ -2481,7 +2517,7 @@ var StageInstancesAPI = class {
|
|
|
2481
2517
|
* @param options - The options for creating the new stage instance
|
|
2482
2518
|
*/
|
|
2483
2519
|
async create(body, { auth, reason, signal } = {}) {
|
|
2484
|
-
return this.rest.post(
|
|
2520
|
+
return this.rest.post(import_v1013.Routes.stageInstances(), {
|
|
2485
2521
|
auth,
|
|
2486
2522
|
body,
|
|
2487
2523
|
reason,
|
|
@@ -2496,7 +2532,7 @@ var StageInstancesAPI = class {
|
|
|
2496
2532
|
* @param options - The options for fetching the stage instance
|
|
2497
2533
|
*/
|
|
2498
2534
|
async get(channelId, { auth, signal } = {}) {
|
|
2499
|
-
return this.rest.get(
|
|
2535
|
+
return this.rest.get(import_v1013.Routes.stageInstance(channelId), { auth, signal });
|
|
2500
2536
|
}
|
|
2501
2537
|
/**
|
|
2502
2538
|
* Edits a stage instance
|
|
@@ -2507,7 +2543,7 @@ var StageInstancesAPI = class {
|
|
|
2507
2543
|
* @param options - The options for editing the stage instance
|
|
2508
2544
|
*/
|
|
2509
2545
|
async edit(channelId, body, { auth, reason, signal } = {}) {
|
|
2510
|
-
return this.rest.patch(
|
|
2546
|
+
return this.rest.patch(import_v1013.Routes.stageInstance(channelId), {
|
|
2511
2547
|
auth,
|
|
2512
2548
|
body,
|
|
2513
2549
|
reason,
|
|
@@ -2522,12 +2558,12 @@ var StageInstancesAPI = class {
|
|
|
2522
2558
|
* @param options - The options for deleting the stage instance
|
|
2523
2559
|
*/
|
|
2524
2560
|
async delete(channelId, { auth, reason, signal } = {}) {
|
|
2525
|
-
await this.rest.delete(
|
|
2561
|
+
await this.rest.delete(import_v1013.Routes.stageInstance(channelId), { auth, reason, signal });
|
|
2526
2562
|
}
|
|
2527
2563
|
};
|
|
2528
2564
|
|
|
2529
2565
|
// src/api/sticker.ts
|
|
2530
|
-
var
|
|
2566
|
+
var import_v1014 = require("discord-api-types/v10");
|
|
2531
2567
|
var StickersAPI = class {
|
|
2532
2568
|
constructor(rest) {
|
|
2533
2569
|
this.rest = rest;
|
|
@@ -2543,7 +2579,7 @@ var StickersAPI = class {
|
|
|
2543
2579
|
* @param options - The options for fetching the sticker pack
|
|
2544
2580
|
*/
|
|
2545
2581
|
async getStickerPack(packId, { auth, signal } = {}) {
|
|
2546
|
-
return this.rest.get(
|
|
2582
|
+
return this.rest.get(import_v1014.Routes.stickerPack(packId), { auth, signal });
|
|
2547
2583
|
}
|
|
2548
2584
|
/**
|
|
2549
2585
|
* Fetches all of the sticker packs
|
|
@@ -2552,7 +2588,7 @@ var StickersAPI = class {
|
|
|
2552
2588
|
* @param options - The options for fetching the sticker packs
|
|
2553
2589
|
*/
|
|
2554
2590
|
async getStickers({ auth, signal } = {}) {
|
|
2555
|
-
return this.rest.get(
|
|
2591
|
+
return this.rest.get(import_v1014.Routes.stickerPacks(), { auth, signal });
|
|
2556
2592
|
}
|
|
2557
2593
|
/**
|
|
2558
2594
|
* Fetches a sticker
|
|
@@ -2562,12 +2598,12 @@ var StickersAPI = class {
|
|
|
2562
2598
|
* @param options - The options for fetching the sticker
|
|
2563
2599
|
*/
|
|
2564
2600
|
async get(stickerId, { auth, signal } = {}) {
|
|
2565
|
-
return this.rest.get(
|
|
2601
|
+
return this.rest.get(import_v1014.Routes.sticker(stickerId), { auth, signal });
|
|
2566
2602
|
}
|
|
2567
2603
|
};
|
|
2568
2604
|
|
|
2569
2605
|
// src/api/thread.ts
|
|
2570
|
-
var
|
|
2606
|
+
var import_v1015 = require("discord-api-types/v10");
|
|
2571
2607
|
var ThreadsAPI = class {
|
|
2572
2608
|
constructor(rest) {
|
|
2573
2609
|
this.rest = rest;
|
|
@@ -2583,7 +2619,7 @@ var ThreadsAPI = class {
|
|
|
2583
2619
|
* @param options - The options for joining the thread
|
|
2584
2620
|
*/
|
|
2585
2621
|
async join(threadId, { auth, signal } = {}) {
|
|
2586
|
-
await this.rest.put(
|
|
2622
|
+
await this.rest.put(import_v1015.Routes.threadMembers(threadId, "@me"), { auth, signal });
|
|
2587
2623
|
}
|
|
2588
2624
|
/**
|
|
2589
2625
|
* Adds a member to a thread
|
|
@@ -2594,7 +2630,7 @@ var ThreadsAPI = class {
|
|
|
2594
2630
|
* @param options - The options for adding the member to the thread
|
|
2595
2631
|
*/
|
|
2596
2632
|
async addMember(threadId, userId, { auth, signal } = {}) {
|
|
2597
|
-
await this.rest.put(
|
|
2633
|
+
await this.rest.put(import_v1015.Routes.threadMembers(threadId, userId), { auth, signal });
|
|
2598
2634
|
}
|
|
2599
2635
|
/**
|
|
2600
2636
|
* Removes the current user from a thread
|
|
@@ -2604,7 +2640,7 @@ var ThreadsAPI = class {
|
|
|
2604
2640
|
* @param options - The options for leaving the thread
|
|
2605
2641
|
*/
|
|
2606
2642
|
async leave(threadId, { auth, signal } = {}) {
|
|
2607
|
-
await this.rest.delete(
|
|
2643
|
+
await this.rest.delete(import_v1015.Routes.threadMembers(threadId, "@me"), { auth, signal });
|
|
2608
2644
|
}
|
|
2609
2645
|
/**
|
|
2610
2646
|
* Removes a member from a thread
|
|
@@ -2615,7 +2651,7 @@ var ThreadsAPI = class {
|
|
|
2615
2651
|
* @param options - The options for removing the member from the thread
|
|
2616
2652
|
*/
|
|
2617
2653
|
async removeMember(threadId, userId, { auth, signal } = {}) {
|
|
2618
|
-
await this.rest.delete(
|
|
2654
|
+
await this.rest.delete(import_v1015.Routes.threadMembers(threadId, userId), { auth, signal });
|
|
2619
2655
|
}
|
|
2620
2656
|
/**
|
|
2621
2657
|
* Fetches a member of a thread
|
|
@@ -2626,7 +2662,7 @@ var ThreadsAPI = class {
|
|
|
2626
2662
|
* @param options - The options for fetching the member
|
|
2627
2663
|
*/
|
|
2628
2664
|
async getMember(threadId, userId, { auth, signal } = {}) {
|
|
2629
|
-
return this.rest.get(
|
|
2665
|
+
return this.rest.get(import_v1015.Routes.threadMembers(threadId, userId), { auth, signal });
|
|
2630
2666
|
}
|
|
2631
2667
|
/**
|
|
2632
2668
|
* Fetches all members of a thread
|
|
@@ -2636,7 +2672,7 @@ var ThreadsAPI = class {
|
|
|
2636
2672
|
* @param options - The options for fetching the members
|
|
2637
2673
|
*/
|
|
2638
2674
|
async getAllMembers(threadId, { auth, signal } = {}) {
|
|
2639
|
-
return this.rest.get(
|
|
2675
|
+
return this.rest.get(import_v1015.Routes.threadMembers(threadId), {
|
|
2640
2676
|
auth,
|
|
2641
2677
|
signal
|
|
2642
2678
|
});
|
|
@@ -2645,7 +2681,7 @@ var ThreadsAPI = class {
|
|
|
2645
2681
|
|
|
2646
2682
|
// src/api/user.ts
|
|
2647
2683
|
var import_rest9 = require("@discordjs/rest");
|
|
2648
|
-
var
|
|
2684
|
+
var import_v1016 = require("discord-api-types/v10");
|
|
2649
2685
|
var UsersAPI = class {
|
|
2650
2686
|
constructor(rest) {
|
|
2651
2687
|
this.rest = rest;
|
|
@@ -2661,7 +2697,7 @@ var UsersAPI = class {
|
|
|
2661
2697
|
* @param options - The options for fetching the user
|
|
2662
2698
|
*/
|
|
2663
2699
|
async get(userId, { auth, signal } = {}) {
|
|
2664
|
-
return this.rest.get(
|
|
2700
|
+
return this.rest.get(import_v1016.Routes.user(userId), { auth, signal });
|
|
2665
2701
|
}
|
|
2666
2702
|
/**
|
|
2667
2703
|
* Returns the user object of the requester's account
|
|
@@ -2670,7 +2706,7 @@ var UsersAPI = class {
|
|
|
2670
2706
|
* @param options - The options for fetching the current user
|
|
2671
2707
|
*/
|
|
2672
2708
|
async getCurrent({ auth, signal } = {}) {
|
|
2673
|
-
return this.rest.get(
|
|
2709
|
+
return this.rest.get(import_v1016.Routes.user("@me"), { auth, signal });
|
|
2674
2710
|
}
|
|
2675
2711
|
/**
|
|
2676
2712
|
* Returns a list of partial guild objects the current user is a member of
|
|
@@ -2680,7 +2716,7 @@ var UsersAPI = class {
|
|
|
2680
2716
|
* @param options - The options for fetching the guilds
|
|
2681
2717
|
*/
|
|
2682
2718
|
async getGuilds(query = {}, { auth, signal } = {}) {
|
|
2683
|
-
return this.rest.get(
|
|
2719
|
+
return this.rest.get(import_v1016.Routes.userGuilds(), {
|
|
2684
2720
|
auth,
|
|
2685
2721
|
query: (0, import_rest9.makeURLSearchParams)(query),
|
|
2686
2722
|
signal
|
|
@@ -2694,7 +2730,7 @@ var UsersAPI = class {
|
|
|
2694
2730
|
* @param options - The options for leaving the guild
|
|
2695
2731
|
*/
|
|
2696
2732
|
async leaveGuild(guildId, { auth, signal } = {}) {
|
|
2697
|
-
await this.rest.delete(
|
|
2733
|
+
await this.rest.delete(import_v1016.Routes.userGuild(guildId), { auth, signal });
|
|
2698
2734
|
}
|
|
2699
2735
|
/**
|
|
2700
2736
|
* Edits the current user
|
|
@@ -2704,7 +2740,7 @@ var UsersAPI = class {
|
|
|
2704
2740
|
* @param options - The options for editing the user
|
|
2705
2741
|
*/
|
|
2706
2742
|
async edit(body, { auth, signal } = {}) {
|
|
2707
|
-
return this.rest.patch(
|
|
2743
|
+
return this.rest.patch(import_v1016.Routes.user("@me"), { auth, body, signal });
|
|
2708
2744
|
}
|
|
2709
2745
|
/**
|
|
2710
2746
|
* Fetches the guild member for the current user
|
|
@@ -2714,7 +2750,7 @@ var UsersAPI = class {
|
|
|
2714
2750
|
* @param options - The options for fetching the guild member
|
|
2715
2751
|
*/
|
|
2716
2752
|
async getGuildMember(guildId, { auth, signal } = {}) {
|
|
2717
|
-
return this.rest.get(
|
|
2753
|
+
return this.rest.get(import_v1016.Routes.userGuildMember(guildId), {
|
|
2718
2754
|
auth,
|
|
2719
2755
|
signal
|
|
2720
2756
|
});
|
|
@@ -2728,7 +2764,7 @@ var UsersAPI = class {
|
|
|
2728
2764
|
* @param options - The options for editing the guild member
|
|
2729
2765
|
*/
|
|
2730
2766
|
async editCurrentGuildMember(guildId, body = {}, { auth, reason, signal } = {}) {
|
|
2731
|
-
return this.rest.patch(
|
|
2767
|
+
return this.rest.patch(import_v1016.Routes.guildMember(guildId, "@me"), {
|
|
2732
2768
|
auth,
|
|
2733
2769
|
reason,
|
|
2734
2770
|
body,
|
|
@@ -2743,7 +2779,7 @@ var UsersAPI = class {
|
|
|
2743
2779
|
* @param options - The options for opening the DM
|
|
2744
2780
|
*/
|
|
2745
2781
|
async createDM(userId, { auth, signal } = {}) {
|
|
2746
|
-
return this.rest.post(
|
|
2782
|
+
return this.rest.post(import_v1016.Routes.userChannels(), {
|
|
2747
2783
|
auth,
|
|
2748
2784
|
body: { recipient_id: userId },
|
|
2749
2785
|
signal
|
|
@@ -2756,7 +2792,7 @@ var UsersAPI = class {
|
|
|
2756
2792
|
* @param options - The options for fetching the user's connections
|
|
2757
2793
|
*/
|
|
2758
2794
|
async getConnections({ auth, signal } = {}) {
|
|
2759
|
-
return this.rest.get(
|
|
2795
|
+
return this.rest.get(import_v1016.Routes.userConnections(), { auth, signal });
|
|
2760
2796
|
}
|
|
2761
2797
|
/**
|
|
2762
2798
|
* Gets the current user's active application role connection
|
|
@@ -2766,7 +2802,7 @@ var UsersAPI = class {
|
|
|
2766
2802
|
* @param options - The options for fetching the role connections
|
|
2767
2803
|
*/
|
|
2768
2804
|
async getApplicationRoleConnection(applicationId, { auth, signal } = {}) {
|
|
2769
|
-
return this.rest.get(
|
|
2805
|
+
return this.rest.get(import_v1016.Routes.userApplicationRoleConnection(applicationId), {
|
|
2770
2806
|
auth,
|
|
2771
2807
|
signal
|
|
2772
2808
|
});
|
|
@@ -2780,7 +2816,7 @@ var UsersAPI = class {
|
|
|
2780
2816
|
* @param options - The options for updating the application role connection
|
|
2781
2817
|
*/
|
|
2782
2818
|
async updateApplicationRoleConnection(applicationId, body, { auth, signal } = {}) {
|
|
2783
|
-
return this.rest.put(
|
|
2819
|
+
return this.rest.put(import_v1016.Routes.userApplicationRoleConnection(applicationId), {
|
|
2784
2820
|
auth,
|
|
2785
2821
|
body,
|
|
2786
2822
|
signal
|
|
@@ -2789,7 +2825,7 @@ var UsersAPI = class {
|
|
|
2789
2825
|
};
|
|
2790
2826
|
|
|
2791
2827
|
// src/api/voice.ts
|
|
2792
|
-
var
|
|
2828
|
+
var import_v1017 = require("discord-api-types/v10");
|
|
2793
2829
|
var VoiceAPI = class {
|
|
2794
2830
|
constructor(rest) {
|
|
2795
2831
|
this.rest = rest;
|
|
@@ -2804,7 +2840,7 @@ var VoiceAPI = class {
|
|
|
2804
2840
|
* @param options - The options for fetching the voice regions
|
|
2805
2841
|
*/
|
|
2806
2842
|
async getVoiceRegions({ auth, signal } = {}) {
|
|
2807
|
-
return this.rest.get(
|
|
2843
|
+
return this.rest.get(import_v1017.Routes.voiceRegions(), { auth, signal });
|
|
2808
2844
|
}
|
|
2809
2845
|
/**
|
|
2810
2846
|
* Fetches voice state of a user by their id
|
|
@@ -2813,7 +2849,7 @@ var VoiceAPI = class {
|
|
|
2813
2849
|
* @param options - The options for fetching user voice state
|
|
2814
2850
|
*/
|
|
2815
2851
|
async getUserVoiceState(guildId, userId, { auth, signal } = {}) {
|
|
2816
|
-
return this.rest.get(
|
|
2852
|
+
return this.rest.get(import_v1017.Routes.guildVoiceState(guildId, userId), {
|
|
2817
2853
|
auth,
|
|
2818
2854
|
signal
|
|
2819
2855
|
});
|
|
@@ -2825,7 +2861,7 @@ var VoiceAPI = class {
|
|
|
2825
2861
|
* @param options - The options for fetching user voice state
|
|
2826
2862
|
*/
|
|
2827
2863
|
async getVoiceState(guildId, { auth, signal } = {}) {
|
|
2828
|
-
return this.rest.get(
|
|
2864
|
+
return this.rest.get(import_v1017.Routes.guildVoiceState(guildId, "@me"), {
|
|
2829
2865
|
auth,
|
|
2830
2866
|
signal
|
|
2831
2867
|
});
|
|
@@ -2840,7 +2876,7 @@ var VoiceAPI = class {
|
|
|
2840
2876
|
* @param options - The options for editing the voice state
|
|
2841
2877
|
*/
|
|
2842
2878
|
async editUserVoiceState(guildId, userId, body, { auth, reason, signal } = {}) {
|
|
2843
|
-
return this.rest.patch(
|
|
2879
|
+
return this.rest.patch(import_v1017.Routes.guildVoiceState(guildId, userId), {
|
|
2844
2880
|
auth,
|
|
2845
2881
|
reason,
|
|
2846
2882
|
body,
|
|
@@ -2856,7 +2892,7 @@ var VoiceAPI = class {
|
|
|
2856
2892
|
* @param options - The options for editing the voice state
|
|
2857
2893
|
*/
|
|
2858
2894
|
async editVoiceState(guildId, body = {}, { auth, signal } = {}) {
|
|
2859
|
-
return this.rest.patch(
|
|
2895
|
+
return this.rest.patch(import_v1017.Routes.guildVoiceState(guildId, "@me"), {
|
|
2860
2896
|
auth,
|
|
2861
2897
|
body,
|
|
2862
2898
|
signal
|
|
@@ -2866,7 +2902,7 @@ var VoiceAPI = class {
|
|
|
2866
2902
|
|
|
2867
2903
|
// src/api/webhook.ts
|
|
2868
2904
|
var import_rest10 = require("@discordjs/rest");
|
|
2869
|
-
var
|
|
2905
|
+
var import_v1018 = require("discord-api-types/v10");
|
|
2870
2906
|
var WebhooksAPI = class {
|
|
2871
2907
|
constructor(rest) {
|
|
2872
2908
|
this.rest = rest;
|
|
@@ -2883,7 +2919,7 @@ var WebhooksAPI = class {
|
|
|
2883
2919
|
* @param options - The options for fetching the webhook
|
|
2884
2920
|
*/
|
|
2885
2921
|
async get(id, { token, signal } = {}) {
|
|
2886
|
-
return this.rest.get(
|
|
2922
|
+
return this.rest.get(import_v1018.Routes.webhook(id, token), {
|
|
2887
2923
|
signal,
|
|
2888
2924
|
auth: !token
|
|
2889
2925
|
});
|
|
@@ -2898,7 +2934,7 @@ var WebhooksAPI = class {
|
|
|
2898
2934
|
* @param options - The options for editing the webhook
|
|
2899
2935
|
*/
|
|
2900
2936
|
async edit(id, body, { token, reason, signal } = {}) {
|
|
2901
|
-
return this.rest.patch(
|
|
2937
|
+
return this.rest.patch(import_v1018.Routes.webhook(id, token), {
|
|
2902
2938
|
reason,
|
|
2903
2939
|
body,
|
|
2904
2940
|
signal,
|
|
@@ -2914,7 +2950,7 @@ var WebhooksAPI = class {
|
|
|
2914
2950
|
* @param options - The options for deleting the webhook
|
|
2915
2951
|
*/
|
|
2916
2952
|
async delete(id, { token, reason, signal } = {}) {
|
|
2917
|
-
await this.rest.delete(
|
|
2953
|
+
await this.rest.delete(import_v1018.Routes.webhook(id, token), {
|
|
2918
2954
|
reason,
|
|
2919
2955
|
signal,
|
|
2920
2956
|
auth: !token
|
|
@@ -2930,7 +2966,7 @@ var WebhooksAPI = class {
|
|
|
2930
2966
|
* @param options - The options for executing the webhook
|
|
2931
2967
|
*/
|
|
2932
2968
|
async execute(id, token, { wait, thread_id, with_components, files, ...body }, { signal } = {}) {
|
|
2933
|
-
return this.rest.post(
|
|
2969
|
+
return this.rest.post(import_v1018.Routes.webhook(id, token), {
|
|
2934
2970
|
query: (0, import_rest10.makeURLSearchParams)({ wait, thread_id, with_components }),
|
|
2935
2971
|
files,
|
|
2936
2972
|
body,
|
|
@@ -2949,7 +2985,7 @@ var WebhooksAPI = class {
|
|
|
2949
2985
|
* @param options - The options for executing the webhook
|
|
2950
2986
|
*/
|
|
2951
2987
|
async executeSlack(id, token, body, query = {}, { signal } = {}) {
|
|
2952
|
-
await this.rest.post(
|
|
2988
|
+
await this.rest.post(import_v1018.Routes.webhookPlatform(id, token, "slack"), {
|
|
2953
2989
|
query: (0, import_rest10.makeURLSearchParams)(query),
|
|
2954
2990
|
body,
|
|
2955
2991
|
auth: false,
|
|
@@ -2967,7 +3003,7 @@ var WebhooksAPI = class {
|
|
|
2967
3003
|
* @param options - The options for executing the webhook
|
|
2968
3004
|
*/
|
|
2969
3005
|
async executeGitHub(id, token, body, query = {}, { signal } = {}) {
|
|
2970
|
-
await this.rest.post(
|
|
3006
|
+
await this.rest.post(import_v1018.Routes.webhookPlatform(id, token, "github"), {
|
|
2971
3007
|
query: (0, import_rest10.makeURLSearchParams)(query),
|
|
2972
3008
|
body,
|
|
2973
3009
|
signal,
|
|
@@ -2985,7 +3021,7 @@ var WebhooksAPI = class {
|
|
|
2985
3021
|
* @param options - The options for fetching the message
|
|
2986
3022
|
*/
|
|
2987
3023
|
async getMessage(id, token, messageId, query = {}, { signal } = {}) {
|
|
2988
|
-
return this.rest.get(
|
|
3024
|
+
return this.rest.get(import_v1018.Routes.webhookMessage(id, token, messageId), {
|
|
2989
3025
|
query: (0, import_rest10.makeURLSearchParams)(query),
|
|
2990
3026
|
auth: false,
|
|
2991
3027
|
signal
|
|
@@ -3002,7 +3038,7 @@ var WebhooksAPI = class {
|
|
|
3002
3038
|
* @param options - The options for editing the message
|
|
3003
3039
|
*/
|
|
3004
3040
|
async editMessage(id, token, messageId, { thread_id, with_components, files, ...body }, { signal } = {}) {
|
|
3005
|
-
return this.rest.patch(
|
|
3041
|
+
return this.rest.patch(import_v1018.Routes.webhookMessage(id, token, messageId), {
|
|
3006
3042
|
query: (0, import_rest10.makeURLSearchParams)({ thread_id, with_components }),
|
|
3007
3043
|
auth: false,
|
|
3008
3044
|
body,
|
|
@@ -3021,7 +3057,7 @@ var WebhooksAPI = class {
|
|
|
3021
3057
|
* @param options - The options for deleting the message
|
|
3022
3058
|
*/
|
|
3023
3059
|
async deleteMessage(id, token, messageId, query = {}, { signal } = {}) {
|
|
3024
|
-
await this.rest.delete(
|
|
3060
|
+
await this.rest.delete(import_v1018.Routes.webhookMessage(id, token, messageId), {
|
|
3025
3061
|
query: (0, import_rest10.makeURLSearchParams)(query),
|
|
3026
3062
|
auth: false,
|
|
3027
3063
|
signal
|
|
@@ -3036,6 +3072,7 @@ var API = class {
|
|
|
3036
3072
|
this.applicationCommands = new ApplicationCommandsAPI(rest);
|
|
3037
3073
|
this.applications = new ApplicationsAPI(rest);
|
|
3038
3074
|
this.channels = new ChannelsAPI(rest);
|
|
3075
|
+
this.gateway = new GatewayAPI(rest);
|
|
3039
3076
|
this.guilds = new GuildsAPI(rest);
|
|
3040
3077
|
this.invites = new InvitesAPI(rest);
|
|
3041
3078
|
this.monetization = new MonetizationAPI(rest);
|
|
@@ -3057,6 +3094,7 @@ var API = class {
|
|
|
3057
3094
|
applicationCommands;
|
|
3058
3095
|
applications;
|
|
3059
3096
|
channels;
|
|
3097
|
+
gateway;
|
|
3060
3098
|
guilds;
|
|
3061
3099
|
interactions;
|
|
3062
3100
|
invites;
|
|
@@ -3092,13 +3130,14 @@ __name(withFiles, "withFiles");
|
|
|
3092
3130
|
|
|
3093
3131
|
// src/http-only/index.ts
|
|
3094
3132
|
__reExport(http_only_exports, require("discord-api-types/v10"), module.exports);
|
|
3095
|
-
var version = "3.0.0-dev.
|
|
3133
|
+
var version = "3.0.0-dev.1759622511-ffbb7b693";
|
|
3096
3134
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3097
3135
|
0 && (module.exports = {
|
|
3098
3136
|
API,
|
|
3099
3137
|
ApplicationCommandsAPI,
|
|
3100
3138
|
ApplicationsAPI,
|
|
3101
3139
|
ChannelsAPI,
|
|
3140
|
+
GatewayAPI,
|
|
3102
3141
|
GuildsAPI,
|
|
3103
3142
|
InteractionsAPI,
|
|
3104
3143
|
InvitesAPI,
|