@discordjs/core 3.0.0-dev.1759579293-cf89260c9 → 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/index.mjs
CHANGED
|
@@ -860,10 +860,45 @@ var ChannelsAPI = class {
|
|
|
860
860
|
}
|
|
861
861
|
};
|
|
862
862
|
|
|
863
|
+
// src/api/gateway.ts
|
|
864
|
+
import { Routes as Routes4 } from "discord-api-types/v10";
|
|
865
|
+
var GatewayAPI = class {
|
|
866
|
+
constructor(rest) {
|
|
867
|
+
this.rest = rest;
|
|
868
|
+
}
|
|
869
|
+
static {
|
|
870
|
+
__name(this, "GatewayAPI");
|
|
871
|
+
}
|
|
872
|
+
/**
|
|
873
|
+
* Gets gateway information.
|
|
874
|
+
*
|
|
875
|
+
* @see {@link https://discord.com/developers/docs/events/gateway#get-gateway}
|
|
876
|
+
* @param options - The options for fetching the gateway information
|
|
877
|
+
*/
|
|
878
|
+
async get({ signal } = {}) {
|
|
879
|
+
return this.rest.get(Routes4.gateway(), {
|
|
880
|
+
auth: false,
|
|
881
|
+
signal
|
|
882
|
+
});
|
|
883
|
+
}
|
|
884
|
+
/**
|
|
885
|
+
* Gets gateway information with additional metadata.
|
|
886
|
+
*
|
|
887
|
+
* @see {@link https://discord.com/developers/docs/events/gateway#get-gateway-bot}
|
|
888
|
+
* @param options - The options for fetching the gateway information
|
|
889
|
+
*/
|
|
890
|
+
async getBot({ auth, signal } = {}) {
|
|
891
|
+
return this.rest.get(Routes4.gatewayBot(), {
|
|
892
|
+
auth,
|
|
893
|
+
signal
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
};
|
|
897
|
+
|
|
863
898
|
// src/api/guild.ts
|
|
864
899
|
import { makeURLSearchParams as makeURLSearchParams3 } from "@discordjs/rest";
|
|
865
900
|
import {
|
|
866
|
-
Routes as
|
|
901
|
+
Routes as Routes5
|
|
867
902
|
} from "discord-api-types/v10";
|
|
868
903
|
var GuildsAPI = class {
|
|
869
904
|
constructor(rest) {
|
|
@@ -881,7 +916,7 @@ var GuildsAPI = class {
|
|
|
881
916
|
* @param options - The options for fetching the guild
|
|
882
917
|
*/
|
|
883
918
|
async get(guildId, query = {}, { auth, signal } = {}) {
|
|
884
|
-
return this.rest.get(
|
|
919
|
+
return this.rest.get(Routes5.guild(guildId), {
|
|
885
920
|
auth,
|
|
886
921
|
query: makeURLSearchParams3(query),
|
|
887
922
|
signal
|
|
@@ -895,7 +930,7 @@ var GuildsAPI = class {
|
|
|
895
930
|
* @param options - The options for fetching the guild preview
|
|
896
931
|
*/
|
|
897
932
|
async getPreview(guildId, { auth, signal } = {}) {
|
|
898
|
-
return this.rest.get(
|
|
933
|
+
return this.rest.get(Routes5.guildPreview(guildId), {
|
|
899
934
|
auth,
|
|
900
935
|
signal
|
|
901
936
|
});
|
|
@@ -909,7 +944,7 @@ var GuildsAPI = class {
|
|
|
909
944
|
* @param options - The options for editing the guild
|
|
910
945
|
*/
|
|
911
946
|
async edit(guildId, body, { auth, reason, signal } = {}) {
|
|
912
|
-
return this.rest.patch(
|
|
947
|
+
return this.rest.patch(Routes5.guild(guildId), {
|
|
913
948
|
auth,
|
|
914
949
|
reason,
|
|
915
950
|
body,
|
|
@@ -926,7 +961,7 @@ var GuildsAPI = class {
|
|
|
926
961
|
* @param options - The options for adding users to the guild
|
|
927
962
|
*/
|
|
928
963
|
async addMember(guildId, userId, body, { auth, signal } = {}) {
|
|
929
|
-
return this.rest.put(
|
|
964
|
+
return this.rest.put(Routes5.guildMember(guildId, userId), {
|
|
930
965
|
auth,
|
|
931
966
|
body,
|
|
932
967
|
signal
|
|
@@ -941,7 +976,7 @@ var GuildsAPI = class {
|
|
|
941
976
|
* @param options - The options for fetching the guild members
|
|
942
977
|
*/
|
|
943
978
|
async getMembers(guildId, query = {}, { auth, signal } = {}) {
|
|
944
|
-
return this.rest.get(
|
|
979
|
+
return this.rest.get(Routes5.guildMembers(guildId), {
|
|
945
980
|
auth,
|
|
946
981
|
query: makeURLSearchParams3(query),
|
|
947
982
|
signal
|
|
@@ -955,7 +990,7 @@ var GuildsAPI = class {
|
|
|
955
990
|
* @param options - The options for fetching the guild channels
|
|
956
991
|
*/
|
|
957
992
|
async getChannels(guildId, { auth, signal } = {}) {
|
|
958
|
-
return this.rest.get(
|
|
993
|
+
return this.rest.get(Routes5.guildChannels(guildId), {
|
|
959
994
|
auth,
|
|
960
995
|
signal
|
|
961
996
|
});
|
|
@@ -969,7 +1004,7 @@ var GuildsAPI = class {
|
|
|
969
1004
|
* @param options - The options for creating the guild channel
|
|
970
1005
|
*/
|
|
971
1006
|
async createChannel(guildId, body, { auth, reason, signal } = {}) {
|
|
972
|
-
return this.rest.post(
|
|
1007
|
+
return this.rest.post(Routes5.guildChannels(guildId), {
|
|
973
1008
|
auth,
|
|
974
1009
|
reason,
|
|
975
1010
|
body,
|
|
@@ -985,7 +1020,7 @@ var GuildsAPI = class {
|
|
|
985
1020
|
* @param options - The options for editing the guild channel positions
|
|
986
1021
|
*/
|
|
987
1022
|
async setChannelPositions(guildId, body, { auth, reason, signal } = {}) {
|
|
988
|
-
await this.rest.patch(
|
|
1023
|
+
await this.rest.patch(Routes5.guildChannels(guildId), { auth, reason, body, signal });
|
|
989
1024
|
}
|
|
990
1025
|
/**
|
|
991
1026
|
* Fetches the active threads in a guild
|
|
@@ -995,7 +1030,7 @@ var GuildsAPI = class {
|
|
|
995
1030
|
* @param options - The options for fetching the active threads
|
|
996
1031
|
*/
|
|
997
1032
|
async getActiveThreads(guildId, { auth, signal } = {}) {
|
|
998
|
-
return this.rest.get(
|
|
1033
|
+
return this.rest.get(Routes5.guildActiveThreads(guildId), { auth, signal });
|
|
999
1034
|
}
|
|
1000
1035
|
/**
|
|
1001
1036
|
* Fetches a guild member ban
|
|
@@ -1006,7 +1041,7 @@ var GuildsAPI = class {
|
|
|
1006
1041
|
* @param options - The options for fetching the ban
|
|
1007
1042
|
*/
|
|
1008
1043
|
async getMemberBan(guildId, userId, { auth, signal } = {}) {
|
|
1009
|
-
return this.rest.get(
|
|
1044
|
+
return this.rest.get(Routes5.guildBan(guildId, userId), { auth, signal });
|
|
1010
1045
|
}
|
|
1011
1046
|
/**
|
|
1012
1047
|
* Fetches guild member bans
|
|
@@ -1017,7 +1052,7 @@ var GuildsAPI = class {
|
|
|
1017
1052
|
* @param options - The options for fetching the bans
|
|
1018
1053
|
*/
|
|
1019
1054
|
async getMemberBans(guildId, query = {}, { auth, signal } = {}) {
|
|
1020
|
-
return this.rest.get(
|
|
1055
|
+
return this.rest.get(Routes5.guildBans(guildId), {
|
|
1021
1056
|
auth,
|
|
1022
1057
|
query: makeURLSearchParams3(query),
|
|
1023
1058
|
signal
|
|
@@ -1033,7 +1068,7 @@ var GuildsAPI = class {
|
|
|
1033
1068
|
* @param options - The options for banning the user
|
|
1034
1069
|
*/
|
|
1035
1070
|
async banUser(guildId, userId, body = {}, { auth, reason, signal } = {}) {
|
|
1036
|
-
await this.rest.put(
|
|
1071
|
+
await this.rest.put(Routes5.guildBan(guildId, userId), { auth, reason, body, signal });
|
|
1037
1072
|
}
|
|
1038
1073
|
/**
|
|
1039
1074
|
* Unbans a user from a guild
|
|
@@ -1044,7 +1079,7 @@ var GuildsAPI = class {
|
|
|
1044
1079
|
* @param options - The options for unbanning the user
|
|
1045
1080
|
*/
|
|
1046
1081
|
async unbanUser(guildId, userId, { auth, reason, signal } = {}) {
|
|
1047
|
-
await this.rest.delete(
|
|
1082
|
+
await this.rest.delete(Routes5.guildBan(guildId, userId), { auth, reason, signal });
|
|
1048
1083
|
}
|
|
1049
1084
|
/**
|
|
1050
1085
|
* Bulk ban users from a guild
|
|
@@ -1055,7 +1090,7 @@ var GuildsAPI = class {
|
|
|
1055
1090
|
* @param options - The options for bulk banning users
|
|
1056
1091
|
*/
|
|
1057
1092
|
async bulkBanUsers(guildId, body, { auth, reason, signal } = {}) {
|
|
1058
|
-
return this.rest.post(
|
|
1093
|
+
return this.rest.post(Routes5.guildBulkBan(guildId), {
|
|
1059
1094
|
auth,
|
|
1060
1095
|
reason,
|
|
1061
1096
|
body,
|
|
@@ -1070,7 +1105,7 @@ var GuildsAPI = class {
|
|
|
1070
1105
|
* @param options - The options for fetching the guild roles
|
|
1071
1106
|
*/
|
|
1072
1107
|
async getRoles(guildId, { auth, signal } = {}) {
|
|
1073
|
-
return this.rest.get(
|
|
1108
|
+
return this.rest.get(Routes5.guildRoles(guildId), { auth, signal });
|
|
1074
1109
|
}
|
|
1075
1110
|
/**
|
|
1076
1111
|
* Get a role in a guild
|
|
@@ -1081,7 +1116,7 @@ var GuildsAPI = class {
|
|
|
1081
1116
|
* @param options - The options for fetching the guild role
|
|
1082
1117
|
*/
|
|
1083
1118
|
async getRole(guildId, roleId, { auth, signal } = {}) {
|
|
1084
|
-
return this.rest.get(
|
|
1119
|
+
return this.rest.get(Routes5.guildRole(guildId, roleId), { auth, signal });
|
|
1085
1120
|
}
|
|
1086
1121
|
/**
|
|
1087
1122
|
* Creates a guild role
|
|
@@ -1092,7 +1127,7 @@ var GuildsAPI = class {
|
|
|
1092
1127
|
* @param options - The options for creating the guild role
|
|
1093
1128
|
*/
|
|
1094
1129
|
async createRole(guildId, body, { auth, reason, signal } = {}) {
|
|
1095
|
-
return this.rest.post(
|
|
1130
|
+
return this.rest.post(Routes5.guildRoles(guildId), {
|
|
1096
1131
|
auth,
|
|
1097
1132
|
reason,
|
|
1098
1133
|
body,
|
|
@@ -1108,7 +1143,7 @@ var GuildsAPI = class {
|
|
|
1108
1143
|
* @param options - The options for setting role positions
|
|
1109
1144
|
*/
|
|
1110
1145
|
async setRolePositions(guildId, body, { auth, reason, signal } = {}) {
|
|
1111
|
-
return this.rest.patch(
|
|
1146
|
+
return this.rest.patch(Routes5.guildRoles(guildId), {
|
|
1112
1147
|
auth,
|
|
1113
1148
|
reason,
|
|
1114
1149
|
body,
|
|
@@ -1125,7 +1160,7 @@ var GuildsAPI = class {
|
|
|
1125
1160
|
* @param options - The options for editing the guild role
|
|
1126
1161
|
*/
|
|
1127
1162
|
async editRole(guildId, roleId, body, { auth, reason, signal } = {}) {
|
|
1128
|
-
return this.rest.patch(
|
|
1163
|
+
return this.rest.patch(Routes5.guildRole(guildId, roleId), {
|
|
1129
1164
|
auth,
|
|
1130
1165
|
reason,
|
|
1131
1166
|
body,
|
|
@@ -1141,7 +1176,7 @@ var GuildsAPI = class {
|
|
|
1141
1176
|
* @param options - The options for deleting the guild role
|
|
1142
1177
|
*/
|
|
1143
1178
|
async deleteRole(guildId, roleId, { auth, reason, signal } = {}) {
|
|
1144
|
-
await this.rest.delete(
|
|
1179
|
+
await this.rest.delete(Routes5.guildRole(guildId, roleId), { auth, reason, signal });
|
|
1145
1180
|
}
|
|
1146
1181
|
/**
|
|
1147
1182
|
* Fetch the number of members that can be pruned from a guild
|
|
@@ -1152,7 +1187,7 @@ var GuildsAPI = class {
|
|
|
1152
1187
|
* @param options - The options for fetching the number of pruned members
|
|
1153
1188
|
*/
|
|
1154
1189
|
async getPruneCount(guildId, query = {}, { auth, signal } = {}) {
|
|
1155
|
-
return this.rest.get(
|
|
1190
|
+
return this.rest.get(Routes5.guildPrune(guildId), {
|
|
1156
1191
|
auth,
|
|
1157
1192
|
signal,
|
|
1158
1193
|
query: makeURLSearchParams3(query)
|
|
@@ -1167,7 +1202,7 @@ var GuildsAPI = class {
|
|
|
1167
1202
|
* @param options - The options for initiating the prune
|
|
1168
1203
|
*/
|
|
1169
1204
|
async beginPrune(guildId, body = {}, { auth, reason, signal } = {}) {
|
|
1170
|
-
return this.rest.post(
|
|
1205
|
+
return this.rest.post(Routes5.guildPrune(guildId), {
|
|
1171
1206
|
auth,
|
|
1172
1207
|
body,
|
|
1173
1208
|
reason,
|
|
@@ -1182,7 +1217,7 @@ var GuildsAPI = class {
|
|
|
1182
1217
|
* @param options - The options for fetching the voice regions
|
|
1183
1218
|
*/
|
|
1184
1219
|
async getVoiceRegions(guildId, { auth, signal } = {}) {
|
|
1185
|
-
return this.rest.get(
|
|
1220
|
+
return this.rest.get(Routes5.guildVoiceRegions(guildId), {
|
|
1186
1221
|
auth,
|
|
1187
1222
|
signal
|
|
1188
1223
|
});
|
|
@@ -1195,7 +1230,7 @@ var GuildsAPI = class {
|
|
|
1195
1230
|
* @param options - The options for fetching the invites
|
|
1196
1231
|
*/
|
|
1197
1232
|
async getInvites(guildId, { auth, signal } = {}) {
|
|
1198
|
-
return this.rest.get(
|
|
1233
|
+
return this.rest.get(Routes5.guildInvites(guildId), { auth, signal });
|
|
1199
1234
|
}
|
|
1200
1235
|
/**
|
|
1201
1236
|
* Fetches the integrations for a guild
|
|
@@ -1205,7 +1240,7 @@ var GuildsAPI = class {
|
|
|
1205
1240
|
* @param options - The options for fetching the integrations
|
|
1206
1241
|
*/
|
|
1207
1242
|
async getIntegrations(guildId, { auth, signal } = {}) {
|
|
1208
|
-
return this.rest.get(
|
|
1243
|
+
return this.rest.get(Routes5.guildIntegrations(guildId), {
|
|
1209
1244
|
auth,
|
|
1210
1245
|
signal
|
|
1211
1246
|
});
|
|
@@ -1219,7 +1254,7 @@ var GuildsAPI = class {
|
|
|
1219
1254
|
* @param options - The options for deleting the integration
|
|
1220
1255
|
*/
|
|
1221
1256
|
async deleteIntegration(guildId, integrationId, { auth, reason, signal } = {}) {
|
|
1222
|
-
await this.rest.delete(
|
|
1257
|
+
await this.rest.delete(Routes5.guildIntegration(guildId, integrationId), { auth, reason, signal });
|
|
1223
1258
|
}
|
|
1224
1259
|
/**
|
|
1225
1260
|
* Fetches the widget settings for a guild
|
|
@@ -1229,7 +1264,7 @@ var GuildsAPI = class {
|
|
|
1229
1264
|
* @param options - The options for fetching the widget settings
|
|
1230
1265
|
*/
|
|
1231
1266
|
async getWidgetSettings(guildId, { auth, signal } = {}) {
|
|
1232
|
-
return this.rest.get(
|
|
1267
|
+
return this.rest.get(Routes5.guildWidgetSettings(guildId), {
|
|
1233
1268
|
auth,
|
|
1234
1269
|
signal
|
|
1235
1270
|
});
|
|
@@ -1243,7 +1278,7 @@ var GuildsAPI = class {
|
|
|
1243
1278
|
* @param options - The options for editing the widget settings
|
|
1244
1279
|
*/
|
|
1245
1280
|
async editWidgetSettings(guildId, body, { auth, reason, signal } = {}) {
|
|
1246
|
-
return this.rest.patch(
|
|
1281
|
+
return this.rest.patch(Routes5.guildWidgetSettings(guildId), {
|
|
1247
1282
|
auth,
|
|
1248
1283
|
reason,
|
|
1249
1284
|
body,
|
|
@@ -1258,7 +1293,7 @@ var GuildsAPI = class {
|
|
|
1258
1293
|
* @param options - The options for fetching the widget
|
|
1259
1294
|
*/
|
|
1260
1295
|
async getWidget(guildId, { auth, signal } = {}) {
|
|
1261
|
-
return this.rest.get(
|
|
1296
|
+
return this.rest.get(Routes5.guildWidgetJSON(guildId), { auth, signal });
|
|
1262
1297
|
}
|
|
1263
1298
|
/**
|
|
1264
1299
|
* Fetches the vanity url for a guild
|
|
@@ -1268,7 +1303,7 @@ var GuildsAPI = class {
|
|
|
1268
1303
|
* @param options - The options for fetching the vanity url
|
|
1269
1304
|
*/
|
|
1270
1305
|
async getVanityURL(guildId, { auth, signal } = {}) {
|
|
1271
|
-
return this.rest.get(
|
|
1306
|
+
return this.rest.get(Routes5.guildVanityUrl(guildId), { auth, signal });
|
|
1272
1307
|
}
|
|
1273
1308
|
/**
|
|
1274
1309
|
* Fetches the widget image for a guild
|
|
@@ -1279,7 +1314,7 @@ var GuildsAPI = class {
|
|
|
1279
1314
|
* @param options - The options for fetching the widget image
|
|
1280
1315
|
*/
|
|
1281
1316
|
async getWidgetImage(guildId, style, { auth, signal } = {}) {
|
|
1282
|
-
return this.rest.get(
|
|
1317
|
+
return this.rest.get(Routes5.guildWidgetImage(guildId), {
|
|
1283
1318
|
auth,
|
|
1284
1319
|
query: makeURLSearchParams3({ style }),
|
|
1285
1320
|
signal
|
|
@@ -1293,7 +1328,7 @@ var GuildsAPI = class {
|
|
|
1293
1328
|
* @param options - The options for fetching the welcome screen
|
|
1294
1329
|
*/
|
|
1295
1330
|
async getWelcomeScreen(guildId, { auth, signal } = {}) {
|
|
1296
|
-
return this.rest.get(
|
|
1331
|
+
return this.rest.get(Routes5.guildWelcomeScreen(guildId), {
|
|
1297
1332
|
auth,
|
|
1298
1333
|
signal
|
|
1299
1334
|
});
|
|
@@ -1307,7 +1342,7 @@ var GuildsAPI = class {
|
|
|
1307
1342
|
* @param options - The options for editing the welcome screen
|
|
1308
1343
|
*/
|
|
1309
1344
|
async editWelcomeScreen(guildId, body, { auth, reason, signal } = {}) {
|
|
1310
|
-
return this.rest.patch(
|
|
1345
|
+
return this.rest.patch(Routes5.guildWelcomeScreen(guildId), {
|
|
1311
1346
|
auth,
|
|
1312
1347
|
reason,
|
|
1313
1348
|
body,
|
|
@@ -1322,7 +1357,7 @@ var GuildsAPI = class {
|
|
|
1322
1357
|
* @param options - The options for fetching the emojis
|
|
1323
1358
|
*/
|
|
1324
1359
|
async getEmojis(guildId, { auth, signal } = {}) {
|
|
1325
|
-
return this.rest.get(
|
|
1360
|
+
return this.rest.get(Routes5.guildEmojis(guildId), { auth, signal });
|
|
1326
1361
|
}
|
|
1327
1362
|
/**
|
|
1328
1363
|
* Fetches an emoji for a guild
|
|
@@ -1333,7 +1368,7 @@ var GuildsAPI = class {
|
|
|
1333
1368
|
* @param options - The options for fetching the emoji
|
|
1334
1369
|
*/
|
|
1335
1370
|
async getEmoji(guildId, emojiId, { auth, signal } = {}) {
|
|
1336
|
-
return this.rest.get(
|
|
1371
|
+
return this.rest.get(Routes5.guildEmoji(guildId, emojiId), { auth, signal });
|
|
1337
1372
|
}
|
|
1338
1373
|
/**
|
|
1339
1374
|
* Creates a new emoji for a guild
|
|
@@ -1344,7 +1379,7 @@ var GuildsAPI = class {
|
|
|
1344
1379
|
* @param options - The options for creating the emoji
|
|
1345
1380
|
*/
|
|
1346
1381
|
async createEmoji(guildId, body, { auth, reason, signal } = {}) {
|
|
1347
|
-
return this.rest.post(
|
|
1382
|
+
return this.rest.post(Routes5.guildEmojis(guildId), {
|
|
1348
1383
|
auth,
|
|
1349
1384
|
reason,
|
|
1350
1385
|
body,
|
|
@@ -1361,7 +1396,7 @@ var GuildsAPI = class {
|
|
|
1361
1396
|
* @param options - The options for editing the emoji
|
|
1362
1397
|
*/
|
|
1363
1398
|
async editEmoji(guildId, emojiId, body, { auth, reason, signal } = {}) {
|
|
1364
|
-
return this.rest.patch(
|
|
1399
|
+
return this.rest.patch(Routes5.guildEmoji(guildId, emojiId), {
|
|
1365
1400
|
auth,
|
|
1366
1401
|
reason,
|
|
1367
1402
|
body,
|
|
@@ -1377,7 +1412,7 @@ var GuildsAPI = class {
|
|
|
1377
1412
|
* @param options - The options for deleting the emoji
|
|
1378
1413
|
*/
|
|
1379
1414
|
async deleteEmoji(guildId, emojiId, { auth, reason, signal } = {}) {
|
|
1380
|
-
await this.rest.delete(
|
|
1415
|
+
await this.rest.delete(Routes5.guildEmoji(guildId, emojiId), { auth, reason, signal });
|
|
1381
1416
|
}
|
|
1382
1417
|
/**
|
|
1383
1418
|
* Fetches all scheduled events for a guild
|
|
@@ -1388,7 +1423,7 @@ var GuildsAPI = class {
|
|
|
1388
1423
|
* @param options - The options for fetching the scheduled events
|
|
1389
1424
|
*/
|
|
1390
1425
|
async getScheduledEvents(guildId, query = {}, { auth, signal } = {}) {
|
|
1391
|
-
return this.rest.get(
|
|
1426
|
+
return this.rest.get(Routes5.guildScheduledEvents(guildId), {
|
|
1392
1427
|
auth,
|
|
1393
1428
|
query: makeURLSearchParams3(query),
|
|
1394
1429
|
signal
|
|
@@ -1403,7 +1438,7 @@ var GuildsAPI = class {
|
|
|
1403
1438
|
* @param options - The options for creating the scheduled event
|
|
1404
1439
|
*/
|
|
1405
1440
|
async createScheduledEvent(guildId, body, { auth, reason, signal } = {}) {
|
|
1406
|
-
return this.rest.post(
|
|
1441
|
+
return this.rest.post(Routes5.guildScheduledEvents(guildId), {
|
|
1407
1442
|
auth,
|
|
1408
1443
|
reason,
|
|
1409
1444
|
body,
|
|
@@ -1420,7 +1455,7 @@ var GuildsAPI = class {
|
|
|
1420
1455
|
* @param options - The options for fetching the scheduled event
|
|
1421
1456
|
*/
|
|
1422
1457
|
async getScheduledEvent(guildId, eventId, query = {}, { auth, signal } = {}) {
|
|
1423
|
-
return this.rest.get(
|
|
1458
|
+
return this.rest.get(Routes5.guildScheduledEvent(guildId, eventId), {
|
|
1424
1459
|
auth,
|
|
1425
1460
|
query: makeURLSearchParams3(query),
|
|
1426
1461
|
signal
|
|
@@ -1436,7 +1471,7 @@ var GuildsAPI = class {
|
|
|
1436
1471
|
* @param options - The options for editing the scheduled event
|
|
1437
1472
|
*/
|
|
1438
1473
|
async editScheduledEvent(guildId, eventId, body, { auth, reason, signal } = {}) {
|
|
1439
|
-
return this.rest.patch(
|
|
1474
|
+
return this.rest.patch(Routes5.guildScheduledEvent(guildId, eventId), {
|
|
1440
1475
|
auth,
|
|
1441
1476
|
reason,
|
|
1442
1477
|
body,
|
|
@@ -1452,7 +1487,7 @@ var GuildsAPI = class {
|
|
|
1452
1487
|
* @param options - The options for deleting the scheduled event
|
|
1453
1488
|
*/
|
|
1454
1489
|
async deleteScheduledEvent(guildId, eventId, { auth, reason, signal } = {}) {
|
|
1455
|
-
await this.rest.delete(
|
|
1490
|
+
await this.rest.delete(Routes5.guildScheduledEvent(guildId, eventId), { auth, reason, signal });
|
|
1456
1491
|
}
|
|
1457
1492
|
/**
|
|
1458
1493
|
* Gets all users that are interested in a scheduled event
|
|
@@ -1464,7 +1499,7 @@ var GuildsAPI = class {
|
|
|
1464
1499
|
* @param options - The options for fetching the scheduled event users
|
|
1465
1500
|
*/
|
|
1466
1501
|
async getScheduledEventUsers(guildId, eventId, query = {}, { auth, signal } = {}) {
|
|
1467
|
-
return this.rest.get(
|
|
1502
|
+
return this.rest.get(Routes5.guildScheduledEventUsers(guildId, eventId), {
|
|
1468
1503
|
auth,
|
|
1469
1504
|
query: makeURLSearchParams3(query),
|
|
1470
1505
|
signal
|
|
@@ -1478,7 +1513,7 @@ var GuildsAPI = class {
|
|
|
1478
1513
|
* @param options - The options for fetching the templates
|
|
1479
1514
|
*/
|
|
1480
1515
|
async getTemplates(guildId, { auth, signal } = {}) {
|
|
1481
|
-
return this.rest.get(
|
|
1516
|
+
return this.rest.get(Routes5.guildTemplates(guildId), { auth, signal });
|
|
1482
1517
|
}
|
|
1483
1518
|
/**
|
|
1484
1519
|
* Syncs a template for a guild
|
|
@@ -1489,7 +1524,7 @@ var GuildsAPI = class {
|
|
|
1489
1524
|
* @param options - The options for syncing the template
|
|
1490
1525
|
*/
|
|
1491
1526
|
async syncTemplate(guildId, templateCode, { auth, signal } = {}) {
|
|
1492
|
-
return this.rest.put(
|
|
1527
|
+
return this.rest.put(Routes5.guildTemplate(guildId, templateCode), {
|
|
1493
1528
|
auth,
|
|
1494
1529
|
signal
|
|
1495
1530
|
});
|
|
@@ -1504,7 +1539,7 @@ var GuildsAPI = class {
|
|
|
1504
1539
|
* @param options - The options for editing the template
|
|
1505
1540
|
*/
|
|
1506
1541
|
async editTemplate(guildId, templateCode, body, { auth, signal } = {}) {
|
|
1507
|
-
return this.rest.patch(
|
|
1542
|
+
return this.rest.patch(Routes5.guildTemplate(guildId, templateCode), {
|
|
1508
1543
|
auth,
|
|
1509
1544
|
body,
|
|
1510
1545
|
signal
|
|
@@ -1519,7 +1554,7 @@ var GuildsAPI = class {
|
|
|
1519
1554
|
* @param options - The options for deleting the template
|
|
1520
1555
|
*/
|
|
1521
1556
|
async deleteTemplate(guildId, templateCode, { auth, signal } = {}) {
|
|
1522
|
-
await this.rest.delete(
|
|
1557
|
+
await this.rest.delete(Routes5.guildTemplate(guildId, templateCode), { auth, signal });
|
|
1523
1558
|
}
|
|
1524
1559
|
/**
|
|
1525
1560
|
* Fetches all the stickers for a guild
|
|
@@ -1529,7 +1564,7 @@ var GuildsAPI = class {
|
|
|
1529
1564
|
* @param options - The options for fetching the stickers
|
|
1530
1565
|
*/
|
|
1531
1566
|
async getStickers(guildId, { auth, signal } = {}) {
|
|
1532
|
-
return this.rest.get(
|
|
1567
|
+
return this.rest.get(Routes5.guildStickers(guildId), { auth, signal });
|
|
1533
1568
|
}
|
|
1534
1569
|
/**
|
|
1535
1570
|
* Fetches a sticker for a guild
|
|
@@ -1540,7 +1575,7 @@ var GuildsAPI = class {
|
|
|
1540
1575
|
* @param options - The options for fetching the sticker
|
|
1541
1576
|
*/
|
|
1542
1577
|
async getSticker(guildId, stickerId, { auth, signal } = {}) {
|
|
1543
|
-
return this.rest.get(
|
|
1578
|
+
return this.rest.get(Routes5.guildSticker(guildId, stickerId), {
|
|
1544
1579
|
auth,
|
|
1545
1580
|
signal
|
|
1546
1581
|
});
|
|
@@ -1555,7 +1590,7 @@ var GuildsAPI = class {
|
|
|
1555
1590
|
*/
|
|
1556
1591
|
async createSticker(guildId, { file, ...body }, { auth, reason, signal } = {}) {
|
|
1557
1592
|
const fileData = { ...file, key: "file" };
|
|
1558
|
-
return this.rest.post(
|
|
1593
|
+
return this.rest.post(Routes5.guildStickers(guildId), {
|
|
1559
1594
|
auth,
|
|
1560
1595
|
appendToFormData: true,
|
|
1561
1596
|
body,
|
|
@@ -1574,7 +1609,7 @@ var GuildsAPI = class {
|
|
|
1574
1609
|
* @param options - The options for editing the sticker
|
|
1575
1610
|
*/
|
|
1576
1611
|
async editSticker(guildId, stickerId, body, { auth, reason, signal } = {}) {
|
|
1577
|
-
return this.rest.patch(
|
|
1612
|
+
return this.rest.patch(Routes5.guildSticker(guildId, stickerId), {
|
|
1578
1613
|
auth,
|
|
1579
1614
|
reason,
|
|
1580
1615
|
body,
|
|
@@ -1590,7 +1625,7 @@ var GuildsAPI = class {
|
|
|
1590
1625
|
* @param options - The options for deleting the sticker
|
|
1591
1626
|
*/
|
|
1592
1627
|
async deleteSticker(guildId, stickerId, { auth, reason, signal } = {}) {
|
|
1593
|
-
await this.rest.delete(
|
|
1628
|
+
await this.rest.delete(Routes5.guildSticker(guildId, stickerId), { auth, reason, signal });
|
|
1594
1629
|
}
|
|
1595
1630
|
/**
|
|
1596
1631
|
* Fetches the audit logs for a guild
|
|
@@ -1601,7 +1636,7 @@ var GuildsAPI = class {
|
|
|
1601
1636
|
* @param options - The options for fetching the audit logs
|
|
1602
1637
|
*/
|
|
1603
1638
|
async getAuditLogs(guildId, query = {}, { auth, signal } = {}) {
|
|
1604
|
-
return this.rest.get(
|
|
1639
|
+
return this.rest.get(Routes5.guildAuditLog(guildId), {
|
|
1605
1640
|
auth,
|
|
1606
1641
|
query: makeURLSearchParams3(query),
|
|
1607
1642
|
signal
|
|
@@ -1615,7 +1650,7 @@ var GuildsAPI = class {
|
|
|
1615
1650
|
* @param options - The options for fetching the auto moderation rules
|
|
1616
1651
|
*/
|
|
1617
1652
|
async getAutoModerationRules(guildId, { auth, signal } = {}) {
|
|
1618
|
-
return this.rest.get(
|
|
1653
|
+
return this.rest.get(Routes5.guildAutoModerationRules(guildId), {
|
|
1619
1654
|
auth,
|
|
1620
1655
|
signal
|
|
1621
1656
|
});
|
|
@@ -1629,7 +1664,7 @@ var GuildsAPI = class {
|
|
|
1629
1664
|
* @param options - The options for fetching the auto moderation rule
|
|
1630
1665
|
*/
|
|
1631
1666
|
async getAutoModerationRule(guildId, ruleId, { auth, signal } = {}) {
|
|
1632
|
-
return this.rest.get(
|
|
1667
|
+
return this.rest.get(Routes5.guildAutoModerationRule(guildId, ruleId), {
|
|
1633
1668
|
auth,
|
|
1634
1669
|
signal
|
|
1635
1670
|
});
|
|
@@ -1643,7 +1678,7 @@ var GuildsAPI = class {
|
|
|
1643
1678
|
* @param options - The options for creating the auto moderation rule
|
|
1644
1679
|
*/
|
|
1645
1680
|
async createAutoModerationRule(guildId, body, { auth, reason, signal } = {}) {
|
|
1646
|
-
return this.rest.post(
|
|
1681
|
+
return this.rest.post(Routes5.guildAutoModerationRules(guildId), {
|
|
1647
1682
|
auth,
|
|
1648
1683
|
reason,
|
|
1649
1684
|
body,
|
|
@@ -1660,7 +1695,7 @@ var GuildsAPI = class {
|
|
|
1660
1695
|
* @param options - The options for editing the auto moderation rule
|
|
1661
1696
|
*/
|
|
1662
1697
|
async editAutoModerationRule(guildId, ruleId, body, { auth, reason, signal } = {}) {
|
|
1663
|
-
return this.rest.patch(
|
|
1698
|
+
return this.rest.patch(Routes5.guildAutoModerationRule(guildId, ruleId), {
|
|
1664
1699
|
auth,
|
|
1665
1700
|
reason,
|
|
1666
1701
|
body,
|
|
@@ -1676,7 +1711,7 @@ var GuildsAPI = class {
|
|
|
1676
1711
|
* @param options - The options for deleting the auto moderation rule
|
|
1677
1712
|
*/
|
|
1678
1713
|
async deleteAutoModerationRule(guildId, ruleId, { auth, reason, signal } = {}) {
|
|
1679
|
-
await this.rest.delete(
|
|
1714
|
+
await this.rest.delete(Routes5.guildAutoModerationRule(guildId, ruleId), { auth, reason, signal });
|
|
1680
1715
|
}
|
|
1681
1716
|
/**
|
|
1682
1717
|
* Fetches a guild member
|
|
@@ -1687,7 +1722,7 @@ var GuildsAPI = class {
|
|
|
1687
1722
|
* @param options - The options for fetching the guild member
|
|
1688
1723
|
*/
|
|
1689
1724
|
async getMember(guildId, userId, { auth, signal } = {}) {
|
|
1690
|
-
return this.rest.get(
|
|
1725
|
+
return this.rest.get(Routes5.guildMember(guildId, userId), { auth, signal });
|
|
1691
1726
|
}
|
|
1692
1727
|
/**
|
|
1693
1728
|
* Searches for guild members
|
|
@@ -1698,7 +1733,7 @@ var GuildsAPI = class {
|
|
|
1698
1733
|
* @param options - The options for searching for guild members
|
|
1699
1734
|
*/
|
|
1700
1735
|
async searchForMembers(guildId, query, { auth, signal } = {}) {
|
|
1701
|
-
return this.rest.get(
|
|
1736
|
+
return this.rest.get(Routes5.guildMembersSearch(guildId), {
|
|
1702
1737
|
auth,
|
|
1703
1738
|
query: makeURLSearchParams3(query),
|
|
1704
1739
|
signal
|
|
@@ -1714,7 +1749,7 @@ var GuildsAPI = class {
|
|
|
1714
1749
|
* @param options - The options for editing the guild member
|
|
1715
1750
|
*/
|
|
1716
1751
|
async editMember(guildId, userId, body = {}, { auth, reason, signal } = {}) {
|
|
1717
|
-
return this.rest.patch(
|
|
1752
|
+
return this.rest.patch(Routes5.guildMember(guildId, userId), {
|
|
1718
1753
|
auth,
|
|
1719
1754
|
reason,
|
|
1720
1755
|
body,
|
|
@@ -1730,7 +1765,7 @@ var GuildsAPI = class {
|
|
|
1730
1765
|
* @param options - The options for removing the guild member
|
|
1731
1766
|
*/
|
|
1732
1767
|
async removeMember(guildId, userId, { auth, reason, signal } = {}) {
|
|
1733
|
-
return this.rest.delete(
|
|
1768
|
+
return this.rest.delete(Routes5.guildMember(guildId, userId), { auth, reason, signal });
|
|
1734
1769
|
}
|
|
1735
1770
|
/**
|
|
1736
1771
|
* Adds a role to a guild member
|
|
@@ -1742,7 +1777,7 @@ var GuildsAPI = class {
|
|
|
1742
1777
|
* @param options - The options for adding a role to a guild member
|
|
1743
1778
|
*/
|
|
1744
1779
|
async addRoleToMember(guildId, userId, roleId, { auth, reason, signal } = {}) {
|
|
1745
|
-
await this.rest.put(
|
|
1780
|
+
await this.rest.put(Routes5.guildMemberRole(guildId, userId, roleId), { auth, reason, signal });
|
|
1746
1781
|
}
|
|
1747
1782
|
/**
|
|
1748
1783
|
* Removes a role from a guild member
|
|
@@ -1754,7 +1789,7 @@ var GuildsAPI = class {
|
|
|
1754
1789
|
* @param options - The options for removing a role from a guild member
|
|
1755
1790
|
*/
|
|
1756
1791
|
async removeRoleFromMember(guildId, userId, roleId, { auth, reason, signal } = {}) {
|
|
1757
|
-
await this.rest.delete(
|
|
1792
|
+
await this.rest.delete(Routes5.guildMemberRole(guildId, userId, roleId), { auth, reason, signal });
|
|
1758
1793
|
}
|
|
1759
1794
|
/**
|
|
1760
1795
|
* Fetches a guild template
|
|
@@ -1764,7 +1799,7 @@ var GuildsAPI = class {
|
|
|
1764
1799
|
* @param options - The options for fetching the guild template
|
|
1765
1800
|
*/
|
|
1766
1801
|
async getTemplate(templateCode, { auth, signal } = {}) {
|
|
1767
|
-
return this.rest.get(
|
|
1802
|
+
return this.rest.get(Routes5.template(templateCode), { auth, signal });
|
|
1768
1803
|
}
|
|
1769
1804
|
/**
|
|
1770
1805
|
* Creates a new template
|
|
@@ -1775,7 +1810,7 @@ var GuildsAPI = class {
|
|
|
1775
1810
|
* @param options - The options for creating the template
|
|
1776
1811
|
*/
|
|
1777
1812
|
async createTemplate(guildId, body, { auth, signal } = {}) {
|
|
1778
|
-
return this.rest.post(
|
|
1813
|
+
return this.rest.post(Routes5.guildTemplates(guildId), {
|
|
1779
1814
|
auth,
|
|
1780
1815
|
body,
|
|
1781
1816
|
signal
|
|
@@ -1789,7 +1824,7 @@ var GuildsAPI = class {
|
|
|
1789
1824
|
* @param options - The options for fetching the webhooks
|
|
1790
1825
|
*/
|
|
1791
1826
|
async getWebhooks(id, { auth, signal } = {}) {
|
|
1792
|
-
return this.rest.get(
|
|
1827
|
+
return this.rest.get(Routes5.guildWebhooks(id), { auth, signal });
|
|
1793
1828
|
}
|
|
1794
1829
|
/**
|
|
1795
1830
|
* Fetches a guild onboarding
|
|
@@ -1799,7 +1834,7 @@ var GuildsAPI = class {
|
|
|
1799
1834
|
* @param options - The options for fetching the guild onboarding
|
|
1800
1835
|
*/
|
|
1801
1836
|
async getOnboarding(guildId, { auth, signal } = {}) {
|
|
1802
|
-
return this.rest.get(
|
|
1837
|
+
return this.rest.get(Routes5.guildOnboarding(guildId), { auth, signal });
|
|
1803
1838
|
}
|
|
1804
1839
|
/**
|
|
1805
1840
|
* Edits a guild onboarding
|
|
@@ -1810,7 +1845,7 @@ var GuildsAPI = class {
|
|
|
1810
1845
|
* @param options - The options for editing the guild onboarding
|
|
1811
1846
|
*/
|
|
1812
1847
|
async editOnboarding(guildId, body, { auth, reason, signal } = {}) {
|
|
1813
|
-
return this.rest.put(
|
|
1848
|
+
return this.rest.put(Routes5.guildOnboarding(guildId), {
|
|
1814
1849
|
auth,
|
|
1815
1850
|
reason,
|
|
1816
1851
|
body,
|
|
@@ -1825,7 +1860,7 @@ var GuildsAPI = class {
|
|
|
1825
1860
|
* @param options - The options for fetching the soundboard sounds
|
|
1826
1861
|
*/
|
|
1827
1862
|
async getSoundboardSounds(guildId, { auth, signal } = {}) {
|
|
1828
|
-
return this.rest.get(
|
|
1863
|
+
return this.rest.get(Routes5.guildSoundboardSounds(guildId), {
|
|
1829
1864
|
auth,
|
|
1830
1865
|
signal
|
|
1831
1866
|
});
|
|
@@ -1839,7 +1874,7 @@ var GuildsAPI = class {
|
|
|
1839
1874
|
* @param options - The options for fetching the soundboard sound
|
|
1840
1875
|
*/
|
|
1841
1876
|
async getSoundboardSound(guildId, soundId, { auth, signal } = {}) {
|
|
1842
|
-
return this.rest.get(
|
|
1877
|
+
return this.rest.get(Routes5.guildSoundboardSound(guildId, soundId), {
|
|
1843
1878
|
auth,
|
|
1844
1879
|
signal
|
|
1845
1880
|
});
|
|
@@ -1853,7 +1888,7 @@ var GuildsAPI = class {
|
|
|
1853
1888
|
* @param options - The options for creating the soundboard sound
|
|
1854
1889
|
*/
|
|
1855
1890
|
async createSoundboardSound(guildId, body, { auth, reason, signal } = {}) {
|
|
1856
|
-
return this.rest.post(
|
|
1891
|
+
return this.rest.post(Routes5.guildSoundboardSounds(guildId), {
|
|
1857
1892
|
auth,
|
|
1858
1893
|
body,
|
|
1859
1894
|
reason,
|
|
@@ -1870,7 +1905,7 @@ var GuildsAPI = class {
|
|
|
1870
1905
|
* @param options - The options for editing the soundboard sound
|
|
1871
1906
|
*/
|
|
1872
1907
|
async editSoundboardSound(guildId, soundId, body, { auth, reason, signal } = {}) {
|
|
1873
|
-
return this.rest.patch(
|
|
1908
|
+
return this.rest.patch(Routes5.guildSoundboardSound(guildId, soundId), {
|
|
1874
1909
|
auth,
|
|
1875
1910
|
body,
|
|
1876
1911
|
reason,
|
|
@@ -1886,7 +1921,7 @@ var GuildsAPI = class {
|
|
|
1886
1921
|
* @param options - The options for deleting the soundboard sound
|
|
1887
1922
|
*/
|
|
1888
1923
|
async deleteSoundboardSound(guildId, soundId, { auth, reason, signal } = {}) {
|
|
1889
|
-
await this.rest.delete(
|
|
1924
|
+
await this.rest.delete(Routes5.guildSoundboardSound(guildId, soundId), { auth, reason, signal });
|
|
1890
1925
|
}
|
|
1891
1926
|
};
|
|
1892
1927
|
|
|
@@ -1894,7 +1929,7 @@ var GuildsAPI = class {
|
|
|
1894
1929
|
import { makeURLSearchParams as makeURLSearchParams4 } from "@discordjs/rest";
|
|
1895
1930
|
import {
|
|
1896
1931
|
InteractionResponseType,
|
|
1897
|
-
Routes as
|
|
1932
|
+
Routes as Routes6
|
|
1898
1933
|
} from "discord-api-types/v10";
|
|
1899
1934
|
var InteractionsAPI = class {
|
|
1900
1935
|
constructor(rest, webhooks) {
|
|
@@ -1905,7 +1940,7 @@ var InteractionsAPI = class {
|
|
|
1905
1940
|
__name(this, "InteractionsAPI");
|
|
1906
1941
|
}
|
|
1907
1942
|
async reply(interactionId, interactionToken, { files, with_response, ...data }, { signal } = {}) {
|
|
1908
|
-
const response = await this.rest.post(
|
|
1943
|
+
const response = await this.rest.post(Routes6.interactionCallback(interactionId, interactionToken), {
|
|
1909
1944
|
query: makeURLSearchParams4({ with_response }),
|
|
1910
1945
|
files,
|
|
1911
1946
|
auth: false,
|
|
@@ -1918,7 +1953,7 @@ var InteractionsAPI = class {
|
|
|
1918
1953
|
return with_response ? response : void 0;
|
|
1919
1954
|
}
|
|
1920
1955
|
async defer(interactionId, interactionToken, { with_response, ...data } = {}, { signal } = {}) {
|
|
1921
|
-
const response = await this.rest.post(
|
|
1956
|
+
const response = await this.rest.post(Routes6.interactionCallback(interactionId, interactionToken), {
|
|
1922
1957
|
query: makeURLSearchParams4({ with_response }),
|
|
1923
1958
|
auth: false,
|
|
1924
1959
|
body: {
|
|
@@ -1930,7 +1965,7 @@ var InteractionsAPI = class {
|
|
|
1930
1965
|
return with_response ? response : void 0;
|
|
1931
1966
|
}
|
|
1932
1967
|
async deferMessageUpdate(interactionId, interactionToken, { with_response } = {}, { signal } = {}) {
|
|
1933
|
-
const response = await this.rest.post(
|
|
1968
|
+
const response = await this.rest.post(Routes6.interactionCallback(interactionId, interactionToken), {
|
|
1934
1969
|
query: makeURLSearchParams4({ with_response }),
|
|
1935
1970
|
auth: false,
|
|
1936
1971
|
body: {
|
|
@@ -1999,7 +2034,7 @@ var InteractionsAPI = class {
|
|
|
1999
2034
|
await this.webhooks.deleteMessage(applicationId, interactionToken, messageId ?? "@original", {}, { signal });
|
|
2000
2035
|
}
|
|
2001
2036
|
async updateMessage(interactionId, interactionToken, { files, with_response, ...data }, { signal } = {}) {
|
|
2002
|
-
const response = await this.rest.post(
|
|
2037
|
+
const response = await this.rest.post(Routes6.interactionCallback(interactionId, interactionToken), {
|
|
2003
2038
|
query: makeURLSearchParams4({ with_response }),
|
|
2004
2039
|
files,
|
|
2005
2040
|
auth: false,
|
|
@@ -2012,7 +2047,7 @@ var InteractionsAPI = class {
|
|
|
2012
2047
|
return with_response ? response : void 0;
|
|
2013
2048
|
}
|
|
2014
2049
|
async createAutocompleteResponse(interactionId, interactionToken, { with_response, ...data }, { signal } = {}) {
|
|
2015
|
-
const response = await this.rest.post(
|
|
2050
|
+
const response = await this.rest.post(Routes6.interactionCallback(interactionId, interactionToken), {
|
|
2016
2051
|
query: makeURLSearchParams4({ with_response }),
|
|
2017
2052
|
auth: false,
|
|
2018
2053
|
body: {
|
|
@@ -2024,7 +2059,7 @@ var InteractionsAPI = class {
|
|
|
2024
2059
|
return with_response ? response : void 0;
|
|
2025
2060
|
}
|
|
2026
2061
|
async createModal(interactionId, interactionToken, { with_response, ...data }, { signal } = {}) {
|
|
2027
|
-
const response = await this.rest.post(
|
|
2062
|
+
const response = await this.rest.post(Routes6.interactionCallback(interactionId, interactionToken), {
|
|
2028
2063
|
query: makeURLSearchParams4({ with_response }),
|
|
2029
2064
|
auth: false,
|
|
2030
2065
|
body: {
|
|
@@ -2036,7 +2071,7 @@ var InteractionsAPI = class {
|
|
|
2036
2071
|
return with_response ? response : void 0;
|
|
2037
2072
|
}
|
|
2038
2073
|
async launchActivity(interactionId, interactionToken, { with_response } = {}, { signal } = {}) {
|
|
2039
|
-
const response = await this.rest.post(
|
|
2074
|
+
const response = await this.rest.post(Routes6.interactionCallback(interactionId, interactionToken), {
|
|
2040
2075
|
query: makeURLSearchParams4({ with_response }),
|
|
2041
2076
|
auth: false,
|
|
2042
2077
|
body: {
|
|
@@ -2050,7 +2085,7 @@ var InteractionsAPI = class {
|
|
|
2050
2085
|
|
|
2051
2086
|
// src/api/invite.ts
|
|
2052
2087
|
import { makeURLSearchParams as makeURLSearchParams5 } from "@discordjs/rest";
|
|
2053
|
-
import { Routes as
|
|
2088
|
+
import { Routes as Routes7 } from "discord-api-types/v10";
|
|
2054
2089
|
var InvitesAPI = class {
|
|
2055
2090
|
constructor(rest) {
|
|
2056
2091
|
this.rest = rest;
|
|
@@ -2067,7 +2102,7 @@ var InvitesAPI = class {
|
|
|
2067
2102
|
* @param options - The options for fetching the invite
|
|
2068
2103
|
*/
|
|
2069
2104
|
async get(code, query = {}, { auth, signal } = {}) {
|
|
2070
|
-
return this.rest.get(
|
|
2105
|
+
return this.rest.get(Routes7.invite(code), {
|
|
2071
2106
|
auth,
|
|
2072
2107
|
query: makeURLSearchParams5(query),
|
|
2073
2108
|
signal
|
|
@@ -2081,14 +2116,14 @@ var InvitesAPI = class {
|
|
|
2081
2116
|
* @param options - The options for deleting the invite
|
|
2082
2117
|
*/
|
|
2083
2118
|
async delete(code, { auth, reason, signal } = {}) {
|
|
2084
|
-
await this.rest.delete(
|
|
2119
|
+
await this.rest.delete(Routes7.invite(code), { auth, reason, signal });
|
|
2085
2120
|
}
|
|
2086
2121
|
};
|
|
2087
2122
|
|
|
2088
2123
|
// src/api/monetization.ts
|
|
2089
2124
|
import { makeURLSearchParams as makeURLSearchParams6 } from "@discordjs/rest";
|
|
2090
2125
|
import {
|
|
2091
|
-
Routes as
|
|
2126
|
+
Routes as Routes8
|
|
2092
2127
|
} from "discord-api-types/v10";
|
|
2093
2128
|
var MonetizationAPI = class {
|
|
2094
2129
|
constructor(rest) {
|
|
@@ -2105,7 +2140,7 @@ var MonetizationAPI = class {
|
|
|
2105
2140
|
* @param options - The options for fetching the SKUs.
|
|
2106
2141
|
*/
|
|
2107
2142
|
async getSKUs(applicationId, { auth, signal } = {}) {
|
|
2108
|
-
return this.rest.get(
|
|
2143
|
+
return this.rest.get(Routes8.skus(applicationId), { auth, signal });
|
|
2109
2144
|
}
|
|
2110
2145
|
/**
|
|
2111
2146
|
* Fetches subscriptions for an SKU.
|
|
@@ -2116,7 +2151,7 @@ var MonetizationAPI = class {
|
|
|
2116
2151
|
* @param options - The options for fetching subscriptions
|
|
2117
2152
|
*/
|
|
2118
2153
|
async getSKUSubscriptions(skuId, query = {}, { auth, signal } = {}) {
|
|
2119
|
-
return this.rest.get(
|
|
2154
|
+
return this.rest.get(Routes8.skuSubscriptions(skuId), {
|
|
2120
2155
|
auth,
|
|
2121
2156
|
signal,
|
|
2122
2157
|
query: makeURLSearchParams6(query)
|
|
@@ -2131,7 +2166,7 @@ var MonetizationAPI = class {
|
|
|
2131
2166
|
* @param options - The options for fetching the subscription
|
|
2132
2167
|
*/
|
|
2133
2168
|
async getSKUSubscription(skuId, subscriptionId, { auth, signal } = {}) {
|
|
2134
|
-
return this.rest.get(
|
|
2169
|
+
return this.rest.get(Routes8.skuSubscription(skuId, subscriptionId), {
|
|
2135
2170
|
auth,
|
|
2136
2171
|
signal
|
|
2137
2172
|
});
|
|
@@ -2145,7 +2180,7 @@ var MonetizationAPI = class {
|
|
|
2145
2180
|
* @param options - The options for fetching entitlements
|
|
2146
2181
|
*/
|
|
2147
2182
|
async getEntitlements(applicationId, query = {}, { auth, signal } = {}) {
|
|
2148
|
-
return this.rest.get(
|
|
2183
|
+
return this.rest.get(Routes8.entitlements(applicationId), {
|
|
2149
2184
|
auth,
|
|
2150
2185
|
signal,
|
|
2151
2186
|
query: makeURLSearchParams6(query)
|
|
@@ -2160,7 +2195,7 @@ var MonetizationAPI = class {
|
|
|
2160
2195
|
* @param options - The options for fetching the entitlement
|
|
2161
2196
|
*/
|
|
2162
2197
|
async getEntitlement(applicationId, entitlementId, { auth, signal } = {}) {
|
|
2163
|
-
return this.rest.get(
|
|
2198
|
+
return this.rest.get(Routes8.entitlement(applicationId, entitlementId), {
|
|
2164
2199
|
auth,
|
|
2165
2200
|
signal
|
|
2166
2201
|
});
|
|
@@ -2174,7 +2209,7 @@ var MonetizationAPI = class {
|
|
|
2174
2209
|
* @param options - The options for creating the entitlement
|
|
2175
2210
|
*/
|
|
2176
2211
|
async createTestEntitlement(applicationId, body, { auth, signal } = {}) {
|
|
2177
|
-
return this.rest.post(
|
|
2212
|
+
return this.rest.post(Routes8.entitlements(applicationId), {
|
|
2178
2213
|
auth,
|
|
2179
2214
|
body,
|
|
2180
2215
|
signal
|
|
@@ -2189,7 +2224,7 @@ var MonetizationAPI = class {
|
|
|
2189
2224
|
* @param options - The options for deleting the entitlement
|
|
2190
2225
|
*/
|
|
2191
2226
|
async deleteTestEntitlement(applicationId, entitlementId, { auth, signal } = {}) {
|
|
2192
|
-
await this.rest.delete(
|
|
2227
|
+
await this.rest.delete(Routes8.entitlement(applicationId, entitlementId), { auth, signal });
|
|
2193
2228
|
}
|
|
2194
2229
|
/**
|
|
2195
2230
|
* Marks a given entitlement for the user as consumed. Only available for One-Time Purchase consumable SKUs.
|
|
@@ -2200,14 +2235,14 @@ var MonetizationAPI = class {
|
|
|
2200
2235
|
* @param options - The options for consuming the entitlement
|
|
2201
2236
|
*/
|
|
2202
2237
|
async consumeEntitlement(applicationId, entitlementId, { auth, signal } = {}) {
|
|
2203
|
-
await this.rest.post(
|
|
2238
|
+
await this.rest.post(Routes8.consumeEntitlement(applicationId, entitlementId), { auth, signal });
|
|
2204
2239
|
}
|
|
2205
2240
|
};
|
|
2206
2241
|
|
|
2207
2242
|
// src/api/oauth2.ts
|
|
2208
2243
|
import { makeURLSearchParams as makeURLSearchParams7 } from "@discordjs/rest";
|
|
2209
2244
|
import {
|
|
2210
|
-
Routes as
|
|
2245
|
+
Routes as Routes9,
|
|
2211
2246
|
RouteBases
|
|
2212
2247
|
} from "discord-api-types/v10";
|
|
2213
2248
|
var OAuth2API = class {
|
|
@@ -2224,7 +2259,7 @@ var OAuth2API = class {
|
|
|
2224
2259
|
* @param options - The options for creating the authorization URL
|
|
2225
2260
|
*/
|
|
2226
2261
|
generateAuthorizationURL(options) {
|
|
2227
|
-
const url = new URL(`${RouteBases.api}${
|
|
2262
|
+
const url = new URL(`${RouteBases.api}${Routes9.oauth2Authorization()}`);
|
|
2228
2263
|
url.search = makeURLSearchParams7(options).toString();
|
|
2229
2264
|
return url.toString();
|
|
2230
2265
|
}
|
|
@@ -2236,7 +2271,7 @@ var OAuth2API = class {
|
|
|
2236
2271
|
* @param options - The options for the token exchange request
|
|
2237
2272
|
*/
|
|
2238
2273
|
async tokenExchange(body, { signal } = {}) {
|
|
2239
|
-
return this.rest.post(
|
|
2274
|
+
return this.rest.post(Routes9.oauth2TokenExchange(), {
|
|
2240
2275
|
body: makeURLSearchParams7(body),
|
|
2241
2276
|
passThroughBody: true,
|
|
2242
2277
|
headers: {
|
|
@@ -2254,7 +2289,7 @@ var OAuth2API = class {
|
|
|
2254
2289
|
* @param options - The options for the refresh token request
|
|
2255
2290
|
*/
|
|
2256
2291
|
async refreshToken(body, { signal } = {}) {
|
|
2257
|
-
return this.rest.post(
|
|
2292
|
+
return this.rest.post(Routes9.oauth2TokenExchange(), {
|
|
2258
2293
|
body: makeURLSearchParams7(body),
|
|
2259
2294
|
passThroughBody: true,
|
|
2260
2295
|
headers: {
|
|
@@ -2274,7 +2309,7 @@ var OAuth2API = class {
|
|
|
2274
2309
|
* @param options - The options for the client credentials grant request
|
|
2275
2310
|
*/
|
|
2276
2311
|
async getToken(body, { signal } = {}) {
|
|
2277
|
-
return this.rest.post(
|
|
2312
|
+
return this.rest.post(Routes9.oauth2TokenExchange(), {
|
|
2278
2313
|
body: makeURLSearchParams7(body),
|
|
2279
2314
|
passThroughBody: true,
|
|
2280
2315
|
headers: {
|
|
@@ -2291,7 +2326,7 @@ var OAuth2API = class {
|
|
|
2291
2326
|
* @param options - The options for the current bot application information request
|
|
2292
2327
|
*/
|
|
2293
2328
|
async getCurrentBotApplicationInformation({ auth, signal } = {}) {
|
|
2294
|
-
return this.rest.get(
|
|
2329
|
+
return this.rest.get(Routes9.oauth2CurrentApplication(), {
|
|
2295
2330
|
auth,
|
|
2296
2331
|
signal
|
|
2297
2332
|
});
|
|
@@ -2303,7 +2338,7 @@ var OAuth2API = class {
|
|
|
2303
2338
|
* @param options - The options for the current authorization information request
|
|
2304
2339
|
*/
|
|
2305
2340
|
async getCurrentAuthorizationInformation({ auth, signal } = {}) {
|
|
2306
|
-
return this.rest.get(
|
|
2341
|
+
return this.rest.get(Routes9.oauth2CurrentAuthorization(), {
|
|
2307
2342
|
auth,
|
|
2308
2343
|
signal
|
|
2309
2344
|
});
|
|
@@ -2318,7 +2353,7 @@ var OAuth2API = class {
|
|
|
2318
2353
|
* @param options - The options for the token revocation request
|
|
2319
2354
|
*/
|
|
2320
2355
|
async revokeToken(applicationId, applicationSecret, body, { signal } = {}) {
|
|
2321
|
-
await this.rest.post(
|
|
2356
|
+
await this.rest.post(Routes9.oauth2TokenRevocation(), {
|
|
2322
2357
|
body: makeURLSearchParams7(body),
|
|
2323
2358
|
passThroughBody: true,
|
|
2324
2359
|
headers: {
|
|
@@ -2334,7 +2369,7 @@ var OAuth2API = class {
|
|
|
2334
2369
|
// src/api/poll.ts
|
|
2335
2370
|
import { makeURLSearchParams as makeURLSearchParams8 } from "@discordjs/rest";
|
|
2336
2371
|
import {
|
|
2337
|
-
Routes as
|
|
2372
|
+
Routes as Routes10
|
|
2338
2373
|
} from "discord-api-types/v10";
|
|
2339
2374
|
var PollAPI = class {
|
|
2340
2375
|
constructor(rest) {
|
|
@@ -2354,7 +2389,7 @@ var PollAPI = class {
|
|
|
2354
2389
|
* @param options - The options for getting the list of voters
|
|
2355
2390
|
*/
|
|
2356
2391
|
async getAnswerVoters(channelId, messageId, answerId, query = {}, { auth, signal } = {}) {
|
|
2357
|
-
return this.rest.get(
|
|
2392
|
+
return this.rest.get(Routes10.pollAnswerVoters(channelId, messageId, answerId), {
|
|
2358
2393
|
auth,
|
|
2359
2394
|
signal,
|
|
2360
2395
|
query: makeURLSearchParams8(query)
|
|
@@ -2369,7 +2404,7 @@ var PollAPI = class {
|
|
|
2369
2404
|
* @param options - The options for expiring the poll
|
|
2370
2405
|
*/
|
|
2371
2406
|
async expirePoll(channelId, messageId, { auth, signal } = {}) {
|
|
2372
|
-
return this.rest.post(
|
|
2407
|
+
return this.rest.post(Routes10.expirePoll(channelId, messageId), {
|
|
2373
2408
|
auth,
|
|
2374
2409
|
signal
|
|
2375
2410
|
});
|
|
@@ -2378,7 +2413,7 @@ var PollAPI = class {
|
|
|
2378
2413
|
|
|
2379
2414
|
// src/api/roleConnections.ts
|
|
2380
2415
|
import {
|
|
2381
|
-
Routes as
|
|
2416
|
+
Routes as Routes11
|
|
2382
2417
|
} from "discord-api-types/v10";
|
|
2383
2418
|
var RoleConnectionsAPI = class {
|
|
2384
2419
|
constructor(rest) {
|
|
@@ -2395,7 +2430,7 @@ var RoleConnectionsAPI = class {
|
|
|
2395
2430
|
* @param options - The options for fetching the role connection metadata records
|
|
2396
2431
|
*/
|
|
2397
2432
|
async getMetadataRecords(applicationId, { auth, signal } = {}) {
|
|
2398
|
-
return this.rest.get(
|
|
2433
|
+
return this.rest.get(Routes11.applicationRoleConnectionMetadata(applicationId), {
|
|
2399
2434
|
auth,
|
|
2400
2435
|
signal
|
|
2401
2436
|
});
|
|
@@ -2409,7 +2444,7 @@ var RoleConnectionsAPI = class {
|
|
|
2409
2444
|
* @param options - The options for updating the role connection metadata records
|
|
2410
2445
|
*/
|
|
2411
2446
|
async updateMetadataRecords(applicationId, body, { auth, signal } = {}) {
|
|
2412
|
-
return this.rest.put(
|
|
2447
|
+
return this.rest.put(Routes11.applicationRoleConnectionMetadata(applicationId), {
|
|
2413
2448
|
auth,
|
|
2414
2449
|
body,
|
|
2415
2450
|
signal
|
|
@@ -2418,7 +2453,7 @@ var RoleConnectionsAPI = class {
|
|
|
2418
2453
|
};
|
|
2419
2454
|
|
|
2420
2455
|
// src/api/soundboardSounds.ts
|
|
2421
|
-
import { Routes as
|
|
2456
|
+
import { Routes as Routes12 } from "discord-api-types/v10";
|
|
2422
2457
|
var SoundboardSoundsAPI = class {
|
|
2423
2458
|
constructor(rest) {
|
|
2424
2459
|
this.rest = rest;
|
|
@@ -2433,7 +2468,7 @@ var SoundboardSoundsAPI = class {
|
|
|
2433
2468
|
* @param options - The options for fetching the soundboard default sounds.
|
|
2434
2469
|
*/
|
|
2435
2470
|
async getSoundboardDefaultSounds({ auth, signal } = {}) {
|
|
2436
|
-
return this.rest.get(
|
|
2471
|
+
return this.rest.get(Routes12.soundboardDefaultSounds(), {
|
|
2437
2472
|
auth,
|
|
2438
2473
|
signal
|
|
2439
2474
|
});
|
|
@@ -2442,7 +2477,7 @@ var SoundboardSoundsAPI = class {
|
|
|
2442
2477
|
|
|
2443
2478
|
// src/api/stageInstances.ts
|
|
2444
2479
|
import {
|
|
2445
|
-
Routes as
|
|
2480
|
+
Routes as Routes13
|
|
2446
2481
|
} from "discord-api-types/v10";
|
|
2447
2482
|
var StageInstancesAPI = class {
|
|
2448
2483
|
constructor(rest) {
|
|
@@ -2459,7 +2494,7 @@ var StageInstancesAPI = class {
|
|
|
2459
2494
|
* @param options - The options for creating the new stage instance
|
|
2460
2495
|
*/
|
|
2461
2496
|
async create(body, { auth, reason, signal } = {}) {
|
|
2462
|
-
return this.rest.post(
|
|
2497
|
+
return this.rest.post(Routes13.stageInstances(), {
|
|
2463
2498
|
auth,
|
|
2464
2499
|
body,
|
|
2465
2500
|
reason,
|
|
@@ -2474,7 +2509,7 @@ var StageInstancesAPI = class {
|
|
|
2474
2509
|
* @param options - The options for fetching the stage instance
|
|
2475
2510
|
*/
|
|
2476
2511
|
async get(channelId, { auth, signal } = {}) {
|
|
2477
|
-
return this.rest.get(
|
|
2512
|
+
return this.rest.get(Routes13.stageInstance(channelId), { auth, signal });
|
|
2478
2513
|
}
|
|
2479
2514
|
/**
|
|
2480
2515
|
* Edits a stage instance
|
|
@@ -2485,7 +2520,7 @@ var StageInstancesAPI = class {
|
|
|
2485
2520
|
* @param options - The options for editing the stage instance
|
|
2486
2521
|
*/
|
|
2487
2522
|
async edit(channelId, body, { auth, reason, signal } = {}) {
|
|
2488
|
-
return this.rest.patch(
|
|
2523
|
+
return this.rest.patch(Routes13.stageInstance(channelId), {
|
|
2489
2524
|
auth,
|
|
2490
2525
|
body,
|
|
2491
2526
|
reason,
|
|
@@ -2500,13 +2535,13 @@ var StageInstancesAPI = class {
|
|
|
2500
2535
|
* @param options - The options for deleting the stage instance
|
|
2501
2536
|
*/
|
|
2502
2537
|
async delete(channelId, { auth, reason, signal } = {}) {
|
|
2503
|
-
await this.rest.delete(
|
|
2538
|
+
await this.rest.delete(Routes13.stageInstance(channelId), { auth, reason, signal });
|
|
2504
2539
|
}
|
|
2505
2540
|
};
|
|
2506
2541
|
|
|
2507
2542
|
// src/api/sticker.ts
|
|
2508
2543
|
import {
|
|
2509
|
-
Routes as
|
|
2544
|
+
Routes as Routes14
|
|
2510
2545
|
} from "discord-api-types/v10";
|
|
2511
2546
|
var StickersAPI = class {
|
|
2512
2547
|
constructor(rest) {
|
|
@@ -2523,7 +2558,7 @@ var StickersAPI = class {
|
|
|
2523
2558
|
* @param options - The options for fetching the sticker pack
|
|
2524
2559
|
*/
|
|
2525
2560
|
async getStickerPack(packId, { auth, signal } = {}) {
|
|
2526
|
-
return this.rest.get(
|
|
2561
|
+
return this.rest.get(Routes14.stickerPack(packId), { auth, signal });
|
|
2527
2562
|
}
|
|
2528
2563
|
/**
|
|
2529
2564
|
* Fetches all of the sticker packs
|
|
@@ -2532,7 +2567,7 @@ var StickersAPI = class {
|
|
|
2532
2567
|
* @param options - The options for fetching the sticker packs
|
|
2533
2568
|
*/
|
|
2534
2569
|
async getStickers({ auth, signal } = {}) {
|
|
2535
|
-
return this.rest.get(
|
|
2570
|
+
return this.rest.get(Routes14.stickerPacks(), { auth, signal });
|
|
2536
2571
|
}
|
|
2537
2572
|
/**
|
|
2538
2573
|
* Fetches a sticker
|
|
@@ -2542,13 +2577,13 @@ var StickersAPI = class {
|
|
|
2542
2577
|
* @param options - The options for fetching the sticker
|
|
2543
2578
|
*/
|
|
2544
2579
|
async get(stickerId, { auth, signal } = {}) {
|
|
2545
|
-
return this.rest.get(
|
|
2580
|
+
return this.rest.get(Routes14.sticker(stickerId), { auth, signal });
|
|
2546
2581
|
}
|
|
2547
2582
|
};
|
|
2548
2583
|
|
|
2549
2584
|
// src/api/thread.ts
|
|
2550
2585
|
import {
|
|
2551
|
-
Routes as
|
|
2586
|
+
Routes as Routes15
|
|
2552
2587
|
} from "discord-api-types/v10";
|
|
2553
2588
|
var ThreadsAPI = class {
|
|
2554
2589
|
constructor(rest) {
|
|
@@ -2565,7 +2600,7 @@ var ThreadsAPI = class {
|
|
|
2565
2600
|
* @param options - The options for joining the thread
|
|
2566
2601
|
*/
|
|
2567
2602
|
async join(threadId, { auth, signal } = {}) {
|
|
2568
|
-
await this.rest.put(
|
|
2603
|
+
await this.rest.put(Routes15.threadMembers(threadId, "@me"), { auth, signal });
|
|
2569
2604
|
}
|
|
2570
2605
|
/**
|
|
2571
2606
|
* Adds a member to a thread
|
|
@@ -2576,7 +2611,7 @@ var ThreadsAPI = class {
|
|
|
2576
2611
|
* @param options - The options for adding the member to the thread
|
|
2577
2612
|
*/
|
|
2578
2613
|
async addMember(threadId, userId, { auth, signal } = {}) {
|
|
2579
|
-
await this.rest.put(
|
|
2614
|
+
await this.rest.put(Routes15.threadMembers(threadId, userId), { auth, signal });
|
|
2580
2615
|
}
|
|
2581
2616
|
/**
|
|
2582
2617
|
* Removes the current user from a thread
|
|
@@ -2586,7 +2621,7 @@ var ThreadsAPI = class {
|
|
|
2586
2621
|
* @param options - The options for leaving the thread
|
|
2587
2622
|
*/
|
|
2588
2623
|
async leave(threadId, { auth, signal } = {}) {
|
|
2589
|
-
await this.rest.delete(
|
|
2624
|
+
await this.rest.delete(Routes15.threadMembers(threadId, "@me"), { auth, signal });
|
|
2590
2625
|
}
|
|
2591
2626
|
/**
|
|
2592
2627
|
* Removes a member from a thread
|
|
@@ -2597,7 +2632,7 @@ var ThreadsAPI = class {
|
|
|
2597
2632
|
* @param options - The options for removing the member from the thread
|
|
2598
2633
|
*/
|
|
2599
2634
|
async removeMember(threadId, userId, { auth, signal } = {}) {
|
|
2600
|
-
await this.rest.delete(
|
|
2635
|
+
await this.rest.delete(Routes15.threadMembers(threadId, userId), { auth, signal });
|
|
2601
2636
|
}
|
|
2602
2637
|
/**
|
|
2603
2638
|
* Fetches a member of a thread
|
|
@@ -2608,7 +2643,7 @@ var ThreadsAPI = class {
|
|
|
2608
2643
|
* @param options - The options for fetching the member
|
|
2609
2644
|
*/
|
|
2610
2645
|
async getMember(threadId, userId, { auth, signal } = {}) {
|
|
2611
|
-
return this.rest.get(
|
|
2646
|
+
return this.rest.get(Routes15.threadMembers(threadId, userId), { auth, signal });
|
|
2612
2647
|
}
|
|
2613
2648
|
/**
|
|
2614
2649
|
* Fetches all members of a thread
|
|
@@ -2618,7 +2653,7 @@ var ThreadsAPI = class {
|
|
|
2618
2653
|
* @param options - The options for fetching the members
|
|
2619
2654
|
*/
|
|
2620
2655
|
async getAllMembers(threadId, { auth, signal } = {}) {
|
|
2621
|
-
return this.rest.get(
|
|
2656
|
+
return this.rest.get(Routes15.threadMembers(threadId), {
|
|
2622
2657
|
auth,
|
|
2623
2658
|
signal
|
|
2624
2659
|
});
|
|
@@ -2628,7 +2663,7 @@ var ThreadsAPI = class {
|
|
|
2628
2663
|
// src/api/user.ts
|
|
2629
2664
|
import { makeURLSearchParams as makeURLSearchParams9 } from "@discordjs/rest";
|
|
2630
2665
|
import {
|
|
2631
|
-
Routes as
|
|
2666
|
+
Routes as Routes16
|
|
2632
2667
|
} from "discord-api-types/v10";
|
|
2633
2668
|
var UsersAPI = class {
|
|
2634
2669
|
constructor(rest) {
|
|
@@ -2645,7 +2680,7 @@ var UsersAPI = class {
|
|
|
2645
2680
|
* @param options - The options for fetching the user
|
|
2646
2681
|
*/
|
|
2647
2682
|
async get(userId, { auth, signal } = {}) {
|
|
2648
|
-
return this.rest.get(
|
|
2683
|
+
return this.rest.get(Routes16.user(userId), { auth, signal });
|
|
2649
2684
|
}
|
|
2650
2685
|
/**
|
|
2651
2686
|
* Returns the user object of the requester's account
|
|
@@ -2654,7 +2689,7 @@ var UsersAPI = class {
|
|
|
2654
2689
|
* @param options - The options for fetching the current user
|
|
2655
2690
|
*/
|
|
2656
2691
|
async getCurrent({ auth, signal } = {}) {
|
|
2657
|
-
return this.rest.get(
|
|
2692
|
+
return this.rest.get(Routes16.user("@me"), { auth, signal });
|
|
2658
2693
|
}
|
|
2659
2694
|
/**
|
|
2660
2695
|
* Returns a list of partial guild objects the current user is a member of
|
|
@@ -2664,7 +2699,7 @@ var UsersAPI = class {
|
|
|
2664
2699
|
* @param options - The options for fetching the guilds
|
|
2665
2700
|
*/
|
|
2666
2701
|
async getGuilds(query = {}, { auth, signal } = {}) {
|
|
2667
|
-
return this.rest.get(
|
|
2702
|
+
return this.rest.get(Routes16.userGuilds(), {
|
|
2668
2703
|
auth,
|
|
2669
2704
|
query: makeURLSearchParams9(query),
|
|
2670
2705
|
signal
|
|
@@ -2678,7 +2713,7 @@ var UsersAPI = class {
|
|
|
2678
2713
|
* @param options - The options for leaving the guild
|
|
2679
2714
|
*/
|
|
2680
2715
|
async leaveGuild(guildId, { auth, signal } = {}) {
|
|
2681
|
-
await this.rest.delete(
|
|
2716
|
+
await this.rest.delete(Routes16.userGuild(guildId), { auth, signal });
|
|
2682
2717
|
}
|
|
2683
2718
|
/**
|
|
2684
2719
|
* Edits the current user
|
|
@@ -2688,7 +2723,7 @@ var UsersAPI = class {
|
|
|
2688
2723
|
* @param options - The options for editing the user
|
|
2689
2724
|
*/
|
|
2690
2725
|
async edit(body, { auth, signal } = {}) {
|
|
2691
|
-
return this.rest.patch(
|
|
2726
|
+
return this.rest.patch(Routes16.user("@me"), { auth, body, signal });
|
|
2692
2727
|
}
|
|
2693
2728
|
/**
|
|
2694
2729
|
* Fetches the guild member for the current user
|
|
@@ -2698,7 +2733,7 @@ var UsersAPI = class {
|
|
|
2698
2733
|
* @param options - The options for fetching the guild member
|
|
2699
2734
|
*/
|
|
2700
2735
|
async getGuildMember(guildId, { auth, signal } = {}) {
|
|
2701
|
-
return this.rest.get(
|
|
2736
|
+
return this.rest.get(Routes16.userGuildMember(guildId), {
|
|
2702
2737
|
auth,
|
|
2703
2738
|
signal
|
|
2704
2739
|
});
|
|
@@ -2712,7 +2747,7 @@ var UsersAPI = class {
|
|
|
2712
2747
|
* @param options - The options for editing the guild member
|
|
2713
2748
|
*/
|
|
2714
2749
|
async editCurrentGuildMember(guildId, body = {}, { auth, reason, signal } = {}) {
|
|
2715
|
-
return this.rest.patch(
|
|
2750
|
+
return this.rest.patch(Routes16.guildMember(guildId, "@me"), {
|
|
2716
2751
|
auth,
|
|
2717
2752
|
reason,
|
|
2718
2753
|
body,
|
|
@@ -2727,7 +2762,7 @@ var UsersAPI = class {
|
|
|
2727
2762
|
* @param options - The options for opening the DM
|
|
2728
2763
|
*/
|
|
2729
2764
|
async createDM(userId, { auth, signal } = {}) {
|
|
2730
|
-
return this.rest.post(
|
|
2765
|
+
return this.rest.post(Routes16.userChannels(), {
|
|
2731
2766
|
auth,
|
|
2732
2767
|
body: { recipient_id: userId },
|
|
2733
2768
|
signal
|
|
@@ -2740,7 +2775,7 @@ var UsersAPI = class {
|
|
|
2740
2775
|
* @param options - The options for fetching the user's connections
|
|
2741
2776
|
*/
|
|
2742
2777
|
async getConnections({ auth, signal } = {}) {
|
|
2743
|
-
return this.rest.get(
|
|
2778
|
+
return this.rest.get(Routes16.userConnections(), { auth, signal });
|
|
2744
2779
|
}
|
|
2745
2780
|
/**
|
|
2746
2781
|
* Gets the current user's active application role connection
|
|
@@ -2750,7 +2785,7 @@ var UsersAPI = class {
|
|
|
2750
2785
|
* @param options - The options for fetching the role connections
|
|
2751
2786
|
*/
|
|
2752
2787
|
async getApplicationRoleConnection(applicationId, { auth, signal } = {}) {
|
|
2753
|
-
return this.rest.get(
|
|
2788
|
+
return this.rest.get(Routes16.userApplicationRoleConnection(applicationId), {
|
|
2754
2789
|
auth,
|
|
2755
2790
|
signal
|
|
2756
2791
|
});
|
|
@@ -2764,7 +2799,7 @@ var UsersAPI = class {
|
|
|
2764
2799
|
* @param options - The options for updating the application role connection
|
|
2765
2800
|
*/
|
|
2766
2801
|
async updateApplicationRoleConnection(applicationId, body, { auth, signal } = {}) {
|
|
2767
|
-
return this.rest.put(
|
|
2802
|
+
return this.rest.put(Routes16.userApplicationRoleConnection(applicationId), {
|
|
2768
2803
|
auth,
|
|
2769
2804
|
body,
|
|
2770
2805
|
signal
|
|
@@ -2774,7 +2809,7 @@ var UsersAPI = class {
|
|
|
2774
2809
|
|
|
2775
2810
|
// src/api/voice.ts
|
|
2776
2811
|
import {
|
|
2777
|
-
Routes as
|
|
2812
|
+
Routes as Routes17
|
|
2778
2813
|
} from "discord-api-types/v10";
|
|
2779
2814
|
var VoiceAPI = class {
|
|
2780
2815
|
constructor(rest) {
|
|
@@ -2790,7 +2825,7 @@ var VoiceAPI = class {
|
|
|
2790
2825
|
* @param options - The options for fetching the voice regions
|
|
2791
2826
|
*/
|
|
2792
2827
|
async getVoiceRegions({ auth, signal } = {}) {
|
|
2793
|
-
return this.rest.get(
|
|
2828
|
+
return this.rest.get(Routes17.voiceRegions(), { auth, signal });
|
|
2794
2829
|
}
|
|
2795
2830
|
/**
|
|
2796
2831
|
* Fetches voice state of a user by their id
|
|
@@ -2799,7 +2834,7 @@ var VoiceAPI = class {
|
|
|
2799
2834
|
* @param options - The options for fetching user voice state
|
|
2800
2835
|
*/
|
|
2801
2836
|
async getUserVoiceState(guildId, userId, { auth, signal } = {}) {
|
|
2802
|
-
return this.rest.get(
|
|
2837
|
+
return this.rest.get(Routes17.guildVoiceState(guildId, userId), {
|
|
2803
2838
|
auth,
|
|
2804
2839
|
signal
|
|
2805
2840
|
});
|
|
@@ -2811,7 +2846,7 @@ var VoiceAPI = class {
|
|
|
2811
2846
|
* @param options - The options for fetching user voice state
|
|
2812
2847
|
*/
|
|
2813
2848
|
async getVoiceState(guildId, { auth, signal } = {}) {
|
|
2814
|
-
return this.rest.get(
|
|
2849
|
+
return this.rest.get(Routes17.guildVoiceState(guildId, "@me"), {
|
|
2815
2850
|
auth,
|
|
2816
2851
|
signal
|
|
2817
2852
|
});
|
|
@@ -2826,7 +2861,7 @@ var VoiceAPI = class {
|
|
|
2826
2861
|
* @param options - The options for editing the voice state
|
|
2827
2862
|
*/
|
|
2828
2863
|
async editUserVoiceState(guildId, userId, body, { auth, reason, signal } = {}) {
|
|
2829
|
-
return this.rest.patch(
|
|
2864
|
+
return this.rest.patch(Routes17.guildVoiceState(guildId, userId), {
|
|
2830
2865
|
auth,
|
|
2831
2866
|
reason,
|
|
2832
2867
|
body,
|
|
@@ -2842,7 +2877,7 @@ var VoiceAPI = class {
|
|
|
2842
2877
|
* @param options - The options for editing the voice state
|
|
2843
2878
|
*/
|
|
2844
2879
|
async editVoiceState(guildId, body = {}, { auth, signal } = {}) {
|
|
2845
|
-
return this.rest.patch(
|
|
2880
|
+
return this.rest.patch(Routes17.guildVoiceState(guildId, "@me"), {
|
|
2846
2881
|
auth,
|
|
2847
2882
|
body,
|
|
2848
2883
|
signal
|
|
@@ -2853,7 +2888,7 @@ var VoiceAPI = class {
|
|
|
2853
2888
|
// src/api/webhook.ts
|
|
2854
2889
|
import { makeURLSearchParams as makeURLSearchParams10 } from "@discordjs/rest";
|
|
2855
2890
|
import {
|
|
2856
|
-
Routes as
|
|
2891
|
+
Routes as Routes18
|
|
2857
2892
|
} from "discord-api-types/v10";
|
|
2858
2893
|
var WebhooksAPI = class {
|
|
2859
2894
|
constructor(rest) {
|
|
@@ -2871,7 +2906,7 @@ var WebhooksAPI = class {
|
|
|
2871
2906
|
* @param options - The options for fetching the webhook
|
|
2872
2907
|
*/
|
|
2873
2908
|
async get(id, { token, signal } = {}) {
|
|
2874
|
-
return this.rest.get(
|
|
2909
|
+
return this.rest.get(Routes18.webhook(id, token), {
|
|
2875
2910
|
signal,
|
|
2876
2911
|
auth: !token
|
|
2877
2912
|
});
|
|
@@ -2886,7 +2921,7 @@ var WebhooksAPI = class {
|
|
|
2886
2921
|
* @param options - The options for editing the webhook
|
|
2887
2922
|
*/
|
|
2888
2923
|
async edit(id, body, { token, reason, signal } = {}) {
|
|
2889
|
-
return this.rest.patch(
|
|
2924
|
+
return this.rest.patch(Routes18.webhook(id, token), {
|
|
2890
2925
|
reason,
|
|
2891
2926
|
body,
|
|
2892
2927
|
signal,
|
|
@@ -2902,7 +2937,7 @@ var WebhooksAPI = class {
|
|
|
2902
2937
|
* @param options - The options for deleting the webhook
|
|
2903
2938
|
*/
|
|
2904
2939
|
async delete(id, { token, reason, signal } = {}) {
|
|
2905
|
-
await this.rest.delete(
|
|
2940
|
+
await this.rest.delete(Routes18.webhook(id, token), {
|
|
2906
2941
|
reason,
|
|
2907
2942
|
signal,
|
|
2908
2943
|
auth: !token
|
|
@@ -2918,7 +2953,7 @@ var WebhooksAPI = class {
|
|
|
2918
2953
|
* @param options - The options for executing the webhook
|
|
2919
2954
|
*/
|
|
2920
2955
|
async execute(id, token, { wait, thread_id, with_components, files, ...body }, { signal } = {}) {
|
|
2921
|
-
return this.rest.post(
|
|
2956
|
+
return this.rest.post(Routes18.webhook(id, token), {
|
|
2922
2957
|
query: makeURLSearchParams10({ wait, thread_id, with_components }),
|
|
2923
2958
|
files,
|
|
2924
2959
|
body,
|
|
@@ -2937,7 +2972,7 @@ var WebhooksAPI = class {
|
|
|
2937
2972
|
* @param options - The options for executing the webhook
|
|
2938
2973
|
*/
|
|
2939
2974
|
async executeSlack(id, token, body, query = {}, { signal } = {}) {
|
|
2940
|
-
await this.rest.post(
|
|
2975
|
+
await this.rest.post(Routes18.webhookPlatform(id, token, "slack"), {
|
|
2941
2976
|
query: makeURLSearchParams10(query),
|
|
2942
2977
|
body,
|
|
2943
2978
|
auth: false,
|
|
@@ -2955,7 +2990,7 @@ var WebhooksAPI = class {
|
|
|
2955
2990
|
* @param options - The options for executing the webhook
|
|
2956
2991
|
*/
|
|
2957
2992
|
async executeGitHub(id, token, body, query = {}, { signal } = {}) {
|
|
2958
|
-
await this.rest.post(
|
|
2993
|
+
await this.rest.post(Routes18.webhookPlatform(id, token, "github"), {
|
|
2959
2994
|
query: makeURLSearchParams10(query),
|
|
2960
2995
|
body,
|
|
2961
2996
|
signal,
|
|
@@ -2973,7 +3008,7 @@ var WebhooksAPI = class {
|
|
|
2973
3008
|
* @param options - The options for fetching the message
|
|
2974
3009
|
*/
|
|
2975
3010
|
async getMessage(id, token, messageId, query = {}, { signal } = {}) {
|
|
2976
|
-
return this.rest.get(
|
|
3011
|
+
return this.rest.get(Routes18.webhookMessage(id, token, messageId), {
|
|
2977
3012
|
query: makeURLSearchParams10(query),
|
|
2978
3013
|
auth: false,
|
|
2979
3014
|
signal
|
|
@@ -2990,7 +3025,7 @@ var WebhooksAPI = class {
|
|
|
2990
3025
|
* @param options - The options for editing the message
|
|
2991
3026
|
*/
|
|
2992
3027
|
async editMessage(id, token, messageId, { thread_id, with_components, files, ...body }, { signal } = {}) {
|
|
2993
|
-
return this.rest.patch(
|
|
3028
|
+
return this.rest.patch(Routes18.webhookMessage(id, token, messageId), {
|
|
2994
3029
|
query: makeURLSearchParams10({ thread_id, with_components }),
|
|
2995
3030
|
auth: false,
|
|
2996
3031
|
body,
|
|
@@ -3009,7 +3044,7 @@ var WebhooksAPI = class {
|
|
|
3009
3044
|
* @param options - The options for deleting the message
|
|
3010
3045
|
*/
|
|
3011
3046
|
async deleteMessage(id, token, messageId, query = {}, { signal } = {}) {
|
|
3012
|
-
await this.rest.delete(
|
|
3047
|
+
await this.rest.delete(Routes18.webhookMessage(id, token, messageId), {
|
|
3013
3048
|
query: makeURLSearchParams10(query),
|
|
3014
3049
|
auth: false,
|
|
3015
3050
|
signal
|
|
@@ -3024,6 +3059,7 @@ var API = class {
|
|
|
3024
3059
|
this.applicationCommands = new ApplicationCommandsAPI(rest);
|
|
3025
3060
|
this.applications = new ApplicationsAPI(rest);
|
|
3026
3061
|
this.channels = new ChannelsAPI(rest);
|
|
3062
|
+
this.gateway = new GatewayAPI(rest);
|
|
3027
3063
|
this.guilds = new GuildsAPI(rest);
|
|
3028
3064
|
this.invites = new InvitesAPI(rest);
|
|
3029
3065
|
this.monetization = new MonetizationAPI(rest);
|
|
@@ -3045,6 +3081,7 @@ var API = class {
|
|
|
3045
3081
|
applicationCommands;
|
|
3046
3082
|
applications;
|
|
3047
3083
|
channels;
|
|
3084
|
+
gateway;
|
|
3048
3085
|
guilds;
|
|
3049
3086
|
interactions;
|
|
3050
3087
|
invites;
|
|
@@ -3307,13 +3344,14 @@ __name(withFiles, "withFiles");
|
|
|
3307
3344
|
|
|
3308
3345
|
// src/index.ts
|
|
3309
3346
|
export * from "discord-api-types/v10";
|
|
3310
|
-
var version = "3.0.0-dev.
|
|
3347
|
+
var version = "3.0.0-dev.1759622511-ffbb7b693";
|
|
3311
3348
|
export {
|
|
3312
3349
|
API,
|
|
3313
3350
|
ApplicationCommandsAPI,
|
|
3314
3351
|
ApplicationsAPI,
|
|
3315
3352
|
ChannelsAPI,
|
|
3316
3353
|
Client,
|
|
3354
|
+
GatewayAPI,
|
|
3317
3355
|
GuildsAPI,
|
|
3318
3356
|
InteractionsAPI,
|
|
3319
3357
|
InvitesAPI,
|