@discordjs/core 3.0.0-dev.1734048793-0848fc6b4 → 3.0.0-dev.1734135156-35ebcc7d5
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 +1 -40
- package/dist/http-only.d.ts +1 -40
- package/dist/http-only.js +220 -275
- package/dist/http-only.js.map +1 -1
- package/dist/http-only.mjs +216 -271
- package/dist/http-only.mjs.map +1 -1
- package/dist/index.d.mts +1 -40
- package/dist/index.d.ts +1 -40
- package/dist/index.js +220 -275
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +216 -271
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -840,81 +840,7 @@ var ChannelsAPI = class {
|
|
|
840
840
|
|
|
841
841
|
// src/api/guild.ts
|
|
842
842
|
var import_rest3 = require("@discordjs/rest");
|
|
843
|
-
var import_v105 = require("discord-api-types/v10");
|
|
844
|
-
|
|
845
|
-
// src/api/voice.ts
|
|
846
843
|
var import_v104 = require("discord-api-types/v10");
|
|
847
|
-
var VoiceAPI = class {
|
|
848
|
-
constructor(rest) {
|
|
849
|
-
this.rest = rest;
|
|
850
|
-
}
|
|
851
|
-
static {
|
|
852
|
-
__name(this, "VoiceAPI");
|
|
853
|
-
}
|
|
854
|
-
/**
|
|
855
|
-
* Fetches all voice regions
|
|
856
|
-
*
|
|
857
|
-
* @see {@link https://discord.com/developers/docs/resources/voice#list-voice-regions}
|
|
858
|
-
* @param options - The options for fetching the voice regions
|
|
859
|
-
*/
|
|
860
|
-
async getVoiceRegions({ signal } = {}) {
|
|
861
|
-
return this.rest.get(import_v104.Routes.voiceRegions(), { signal });
|
|
862
|
-
}
|
|
863
|
-
/**
|
|
864
|
-
* Fetches voice state of a user by their id
|
|
865
|
-
*
|
|
866
|
-
* @see {@link https://discord.com/developers/docs/resources/voice#get-user-voice-state}
|
|
867
|
-
* @param options - The options for fetching user voice state
|
|
868
|
-
*/
|
|
869
|
-
async getUserVoiceState(guildId, userId, { signal } = {}) {
|
|
870
|
-
return this.rest.get(import_v104.Routes.guildVoiceState(guildId, userId), {
|
|
871
|
-
signal
|
|
872
|
-
});
|
|
873
|
-
}
|
|
874
|
-
/**
|
|
875
|
-
* Fetches the current user's voice state
|
|
876
|
-
*
|
|
877
|
-
* @see {@link https://discord.com/developers/docs/resources/voice#get-current-user-voice-state}
|
|
878
|
-
* @param options - The options for fetching user voice state
|
|
879
|
-
*/
|
|
880
|
-
async getVoiceState(guildId, { signal } = {}) {
|
|
881
|
-
return this.rest.get(import_v104.Routes.guildVoiceState(guildId, "@me"), {
|
|
882
|
-
signal
|
|
883
|
-
});
|
|
884
|
-
}
|
|
885
|
-
/**
|
|
886
|
-
* Edits a user's voice state in a guild
|
|
887
|
-
*
|
|
888
|
-
* @see {@link https://discord.com/developers/docs/resources/voice#modify-user-voice-state}
|
|
889
|
-
* @param guildId - The id of the guild to edit the current user's voice state in
|
|
890
|
-
* @param userId - The id of the user to edit the voice state for
|
|
891
|
-
* @param body - The data for editing the voice state
|
|
892
|
-
* @param options - The options for editing the voice state
|
|
893
|
-
*/
|
|
894
|
-
async editUserVoiceState(guildId, userId, body, { reason, signal } = {}) {
|
|
895
|
-
return this.rest.patch(import_v104.Routes.guildVoiceState(guildId, userId), {
|
|
896
|
-
reason,
|
|
897
|
-
body,
|
|
898
|
-
signal
|
|
899
|
-
});
|
|
900
|
-
}
|
|
901
|
-
/**
|
|
902
|
-
* Edits the voice state for the current user
|
|
903
|
-
*
|
|
904
|
-
* @see {@link https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state}
|
|
905
|
-
* @param guildId - The id of the guild
|
|
906
|
-
* @param body - The data for editing the voice state
|
|
907
|
-
* @param options - The options for editing the voice state
|
|
908
|
-
*/
|
|
909
|
-
async editVoiceState(guildId, body = {}, { signal } = {}) {
|
|
910
|
-
return this.rest.patch(import_v104.Routes.guildVoiceState(guildId, "@me"), {
|
|
911
|
-
body,
|
|
912
|
-
signal
|
|
913
|
-
});
|
|
914
|
-
}
|
|
915
|
-
};
|
|
916
|
-
|
|
917
|
-
// src/api/guild.ts
|
|
918
844
|
var GuildsAPI = class {
|
|
919
845
|
constructor(rest) {
|
|
920
846
|
this.rest = rest;
|
|
@@ -931,7 +857,7 @@ var GuildsAPI = class {
|
|
|
931
857
|
* @param options - The options for fetching the guild
|
|
932
858
|
*/
|
|
933
859
|
async get(guildId, query = {}, { signal } = {}) {
|
|
934
|
-
return this.rest.get(
|
|
860
|
+
return this.rest.get(import_v104.Routes.guild(guildId), {
|
|
935
861
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
936
862
|
signal
|
|
937
863
|
});
|
|
@@ -944,7 +870,7 @@ var GuildsAPI = class {
|
|
|
944
870
|
* @param options - The options for fetching the guild preview
|
|
945
871
|
*/
|
|
946
872
|
async getPreview(guildId, { signal } = {}) {
|
|
947
|
-
return this.rest.get(
|
|
873
|
+
return this.rest.get(import_v104.Routes.guildPreview(guildId), {
|
|
948
874
|
signal
|
|
949
875
|
});
|
|
950
876
|
}
|
|
@@ -956,7 +882,7 @@ var GuildsAPI = class {
|
|
|
956
882
|
* @param options - The options for creating the guild
|
|
957
883
|
*/
|
|
958
884
|
async create(body, { signal } = {}) {
|
|
959
|
-
return this.rest.post(
|
|
885
|
+
return this.rest.post(import_v104.Routes.guilds(), { body, signal });
|
|
960
886
|
}
|
|
961
887
|
/**
|
|
962
888
|
* Edits a guild
|
|
@@ -967,7 +893,7 @@ var GuildsAPI = class {
|
|
|
967
893
|
* @param options - The options for editing the guild
|
|
968
894
|
*/
|
|
969
895
|
async edit(guildId, body, { reason, signal } = {}) {
|
|
970
|
-
return this.rest.patch(
|
|
896
|
+
return this.rest.patch(import_v104.Routes.guild(guildId), {
|
|
971
897
|
reason,
|
|
972
898
|
body,
|
|
973
899
|
signal
|
|
@@ -981,7 +907,7 @@ var GuildsAPI = class {
|
|
|
981
907
|
* @param options - The options for deleting this guild
|
|
982
908
|
*/
|
|
983
909
|
async delete(guildId, { signal, reason } = {}) {
|
|
984
|
-
await this.rest.delete(
|
|
910
|
+
await this.rest.delete(import_v104.Routes.guild(guildId), { reason, signal });
|
|
985
911
|
}
|
|
986
912
|
/**
|
|
987
913
|
* Adds user to the guild
|
|
@@ -993,7 +919,7 @@ var GuildsAPI = class {
|
|
|
993
919
|
* @param options - The options for adding users to the guild
|
|
994
920
|
*/
|
|
995
921
|
async addMember(guildId, userId, body, { signal } = {}) {
|
|
996
|
-
return this.rest.put(
|
|
922
|
+
return this.rest.put(import_v104.Routes.guildMember(guildId, userId), {
|
|
997
923
|
body,
|
|
998
924
|
signal
|
|
999
925
|
});
|
|
@@ -1007,7 +933,7 @@ var GuildsAPI = class {
|
|
|
1007
933
|
* @param options - The options for fetching the guild members
|
|
1008
934
|
*/
|
|
1009
935
|
async getMembers(guildId, query = {}, { signal } = {}) {
|
|
1010
|
-
return this.rest.get(
|
|
936
|
+
return this.rest.get(import_v104.Routes.guildMembers(guildId), {
|
|
1011
937
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1012
938
|
signal
|
|
1013
939
|
});
|
|
@@ -1020,7 +946,7 @@ var GuildsAPI = class {
|
|
|
1020
946
|
* @param options - The options for fetching the guild channels
|
|
1021
947
|
*/
|
|
1022
948
|
async getChannels(guildId, { signal } = {}) {
|
|
1023
|
-
return this.rest.get(
|
|
949
|
+
return this.rest.get(import_v104.Routes.guildChannels(guildId), {
|
|
1024
950
|
signal
|
|
1025
951
|
});
|
|
1026
952
|
}
|
|
@@ -1033,7 +959,7 @@ var GuildsAPI = class {
|
|
|
1033
959
|
* @param options - The options for creating the guild channel
|
|
1034
960
|
*/
|
|
1035
961
|
async createChannel(guildId, body, { reason, signal } = {}) {
|
|
1036
|
-
return this.rest.post(
|
|
962
|
+
return this.rest.post(import_v104.Routes.guildChannels(guildId), {
|
|
1037
963
|
reason,
|
|
1038
964
|
body,
|
|
1039
965
|
signal
|
|
@@ -1048,7 +974,7 @@ var GuildsAPI = class {
|
|
|
1048
974
|
* @param options - The options for editing the guild channel positions
|
|
1049
975
|
*/
|
|
1050
976
|
async setChannelPositions(guildId, body, { reason, signal } = {}) {
|
|
1051
|
-
await this.rest.patch(
|
|
977
|
+
await this.rest.patch(import_v104.Routes.guildChannels(guildId), { reason, body, signal });
|
|
1052
978
|
}
|
|
1053
979
|
/**
|
|
1054
980
|
* Fetches the active threads in a guild
|
|
@@ -1058,7 +984,7 @@ var GuildsAPI = class {
|
|
|
1058
984
|
* @param options - The options for fetching the active threads
|
|
1059
985
|
*/
|
|
1060
986
|
async getActiveThreads(guildId, { signal } = {}) {
|
|
1061
|
-
return this.rest.get(
|
|
987
|
+
return this.rest.get(import_v104.Routes.guildActiveThreads(guildId), { signal });
|
|
1062
988
|
}
|
|
1063
989
|
/**
|
|
1064
990
|
* Fetches a guild member ban
|
|
@@ -1069,7 +995,7 @@ var GuildsAPI = class {
|
|
|
1069
995
|
* @param options - The options for fetching the ban
|
|
1070
996
|
*/
|
|
1071
997
|
async getMemberBan(guildId, userId, { signal } = {}) {
|
|
1072
|
-
return this.rest.get(
|
|
998
|
+
return this.rest.get(import_v104.Routes.guildBan(guildId, userId), { signal });
|
|
1073
999
|
}
|
|
1074
1000
|
/**
|
|
1075
1001
|
* Fetches guild member bans
|
|
@@ -1080,7 +1006,7 @@ var GuildsAPI = class {
|
|
|
1080
1006
|
* @param options - The options for fetching the bans
|
|
1081
1007
|
*/
|
|
1082
1008
|
async getMemberBans(guildId, query = {}, { signal } = {}) {
|
|
1083
|
-
return this.rest.get(
|
|
1009
|
+
return this.rest.get(import_v104.Routes.guildBans(guildId), {
|
|
1084
1010
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1085
1011
|
signal
|
|
1086
1012
|
});
|
|
@@ -1095,7 +1021,7 @@ var GuildsAPI = class {
|
|
|
1095
1021
|
* @param options - The options for banning the user
|
|
1096
1022
|
*/
|
|
1097
1023
|
async banUser(guildId, userId, body = {}, { reason, signal } = {}) {
|
|
1098
|
-
await this.rest.put(
|
|
1024
|
+
await this.rest.put(import_v104.Routes.guildBan(guildId, userId), { reason, body, signal });
|
|
1099
1025
|
}
|
|
1100
1026
|
/**
|
|
1101
1027
|
* Unbans a user from a guild
|
|
@@ -1106,7 +1032,7 @@ var GuildsAPI = class {
|
|
|
1106
1032
|
* @param options - The options for unbanning the user
|
|
1107
1033
|
*/
|
|
1108
1034
|
async unbanUser(guildId, userId, { reason, signal } = {}) {
|
|
1109
|
-
await this.rest.delete(
|
|
1035
|
+
await this.rest.delete(import_v104.Routes.guildBan(guildId, userId), { reason, signal });
|
|
1110
1036
|
}
|
|
1111
1037
|
/**
|
|
1112
1038
|
* Bulk ban users from a guild
|
|
@@ -1117,7 +1043,7 @@ var GuildsAPI = class {
|
|
|
1117
1043
|
* @param options - The options for bulk banning users
|
|
1118
1044
|
*/
|
|
1119
1045
|
async bulkBanUsers(guildId, body, { reason, signal } = {}) {
|
|
1120
|
-
return this.rest.post(
|
|
1046
|
+
return this.rest.post(import_v104.Routes.guildBulkBan(guildId), {
|
|
1121
1047
|
reason,
|
|
1122
1048
|
body,
|
|
1123
1049
|
signal
|
|
@@ -1131,7 +1057,7 @@ var GuildsAPI = class {
|
|
|
1131
1057
|
* @param options - The options for fetching the guild roles
|
|
1132
1058
|
*/
|
|
1133
1059
|
async getRoles(guildId, { signal } = {}) {
|
|
1134
|
-
return this.rest.get(
|
|
1060
|
+
return this.rest.get(import_v104.Routes.guildRoles(guildId), { signal });
|
|
1135
1061
|
}
|
|
1136
1062
|
/**
|
|
1137
1063
|
* Get a role in a guild
|
|
@@ -1142,7 +1068,7 @@ var GuildsAPI = class {
|
|
|
1142
1068
|
* @param options - The options for fetching the guild role
|
|
1143
1069
|
*/
|
|
1144
1070
|
async getRole(guildId, roleId, { signal } = {}) {
|
|
1145
|
-
return this.rest.get(
|
|
1071
|
+
return this.rest.get(import_v104.Routes.guildRole(guildId, roleId), { signal });
|
|
1146
1072
|
}
|
|
1147
1073
|
/**
|
|
1148
1074
|
* Creates a guild role
|
|
@@ -1153,7 +1079,7 @@ var GuildsAPI = class {
|
|
|
1153
1079
|
* @param options - The options for creating the guild role
|
|
1154
1080
|
*/
|
|
1155
1081
|
async createRole(guildId, body, { reason, signal } = {}) {
|
|
1156
|
-
return this.rest.post(
|
|
1082
|
+
return this.rest.post(import_v104.Routes.guildRoles(guildId), { reason, body, signal });
|
|
1157
1083
|
}
|
|
1158
1084
|
/**
|
|
1159
1085
|
* Sets role positions in a guild
|
|
@@ -1164,7 +1090,7 @@ var GuildsAPI = class {
|
|
|
1164
1090
|
* @param options - The options for setting role positions
|
|
1165
1091
|
*/
|
|
1166
1092
|
async setRolePositions(guildId, body, { reason, signal } = {}) {
|
|
1167
|
-
return this.rest.patch(
|
|
1093
|
+
return this.rest.patch(import_v104.Routes.guildRoles(guildId), {
|
|
1168
1094
|
reason,
|
|
1169
1095
|
body,
|
|
1170
1096
|
signal
|
|
@@ -1180,7 +1106,7 @@ var GuildsAPI = class {
|
|
|
1180
1106
|
* @param options - The options for editing the guild role
|
|
1181
1107
|
*/
|
|
1182
1108
|
async editRole(guildId, roleId, body, { reason, signal } = {}) {
|
|
1183
|
-
return this.rest.patch(
|
|
1109
|
+
return this.rest.patch(import_v104.Routes.guildRole(guildId, roleId), {
|
|
1184
1110
|
reason,
|
|
1185
1111
|
body,
|
|
1186
1112
|
signal
|
|
@@ -1195,7 +1121,7 @@ var GuildsAPI = class {
|
|
|
1195
1121
|
* @param options - The options for deleting the guild role
|
|
1196
1122
|
*/
|
|
1197
1123
|
async deleteRole(guildId, roleId, { reason, signal } = {}) {
|
|
1198
|
-
await this.rest.delete(
|
|
1124
|
+
await this.rest.delete(import_v104.Routes.guildRole(guildId, roleId), { reason, signal });
|
|
1199
1125
|
}
|
|
1200
1126
|
/**
|
|
1201
1127
|
* Edits the multi-factor-authentication (MFA) level of a guild
|
|
@@ -1206,7 +1132,7 @@ var GuildsAPI = class {
|
|
|
1206
1132
|
* @param options - The options for editing the MFA level
|
|
1207
1133
|
*/
|
|
1208
1134
|
async editMFALevel(guildId, level, { reason, signal } = {}) {
|
|
1209
|
-
return this.rest.post(
|
|
1135
|
+
return this.rest.post(import_v104.Routes.guildMFA(guildId), {
|
|
1210
1136
|
reason,
|
|
1211
1137
|
signal,
|
|
1212
1138
|
body: { level }
|
|
@@ -1221,7 +1147,7 @@ var GuildsAPI = class {
|
|
|
1221
1147
|
* @param options - The options for fetching the number of pruned members
|
|
1222
1148
|
*/
|
|
1223
1149
|
async getPruneCount(guildId, query = {}, { signal } = {}) {
|
|
1224
|
-
return this.rest.get(
|
|
1150
|
+
return this.rest.get(import_v104.Routes.guildPrune(guildId), {
|
|
1225
1151
|
signal,
|
|
1226
1152
|
query: (0, import_rest3.makeURLSearchParams)(query)
|
|
1227
1153
|
});
|
|
@@ -1235,7 +1161,7 @@ var GuildsAPI = class {
|
|
|
1235
1161
|
* @param options - The options for initiating the prune
|
|
1236
1162
|
*/
|
|
1237
1163
|
async beginPrune(guildId, body = {}, { reason, signal } = {}) {
|
|
1238
|
-
return this.rest.post(
|
|
1164
|
+
return this.rest.post(import_v104.Routes.guildPrune(guildId), {
|
|
1239
1165
|
body,
|
|
1240
1166
|
reason,
|
|
1241
1167
|
signal
|
|
@@ -1249,7 +1175,7 @@ var GuildsAPI = class {
|
|
|
1249
1175
|
* @param options - The options for fetching the voice regions
|
|
1250
1176
|
*/
|
|
1251
1177
|
async getVoiceRegions(guildId, { signal } = {}) {
|
|
1252
|
-
return this.rest.get(
|
|
1178
|
+
return this.rest.get(import_v104.Routes.guildVoiceRegions(guildId), { signal });
|
|
1253
1179
|
}
|
|
1254
1180
|
/**
|
|
1255
1181
|
* Fetches the invites for a guild
|
|
@@ -1259,7 +1185,7 @@ var GuildsAPI = class {
|
|
|
1259
1185
|
* @param options - The options for fetching the invites
|
|
1260
1186
|
*/
|
|
1261
1187
|
async getInvites(guildId, { signal } = {}) {
|
|
1262
|
-
return this.rest.get(
|
|
1188
|
+
return this.rest.get(import_v104.Routes.guildInvites(guildId), { signal });
|
|
1263
1189
|
}
|
|
1264
1190
|
/**
|
|
1265
1191
|
* Fetches the integrations for a guild
|
|
@@ -1269,7 +1195,7 @@ var GuildsAPI = class {
|
|
|
1269
1195
|
* @param options - The options for fetching the integrations
|
|
1270
1196
|
*/
|
|
1271
1197
|
async getIntegrations(guildId, { signal } = {}) {
|
|
1272
|
-
return this.rest.get(
|
|
1198
|
+
return this.rest.get(import_v104.Routes.guildIntegrations(guildId), { signal });
|
|
1273
1199
|
}
|
|
1274
1200
|
/**
|
|
1275
1201
|
* Deletes an integration from a guild
|
|
@@ -1280,7 +1206,7 @@ var GuildsAPI = class {
|
|
|
1280
1206
|
* @param options - The options for deleting the integration
|
|
1281
1207
|
*/
|
|
1282
1208
|
async deleteIntegration(guildId, integrationId, { reason, signal } = {}) {
|
|
1283
|
-
await this.rest.delete(
|
|
1209
|
+
await this.rest.delete(import_v104.Routes.guildIntegration(guildId, integrationId), { reason, signal });
|
|
1284
1210
|
}
|
|
1285
1211
|
/**
|
|
1286
1212
|
* Fetches the widget settings for a guild
|
|
@@ -1290,7 +1216,7 @@ var GuildsAPI = class {
|
|
|
1290
1216
|
* @param options - The options for fetching the widget settings
|
|
1291
1217
|
*/
|
|
1292
1218
|
async getWidgetSettings(guildId, { signal } = {}) {
|
|
1293
|
-
return this.rest.get(
|
|
1219
|
+
return this.rest.get(import_v104.Routes.guildWidgetSettings(guildId), {
|
|
1294
1220
|
signal
|
|
1295
1221
|
});
|
|
1296
1222
|
}
|
|
@@ -1303,7 +1229,7 @@ var GuildsAPI = class {
|
|
|
1303
1229
|
* @param options - The options for editing the widget settings
|
|
1304
1230
|
*/
|
|
1305
1231
|
async editWidgetSettings(guildId, body, { reason, signal } = {}) {
|
|
1306
|
-
return this.rest.patch(
|
|
1232
|
+
return this.rest.patch(import_v104.Routes.guildWidgetSettings(guildId), {
|
|
1307
1233
|
reason,
|
|
1308
1234
|
body,
|
|
1309
1235
|
signal
|
|
@@ -1317,7 +1243,7 @@ var GuildsAPI = class {
|
|
|
1317
1243
|
* @param options - The options for fetching the widget
|
|
1318
1244
|
*/
|
|
1319
1245
|
async getWidget(guildId, { signal } = {}) {
|
|
1320
|
-
return this.rest.get(
|
|
1246
|
+
return this.rest.get(import_v104.Routes.guildWidgetJSON(guildId), { signal });
|
|
1321
1247
|
}
|
|
1322
1248
|
/**
|
|
1323
1249
|
* Fetches the vanity url for a guild
|
|
@@ -1327,7 +1253,7 @@ var GuildsAPI = class {
|
|
|
1327
1253
|
* @param options - The options for fetching the vanity url
|
|
1328
1254
|
*/
|
|
1329
1255
|
async getVanityURL(guildId, { signal } = {}) {
|
|
1330
|
-
return this.rest.get(
|
|
1256
|
+
return this.rest.get(import_v104.Routes.guildVanityUrl(guildId), { signal });
|
|
1331
1257
|
}
|
|
1332
1258
|
/**
|
|
1333
1259
|
* Fetches the widget image for a guild
|
|
@@ -1338,7 +1264,7 @@ var GuildsAPI = class {
|
|
|
1338
1264
|
* @param options - The options for fetching the widget image
|
|
1339
1265
|
*/
|
|
1340
1266
|
async getWidgetImage(guildId, style, { signal } = {}) {
|
|
1341
|
-
return this.rest.get(
|
|
1267
|
+
return this.rest.get(import_v104.Routes.guildWidgetImage(guildId), {
|
|
1342
1268
|
query: (0, import_rest3.makeURLSearchParams)({ style }),
|
|
1343
1269
|
signal
|
|
1344
1270
|
});
|
|
@@ -1351,7 +1277,7 @@ var GuildsAPI = class {
|
|
|
1351
1277
|
* @param options - The options for fetching the welcome screen
|
|
1352
1278
|
*/
|
|
1353
1279
|
async getWelcomeScreen(guildId, { signal } = {}) {
|
|
1354
|
-
return this.rest.get(
|
|
1280
|
+
return this.rest.get(import_v104.Routes.guildWelcomeScreen(guildId), { signal });
|
|
1355
1281
|
}
|
|
1356
1282
|
/**
|
|
1357
1283
|
* Edits the welcome screen for a guild
|
|
@@ -1362,25 +1288,12 @@ var GuildsAPI = class {
|
|
|
1362
1288
|
* @param options - The options for editing the welcome screen
|
|
1363
1289
|
*/
|
|
1364
1290
|
async editWelcomeScreen(guildId, body, { reason, signal } = {}) {
|
|
1365
|
-
return this.rest.patch(
|
|
1291
|
+
return this.rest.patch(import_v104.Routes.guildWelcomeScreen(guildId), {
|
|
1366
1292
|
reason,
|
|
1367
1293
|
body,
|
|
1368
1294
|
signal
|
|
1369
1295
|
});
|
|
1370
1296
|
}
|
|
1371
|
-
/**
|
|
1372
|
-
* Edits a user's voice state in a guild
|
|
1373
|
-
*
|
|
1374
|
-
* @see {@link https://discord.com/developers/docs/resources/voice#modify-user-voice-state}
|
|
1375
|
-
* @param guildId - The id of the guild to edit the current user's voice state in
|
|
1376
|
-
* @param userId - The id of the user to edit the voice state for
|
|
1377
|
-
* @param body - The data for editing the voice state
|
|
1378
|
-
* @param options - The options for editing the voice state
|
|
1379
|
-
* @deprecated Use {@link VoiceAPI.editUserVoiceState} instead
|
|
1380
|
-
*/
|
|
1381
|
-
async editUserVoiceState(guildId, userId, body, { reason, signal } = {}) {
|
|
1382
|
-
return new VoiceAPI(this.rest).editUserVoiceState(guildId, userId, body, { reason, signal });
|
|
1383
|
-
}
|
|
1384
1297
|
/**
|
|
1385
1298
|
* Fetches all emojis for a guild
|
|
1386
1299
|
*
|
|
@@ -1389,7 +1302,7 @@ var GuildsAPI = class {
|
|
|
1389
1302
|
* @param options - The options for fetching the emojis
|
|
1390
1303
|
*/
|
|
1391
1304
|
async getEmojis(guildId, { signal } = {}) {
|
|
1392
|
-
return this.rest.get(
|
|
1305
|
+
return this.rest.get(import_v104.Routes.guildEmojis(guildId), { signal });
|
|
1393
1306
|
}
|
|
1394
1307
|
/**
|
|
1395
1308
|
* Fetches an emoji for a guild
|
|
@@ -1400,7 +1313,7 @@ var GuildsAPI = class {
|
|
|
1400
1313
|
* @param options - The options for fetching the emoji
|
|
1401
1314
|
*/
|
|
1402
1315
|
async getEmoji(guildId, emojiId, { signal } = {}) {
|
|
1403
|
-
return this.rest.get(
|
|
1316
|
+
return this.rest.get(import_v104.Routes.guildEmoji(guildId, emojiId), { signal });
|
|
1404
1317
|
}
|
|
1405
1318
|
/**
|
|
1406
1319
|
* Creates a new emoji for a guild
|
|
@@ -1411,7 +1324,7 @@ var GuildsAPI = class {
|
|
|
1411
1324
|
* @param options - The options for creating the emoji
|
|
1412
1325
|
*/
|
|
1413
1326
|
async createEmoji(guildId, body, { reason, signal } = {}) {
|
|
1414
|
-
return this.rest.post(
|
|
1327
|
+
return this.rest.post(import_v104.Routes.guildEmojis(guildId), {
|
|
1415
1328
|
reason,
|
|
1416
1329
|
body,
|
|
1417
1330
|
signal
|
|
@@ -1427,7 +1340,7 @@ var GuildsAPI = class {
|
|
|
1427
1340
|
* @param options - The options for editing the emoji
|
|
1428
1341
|
*/
|
|
1429
1342
|
async editEmoji(guildId, emojiId, body, { reason, signal } = {}) {
|
|
1430
|
-
return this.rest.patch(
|
|
1343
|
+
return this.rest.patch(import_v104.Routes.guildEmoji(guildId, emojiId), {
|
|
1431
1344
|
reason,
|
|
1432
1345
|
body,
|
|
1433
1346
|
signal
|
|
@@ -1442,7 +1355,7 @@ var GuildsAPI = class {
|
|
|
1442
1355
|
* @param options - The options for deleting the emoji
|
|
1443
1356
|
*/
|
|
1444
1357
|
async deleteEmoji(guildId, emojiId, { reason, signal } = {}) {
|
|
1445
|
-
await this.rest.delete(
|
|
1358
|
+
await this.rest.delete(import_v104.Routes.guildEmoji(guildId, emojiId), { reason, signal });
|
|
1446
1359
|
}
|
|
1447
1360
|
/**
|
|
1448
1361
|
* Fetches all scheduled events for a guild
|
|
@@ -1453,7 +1366,7 @@ var GuildsAPI = class {
|
|
|
1453
1366
|
* @param options - The options for fetching the scheduled events
|
|
1454
1367
|
*/
|
|
1455
1368
|
async getScheduledEvents(guildId, query = {}, { signal } = {}) {
|
|
1456
|
-
return this.rest.get(
|
|
1369
|
+
return this.rest.get(import_v104.Routes.guildScheduledEvents(guildId), {
|
|
1457
1370
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1458
1371
|
signal
|
|
1459
1372
|
});
|
|
@@ -1467,7 +1380,7 @@ var GuildsAPI = class {
|
|
|
1467
1380
|
* @param options - The options for creating the scheduled event
|
|
1468
1381
|
*/
|
|
1469
1382
|
async createScheduledEvent(guildId, body, { reason, signal } = {}) {
|
|
1470
|
-
return this.rest.post(
|
|
1383
|
+
return this.rest.post(import_v104.Routes.guildScheduledEvents(guildId), {
|
|
1471
1384
|
reason,
|
|
1472
1385
|
body,
|
|
1473
1386
|
signal
|
|
@@ -1483,7 +1396,7 @@ var GuildsAPI = class {
|
|
|
1483
1396
|
* @param options - The options for fetching the scheduled event
|
|
1484
1397
|
*/
|
|
1485
1398
|
async getScheduledEvent(guildId, eventId, query = {}, { signal } = {}) {
|
|
1486
|
-
return this.rest.get(
|
|
1399
|
+
return this.rest.get(import_v104.Routes.guildScheduledEvent(guildId, eventId), {
|
|
1487
1400
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1488
1401
|
signal
|
|
1489
1402
|
});
|
|
@@ -1498,7 +1411,7 @@ var GuildsAPI = class {
|
|
|
1498
1411
|
* @param options - The options for editing the scheduled event
|
|
1499
1412
|
*/
|
|
1500
1413
|
async editScheduledEvent(guildId, eventId, body, { reason, signal } = {}) {
|
|
1501
|
-
return this.rest.patch(
|
|
1414
|
+
return this.rest.patch(import_v104.Routes.guildScheduledEvent(guildId, eventId), {
|
|
1502
1415
|
reason,
|
|
1503
1416
|
body,
|
|
1504
1417
|
signal
|
|
@@ -1513,7 +1426,7 @@ var GuildsAPI = class {
|
|
|
1513
1426
|
* @param options - The options for deleting the scheduled event
|
|
1514
1427
|
*/
|
|
1515
1428
|
async deleteScheduledEvent(guildId, eventId, { reason, signal } = {}) {
|
|
1516
|
-
await this.rest.delete(
|
|
1429
|
+
await this.rest.delete(import_v104.Routes.guildScheduledEvent(guildId, eventId), { reason, signal });
|
|
1517
1430
|
}
|
|
1518
1431
|
/**
|
|
1519
1432
|
* Gets all users that are interested in a scheduled event
|
|
@@ -1525,7 +1438,7 @@ var GuildsAPI = class {
|
|
|
1525
1438
|
* @param options - The options for fetching the scheduled event users
|
|
1526
1439
|
*/
|
|
1527
1440
|
async getScheduledEventUsers(guildId, eventId, query = {}, { signal } = {}) {
|
|
1528
|
-
return this.rest.get(
|
|
1441
|
+
return this.rest.get(import_v104.Routes.guildScheduledEventUsers(guildId, eventId), {
|
|
1529
1442
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1530
1443
|
signal
|
|
1531
1444
|
});
|
|
@@ -1538,7 +1451,7 @@ var GuildsAPI = class {
|
|
|
1538
1451
|
* @param options - The options for fetching the templates
|
|
1539
1452
|
*/
|
|
1540
1453
|
async getTemplates(guildId, { signal } = {}) {
|
|
1541
|
-
return this.rest.get(
|
|
1454
|
+
return this.rest.get(import_v104.Routes.guildTemplates(guildId), { signal });
|
|
1542
1455
|
}
|
|
1543
1456
|
/**
|
|
1544
1457
|
* Syncs a template for a guild
|
|
@@ -1549,7 +1462,7 @@ var GuildsAPI = class {
|
|
|
1549
1462
|
* @param options - The options for syncing the template
|
|
1550
1463
|
*/
|
|
1551
1464
|
async syncTemplate(guildId, templateCode, { signal } = {}) {
|
|
1552
|
-
return this.rest.put(
|
|
1465
|
+
return this.rest.put(import_v104.Routes.guildTemplate(guildId, templateCode), {
|
|
1553
1466
|
signal
|
|
1554
1467
|
});
|
|
1555
1468
|
}
|
|
@@ -1563,7 +1476,7 @@ var GuildsAPI = class {
|
|
|
1563
1476
|
* @param options - The options for editing the template
|
|
1564
1477
|
*/
|
|
1565
1478
|
async editTemplate(guildId, templateCode, body, { signal } = {}) {
|
|
1566
|
-
return this.rest.patch(
|
|
1479
|
+
return this.rest.patch(import_v104.Routes.guildTemplate(guildId, templateCode), {
|
|
1567
1480
|
body,
|
|
1568
1481
|
signal
|
|
1569
1482
|
});
|
|
@@ -1577,7 +1490,7 @@ var GuildsAPI = class {
|
|
|
1577
1490
|
* @param options - The options for deleting the template
|
|
1578
1491
|
*/
|
|
1579
1492
|
async deleteTemplate(guildId, templateCode, { signal } = {}) {
|
|
1580
|
-
await this.rest.delete(
|
|
1493
|
+
await this.rest.delete(import_v104.Routes.guildTemplate(guildId, templateCode), { signal });
|
|
1581
1494
|
}
|
|
1582
1495
|
/**
|
|
1583
1496
|
* Fetches all the stickers for a guild
|
|
@@ -1587,7 +1500,7 @@ var GuildsAPI = class {
|
|
|
1587
1500
|
* @param options - The options for fetching the stickers
|
|
1588
1501
|
*/
|
|
1589
1502
|
async getStickers(guildId, { signal } = {}) {
|
|
1590
|
-
return this.rest.get(
|
|
1503
|
+
return this.rest.get(import_v104.Routes.guildStickers(guildId), { signal });
|
|
1591
1504
|
}
|
|
1592
1505
|
/**
|
|
1593
1506
|
* Fetches a sticker for a guild
|
|
@@ -1598,7 +1511,7 @@ var GuildsAPI = class {
|
|
|
1598
1511
|
* @param options - The options for fetching the sticker
|
|
1599
1512
|
*/
|
|
1600
1513
|
async getSticker(guildId, stickerId, { signal } = {}) {
|
|
1601
|
-
return this.rest.get(
|
|
1514
|
+
return this.rest.get(import_v104.Routes.guildSticker(guildId, stickerId), { signal });
|
|
1602
1515
|
}
|
|
1603
1516
|
/**
|
|
1604
1517
|
* Creates a sticker for a guild
|
|
@@ -1610,7 +1523,7 @@ var GuildsAPI = class {
|
|
|
1610
1523
|
*/
|
|
1611
1524
|
async createSticker(guildId, { file, ...body }, { reason, signal } = {}) {
|
|
1612
1525
|
const fileData = { ...file, key: "file" };
|
|
1613
|
-
return this.rest.post(
|
|
1526
|
+
return this.rest.post(import_v104.Routes.guildStickers(guildId), {
|
|
1614
1527
|
appendToFormData: true,
|
|
1615
1528
|
body,
|
|
1616
1529
|
files: [fileData],
|
|
@@ -1628,7 +1541,7 @@ var GuildsAPI = class {
|
|
|
1628
1541
|
* @param options - The options for editing the sticker
|
|
1629
1542
|
*/
|
|
1630
1543
|
async editSticker(guildId, stickerId, body, { reason, signal } = {}) {
|
|
1631
|
-
return this.rest.patch(
|
|
1544
|
+
return this.rest.patch(import_v104.Routes.guildSticker(guildId, stickerId), {
|
|
1632
1545
|
reason,
|
|
1633
1546
|
body,
|
|
1634
1547
|
signal
|
|
@@ -1643,7 +1556,7 @@ var GuildsAPI = class {
|
|
|
1643
1556
|
* @param options - The options for deleting the sticker
|
|
1644
1557
|
*/
|
|
1645
1558
|
async deleteSticker(guildId, stickerId, { reason, signal } = {}) {
|
|
1646
|
-
await this.rest.delete(
|
|
1559
|
+
await this.rest.delete(import_v104.Routes.guildSticker(guildId, stickerId), { reason, signal });
|
|
1647
1560
|
}
|
|
1648
1561
|
/**
|
|
1649
1562
|
* Fetches the audit logs for a guild
|
|
@@ -1654,7 +1567,7 @@ var GuildsAPI = class {
|
|
|
1654
1567
|
* @param options - The options for fetching the audit logs
|
|
1655
1568
|
*/
|
|
1656
1569
|
async getAuditLogs(guildId, query = {}, { signal } = {}) {
|
|
1657
|
-
return this.rest.get(
|
|
1570
|
+
return this.rest.get(import_v104.Routes.guildAuditLog(guildId), {
|
|
1658
1571
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1659
1572
|
signal
|
|
1660
1573
|
});
|
|
@@ -1667,7 +1580,7 @@ var GuildsAPI = class {
|
|
|
1667
1580
|
* @param options - The options for fetching the auto moderation rules
|
|
1668
1581
|
*/
|
|
1669
1582
|
async getAutoModerationRules(guildId, { signal } = {}) {
|
|
1670
|
-
return this.rest.get(
|
|
1583
|
+
return this.rest.get(import_v104.Routes.guildAutoModerationRules(guildId), {
|
|
1671
1584
|
signal
|
|
1672
1585
|
});
|
|
1673
1586
|
}
|
|
@@ -1680,7 +1593,7 @@ var GuildsAPI = class {
|
|
|
1680
1593
|
* @param options - The options for fetching the auto moderation rule
|
|
1681
1594
|
*/
|
|
1682
1595
|
async getAutoModerationRule(guildId, ruleId, { signal } = {}) {
|
|
1683
|
-
return this.rest.get(
|
|
1596
|
+
return this.rest.get(import_v104.Routes.guildAutoModerationRule(guildId, ruleId), {
|
|
1684
1597
|
signal
|
|
1685
1598
|
});
|
|
1686
1599
|
}
|
|
@@ -1693,7 +1606,7 @@ var GuildsAPI = class {
|
|
|
1693
1606
|
* @param options - The options for creating the auto moderation rule
|
|
1694
1607
|
*/
|
|
1695
1608
|
async createAutoModerationRule(guildId, body, { reason, signal } = {}) {
|
|
1696
|
-
return this.rest.post(
|
|
1609
|
+
return this.rest.post(import_v104.Routes.guildAutoModerationRules(guildId), {
|
|
1697
1610
|
reason,
|
|
1698
1611
|
body,
|
|
1699
1612
|
signal
|
|
@@ -1709,7 +1622,7 @@ var GuildsAPI = class {
|
|
|
1709
1622
|
* @param options - The options for editing the auto moderation rule
|
|
1710
1623
|
*/
|
|
1711
1624
|
async editAutoModerationRule(guildId, ruleId, body, { reason, signal } = {}) {
|
|
1712
|
-
return this.rest.patch(
|
|
1625
|
+
return this.rest.patch(import_v104.Routes.guildAutoModerationRule(guildId, ruleId), {
|
|
1713
1626
|
reason,
|
|
1714
1627
|
body,
|
|
1715
1628
|
signal
|
|
@@ -1724,7 +1637,7 @@ var GuildsAPI = class {
|
|
|
1724
1637
|
* @param options - The options for deleting the auto moderation rule
|
|
1725
1638
|
*/
|
|
1726
1639
|
async deleteAutoModerationRule(guildId, ruleId, { reason, signal } = {}) {
|
|
1727
|
-
await this.rest.delete(
|
|
1640
|
+
await this.rest.delete(import_v104.Routes.guildAutoModerationRule(guildId, ruleId), { reason, signal });
|
|
1728
1641
|
}
|
|
1729
1642
|
/**
|
|
1730
1643
|
* Fetches a guild member
|
|
@@ -1735,7 +1648,7 @@ var GuildsAPI = class {
|
|
|
1735
1648
|
* @param options - The options for fetching the guild member
|
|
1736
1649
|
*/
|
|
1737
1650
|
async getMember(guildId, userId, { signal } = {}) {
|
|
1738
|
-
return this.rest.get(
|
|
1651
|
+
return this.rest.get(import_v104.Routes.guildMember(guildId, userId), { signal });
|
|
1739
1652
|
}
|
|
1740
1653
|
/**
|
|
1741
1654
|
* Searches for guild members
|
|
@@ -1746,7 +1659,7 @@ var GuildsAPI = class {
|
|
|
1746
1659
|
* @param options - The options for searching for guild members
|
|
1747
1660
|
*/
|
|
1748
1661
|
async searchForMembers(guildId, query, { signal } = {}) {
|
|
1749
|
-
return this.rest.get(
|
|
1662
|
+
return this.rest.get(import_v104.Routes.guildMembersSearch(guildId), {
|
|
1750
1663
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1751
1664
|
signal
|
|
1752
1665
|
});
|
|
@@ -1761,7 +1674,7 @@ var GuildsAPI = class {
|
|
|
1761
1674
|
* @param options - The options for editing the guild member
|
|
1762
1675
|
*/
|
|
1763
1676
|
async editMember(guildId, userId, body = {}, { reason, signal } = {}) {
|
|
1764
|
-
return this.rest.patch(
|
|
1677
|
+
return this.rest.patch(import_v104.Routes.guildMember(guildId, userId), {
|
|
1765
1678
|
reason,
|
|
1766
1679
|
body,
|
|
1767
1680
|
signal
|
|
@@ -1776,7 +1689,7 @@ var GuildsAPI = class {
|
|
|
1776
1689
|
* @param options - The options for removing the guild member
|
|
1777
1690
|
*/
|
|
1778
1691
|
async removeMember(guildId, userId, { reason, signal } = {}) {
|
|
1779
|
-
return this.rest.delete(
|
|
1692
|
+
return this.rest.delete(import_v104.Routes.guildMember(guildId, userId), { reason, signal });
|
|
1780
1693
|
}
|
|
1781
1694
|
/**
|
|
1782
1695
|
* Adds a role to a guild member
|
|
@@ -1788,7 +1701,7 @@ var GuildsAPI = class {
|
|
|
1788
1701
|
* @param options - The options for adding a role to a guild member
|
|
1789
1702
|
*/
|
|
1790
1703
|
async addRoleToMember(guildId, userId, roleId, { reason, signal } = {}) {
|
|
1791
|
-
await this.rest.put(
|
|
1704
|
+
await this.rest.put(import_v104.Routes.guildMemberRole(guildId, userId, roleId), { reason, signal });
|
|
1792
1705
|
}
|
|
1793
1706
|
/**
|
|
1794
1707
|
* Removes a role from a guild member
|
|
@@ -1800,7 +1713,7 @@ var GuildsAPI = class {
|
|
|
1800
1713
|
* @param options - The options for removing a role from a guild member
|
|
1801
1714
|
*/
|
|
1802
1715
|
async removeRoleFromMember(guildId, userId, roleId, { reason, signal } = {}) {
|
|
1803
|
-
await this.rest.delete(
|
|
1716
|
+
await this.rest.delete(import_v104.Routes.guildMemberRole(guildId, userId, roleId), { reason, signal });
|
|
1804
1717
|
}
|
|
1805
1718
|
/**
|
|
1806
1719
|
* Fetches a guild template
|
|
@@ -1810,7 +1723,7 @@ var GuildsAPI = class {
|
|
|
1810
1723
|
* @param options - The options for fetching the guild template
|
|
1811
1724
|
*/
|
|
1812
1725
|
async getTemplate(templateCode, { signal } = {}) {
|
|
1813
|
-
return this.rest.get(
|
|
1726
|
+
return this.rest.get(import_v104.Routes.template(templateCode), { signal });
|
|
1814
1727
|
}
|
|
1815
1728
|
/**
|
|
1816
1729
|
* Creates a new template
|
|
@@ -1821,7 +1734,7 @@ var GuildsAPI = class {
|
|
|
1821
1734
|
* @param options - The options for creating the template
|
|
1822
1735
|
*/
|
|
1823
1736
|
async createTemplate(templateCode, body, { signal } = {}) {
|
|
1824
|
-
return this.rest.post(
|
|
1737
|
+
return this.rest.post(import_v104.Routes.template(templateCode), { body, signal });
|
|
1825
1738
|
}
|
|
1826
1739
|
/**
|
|
1827
1740
|
* Fetches webhooks for a guild
|
|
@@ -1830,19 +1743,7 @@ var GuildsAPI = class {
|
|
|
1830
1743
|
* @param id - The id of the guild
|
|
1831
1744
|
*/
|
|
1832
1745
|
async getWebhooks(id) {
|
|
1833
|
-
return this.rest.get(
|
|
1834
|
-
}
|
|
1835
|
-
/**
|
|
1836
|
-
* Sets the voice state for the current user
|
|
1837
|
-
*
|
|
1838
|
-
* @see {@link https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state}
|
|
1839
|
-
* @param guildId - The id of the guild
|
|
1840
|
-
* @param body - The data for setting the voice state
|
|
1841
|
-
* @param options - The options for setting the voice state
|
|
1842
|
-
* @deprecated Use {@link VoiceAPI.editVoiceState} instead
|
|
1843
|
-
*/
|
|
1844
|
-
async setVoiceState(guildId, body = {}, { signal } = {}) {
|
|
1845
|
-
return new VoiceAPI(this.rest).editVoiceState(guildId, body, { signal });
|
|
1746
|
+
return this.rest.get(import_v104.Routes.guildWebhooks(id));
|
|
1846
1747
|
}
|
|
1847
1748
|
/**
|
|
1848
1749
|
* Fetches a guild onboarding
|
|
@@ -1852,7 +1753,7 @@ var GuildsAPI = class {
|
|
|
1852
1753
|
* @param options - The options for fetching the guild onboarding
|
|
1853
1754
|
*/
|
|
1854
1755
|
async getOnboarding(guildId, { signal } = {}) {
|
|
1855
|
-
return this.rest.get(
|
|
1756
|
+
return this.rest.get(import_v104.Routes.guildOnboarding(guildId), { signal });
|
|
1856
1757
|
}
|
|
1857
1758
|
/**
|
|
1858
1759
|
* Edits a guild onboarding
|
|
@@ -1863,7 +1764,7 @@ var GuildsAPI = class {
|
|
|
1863
1764
|
* @param options - The options for editing the guild onboarding
|
|
1864
1765
|
*/
|
|
1865
1766
|
async editOnboarding(guildId, body, { reason, signal } = {}) {
|
|
1866
|
-
return this.rest.put(
|
|
1767
|
+
return this.rest.put(import_v104.Routes.guildOnboarding(guildId), {
|
|
1867
1768
|
reason,
|
|
1868
1769
|
body,
|
|
1869
1770
|
signal
|
|
@@ -1877,7 +1778,7 @@ var GuildsAPI = class {
|
|
|
1877
1778
|
* @param options - The options for fetching the soundboard sounds
|
|
1878
1779
|
*/
|
|
1879
1780
|
async getSoundboardSounds(guildId, { signal } = {}) {
|
|
1880
|
-
return this.rest.get(
|
|
1781
|
+
return this.rest.get(import_v104.Routes.guildSoundboardSounds(guildId), {
|
|
1881
1782
|
signal
|
|
1882
1783
|
});
|
|
1883
1784
|
}
|
|
@@ -1890,7 +1791,7 @@ var GuildsAPI = class {
|
|
|
1890
1791
|
* @param options - The options for fetching the soundboard sound
|
|
1891
1792
|
*/
|
|
1892
1793
|
async getSoundboardSound(guildId, soundId, { signal } = {}) {
|
|
1893
|
-
return this.rest.get(
|
|
1794
|
+
return this.rest.get(import_v104.Routes.guildSoundboardSound(guildId, soundId), {
|
|
1894
1795
|
signal
|
|
1895
1796
|
});
|
|
1896
1797
|
}
|
|
@@ -1903,7 +1804,7 @@ var GuildsAPI = class {
|
|
|
1903
1804
|
* @param options - The options for creating the soundboard sound
|
|
1904
1805
|
*/
|
|
1905
1806
|
async createSoundboardSound(guildId, body, { reason, signal } = {}) {
|
|
1906
|
-
return this.rest.post(
|
|
1807
|
+
return this.rest.post(import_v104.Routes.guildSoundboardSounds(guildId), {
|
|
1907
1808
|
body,
|
|
1908
1809
|
reason,
|
|
1909
1810
|
signal
|
|
@@ -1919,7 +1820,7 @@ var GuildsAPI = class {
|
|
|
1919
1820
|
* @param options - The options for editing the soundboard sound
|
|
1920
1821
|
*/
|
|
1921
1822
|
async editSoundboardSound(guildId, soundId, body, { reason, signal } = {}) {
|
|
1922
|
-
return this.rest.patch(
|
|
1823
|
+
return this.rest.patch(import_v104.Routes.guildSoundboardSound(guildId, soundId), {
|
|
1923
1824
|
body,
|
|
1924
1825
|
reason,
|
|
1925
1826
|
signal
|
|
@@ -1934,13 +1835,13 @@ var GuildsAPI = class {
|
|
|
1934
1835
|
* @param options - The options for deleting the soundboard sound
|
|
1935
1836
|
*/
|
|
1936
1837
|
async deleteSoundboardSound(guildId, soundId, { reason, signal } = {}) {
|
|
1937
|
-
await this.rest.delete(
|
|
1838
|
+
await this.rest.delete(import_v104.Routes.guildSoundboardSound(guildId, soundId), { reason, signal });
|
|
1938
1839
|
}
|
|
1939
1840
|
};
|
|
1940
1841
|
|
|
1941
1842
|
// src/api/interactions.ts
|
|
1942
1843
|
var import_rest4 = require("@discordjs/rest");
|
|
1943
|
-
var
|
|
1844
|
+
var import_v105 = require("discord-api-types/v10");
|
|
1944
1845
|
var InteractionsAPI = class {
|
|
1945
1846
|
constructor(rest, webhooks) {
|
|
1946
1847
|
this.rest = rest;
|
|
@@ -1950,12 +1851,12 @@ var InteractionsAPI = class {
|
|
|
1950
1851
|
__name(this, "InteractionsAPI");
|
|
1951
1852
|
}
|
|
1952
1853
|
async reply(interactionId, interactionToken, { files, with_response, ...data }, { signal } = {}) {
|
|
1953
|
-
const response = await this.rest.post(
|
|
1854
|
+
const response = await this.rest.post(import_v105.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1954
1855
|
query: (0, import_rest4.makeURLSearchParams)({ with_response }),
|
|
1955
1856
|
files,
|
|
1956
1857
|
auth: false,
|
|
1957
1858
|
body: {
|
|
1958
|
-
type:
|
|
1859
|
+
type: import_v105.InteractionResponseType.ChannelMessageWithSource,
|
|
1959
1860
|
data
|
|
1960
1861
|
},
|
|
1961
1862
|
signal
|
|
@@ -1963,11 +1864,11 @@ var InteractionsAPI = class {
|
|
|
1963
1864
|
return with_response ? response : void 0;
|
|
1964
1865
|
}
|
|
1965
1866
|
async defer(interactionId, interactionToken, { with_response, ...data } = {}, { signal } = {}) {
|
|
1966
|
-
const response = await this.rest.post(
|
|
1867
|
+
const response = await this.rest.post(import_v105.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1967
1868
|
query: (0, import_rest4.makeURLSearchParams)({ with_response }),
|
|
1968
1869
|
auth: false,
|
|
1969
1870
|
body: {
|
|
1970
|
-
type:
|
|
1871
|
+
type: import_v105.InteractionResponseType.DeferredChannelMessageWithSource,
|
|
1971
1872
|
data
|
|
1972
1873
|
},
|
|
1973
1874
|
signal
|
|
@@ -1975,11 +1876,11 @@ var InteractionsAPI = class {
|
|
|
1975
1876
|
return with_response ? response : void 0;
|
|
1976
1877
|
}
|
|
1977
1878
|
async deferMessageUpdate(interactionId, interactionToken, { with_response } = {}, { signal } = {}) {
|
|
1978
|
-
const response = await this.rest.post(
|
|
1879
|
+
const response = await this.rest.post(import_v105.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1979
1880
|
query: (0, import_rest4.makeURLSearchParams)({ with_response }),
|
|
1980
1881
|
auth: false,
|
|
1981
1882
|
body: {
|
|
1982
|
-
type:
|
|
1883
|
+
type: import_v105.InteractionResponseType.DeferredMessageUpdate
|
|
1983
1884
|
},
|
|
1984
1885
|
signal
|
|
1985
1886
|
});
|
|
@@ -2044,12 +1945,12 @@ var InteractionsAPI = class {
|
|
|
2044
1945
|
await this.webhooks.deleteMessage(applicationId, interactionToken, messageId ?? "@original", {}, { signal });
|
|
2045
1946
|
}
|
|
2046
1947
|
async updateMessage(interactionId, interactionToken, { files, with_response, ...data }, { signal } = {}) {
|
|
2047
|
-
const response = await this.rest.post(
|
|
1948
|
+
const response = await this.rest.post(import_v105.Routes.interactionCallback(interactionId, interactionToken), {
|
|
2048
1949
|
query: (0, import_rest4.makeURLSearchParams)({ with_response }),
|
|
2049
1950
|
files,
|
|
2050
1951
|
auth: false,
|
|
2051
1952
|
body: {
|
|
2052
|
-
type:
|
|
1953
|
+
type: import_v105.InteractionResponseType.UpdateMessage,
|
|
2053
1954
|
data
|
|
2054
1955
|
},
|
|
2055
1956
|
signal
|
|
@@ -2057,11 +1958,11 @@ var InteractionsAPI = class {
|
|
|
2057
1958
|
return with_response ? response : void 0;
|
|
2058
1959
|
}
|
|
2059
1960
|
async createAutocompleteResponse(interactionId, interactionToken, { with_response, ...data }, { signal } = {}) {
|
|
2060
|
-
const response = await this.rest.post(
|
|
1961
|
+
const response = await this.rest.post(import_v105.Routes.interactionCallback(interactionId, interactionToken), {
|
|
2061
1962
|
query: (0, import_rest4.makeURLSearchParams)({ with_response }),
|
|
2062
1963
|
auth: false,
|
|
2063
1964
|
body: {
|
|
2064
|
-
type:
|
|
1965
|
+
type: import_v105.InteractionResponseType.ApplicationCommandAutocompleteResult,
|
|
2065
1966
|
data
|
|
2066
1967
|
},
|
|
2067
1968
|
signal
|
|
@@ -2069,40 +1970,22 @@ var InteractionsAPI = class {
|
|
|
2069
1970
|
return with_response ? response : void 0;
|
|
2070
1971
|
}
|
|
2071
1972
|
async createModal(interactionId, interactionToken, { with_response, ...data }, { signal } = {}) {
|
|
2072
|
-
const response = await this.rest.post(
|
|
1973
|
+
const response = await this.rest.post(import_v105.Routes.interactionCallback(interactionId, interactionToken), {
|
|
2073
1974
|
query: (0, import_rest4.makeURLSearchParams)({ with_response }),
|
|
2074
1975
|
auth: false,
|
|
2075
1976
|
body: {
|
|
2076
|
-
type:
|
|
1977
|
+
type: import_v105.InteractionResponseType.Modal,
|
|
2077
1978
|
data
|
|
2078
1979
|
},
|
|
2079
1980
|
signal
|
|
2080
1981
|
});
|
|
2081
1982
|
return with_response ? response : void 0;
|
|
2082
1983
|
}
|
|
2083
|
-
/**
|
|
2084
|
-
* Sends a premium required response to an interaction
|
|
2085
|
-
*
|
|
2086
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
2087
|
-
* @param interactionId - The id of the interaction
|
|
2088
|
-
* @param interactionToken - The token of the interaction
|
|
2089
|
-
* @param options - The options for sending the premium required response
|
|
2090
|
-
* @deprecated Sending a premium-style button is the new Discord behavior.
|
|
2091
|
-
*/
|
|
2092
|
-
async sendPremiumRequired(interactionId, interactionToken, { signal } = {}) {
|
|
2093
|
-
await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
|
|
2094
|
-
auth: false,
|
|
2095
|
-
body: {
|
|
2096
|
-
type: import_v106.InteractionResponseType.PremiumRequired
|
|
2097
|
-
},
|
|
2098
|
-
signal
|
|
2099
|
-
});
|
|
2100
|
-
}
|
|
2101
1984
|
};
|
|
2102
1985
|
|
|
2103
1986
|
// src/api/invite.ts
|
|
2104
1987
|
var import_rest5 = require("@discordjs/rest");
|
|
2105
|
-
var
|
|
1988
|
+
var import_v106 = require("discord-api-types/v10");
|
|
2106
1989
|
var InvitesAPI = class {
|
|
2107
1990
|
constructor(rest) {
|
|
2108
1991
|
this.rest = rest;
|
|
@@ -2119,7 +2002,7 @@ var InvitesAPI = class {
|
|
|
2119
2002
|
* @param options - The options for fetching the invite
|
|
2120
2003
|
*/
|
|
2121
2004
|
async get(code, query = {}, { signal } = {}) {
|
|
2122
|
-
return this.rest.get(
|
|
2005
|
+
return this.rest.get(import_v106.Routes.invite(code), {
|
|
2123
2006
|
query: (0, import_rest5.makeURLSearchParams)(query),
|
|
2124
2007
|
signal
|
|
2125
2008
|
});
|
|
@@ -2132,13 +2015,13 @@ var InvitesAPI = class {
|
|
|
2132
2015
|
* @param options - The options for deleting the invite
|
|
2133
2016
|
*/
|
|
2134
2017
|
async delete(code, { reason, signal } = {}) {
|
|
2135
|
-
await this.rest.delete(
|
|
2018
|
+
await this.rest.delete(import_v106.Routes.invite(code), { reason, signal });
|
|
2136
2019
|
}
|
|
2137
2020
|
};
|
|
2138
2021
|
|
|
2139
2022
|
// src/api/monetization.ts
|
|
2140
2023
|
var import_rest6 = require("@discordjs/rest");
|
|
2141
|
-
var
|
|
2024
|
+
var import_v107 = require("discord-api-types/v10");
|
|
2142
2025
|
var MonetizationAPI = class {
|
|
2143
2026
|
constructor(rest) {
|
|
2144
2027
|
this.rest = rest;
|
|
@@ -2154,7 +2037,7 @@ var MonetizationAPI = class {
|
|
|
2154
2037
|
* @param options - The options for fetching the SKUs.
|
|
2155
2038
|
*/
|
|
2156
2039
|
async getSKUs(applicationId, { signal } = {}) {
|
|
2157
|
-
return this.rest.get(
|
|
2040
|
+
return this.rest.get(import_v107.Routes.skus(applicationId), { signal });
|
|
2158
2041
|
}
|
|
2159
2042
|
/**
|
|
2160
2043
|
* Fetches subscriptions for an SKU.
|
|
@@ -2165,7 +2048,7 @@ var MonetizationAPI = class {
|
|
|
2165
2048
|
* @param options - The options for fetching subscriptions
|
|
2166
2049
|
*/
|
|
2167
2050
|
async getSKUSubscriptions(skuId, query = {}, { signal } = {}) {
|
|
2168
|
-
return this.rest.get(
|
|
2051
|
+
return this.rest.get(import_v107.Routes.skuSubscriptions(skuId), {
|
|
2169
2052
|
signal,
|
|
2170
2053
|
query: (0, import_rest6.makeURLSearchParams)(query)
|
|
2171
2054
|
});
|
|
@@ -2179,7 +2062,7 @@ var MonetizationAPI = class {
|
|
|
2179
2062
|
* @param options - The options for fetching the subscription
|
|
2180
2063
|
*/
|
|
2181
2064
|
async getSKUSubscription(skuId, subscriptionId, { signal } = {}) {
|
|
2182
|
-
return this.rest.get(
|
|
2065
|
+
return this.rest.get(import_v107.Routes.skuSubscription(skuId, subscriptionId), {
|
|
2183
2066
|
signal
|
|
2184
2067
|
});
|
|
2185
2068
|
}
|
|
@@ -2192,7 +2075,7 @@ var MonetizationAPI = class {
|
|
|
2192
2075
|
* @param options - The options for fetching entitlements
|
|
2193
2076
|
*/
|
|
2194
2077
|
async getEntitlements(applicationId, query = {}, { signal } = {}) {
|
|
2195
|
-
return this.rest.get(
|
|
2078
|
+
return this.rest.get(import_v107.Routes.entitlements(applicationId), {
|
|
2196
2079
|
signal,
|
|
2197
2080
|
query: (0, import_rest6.makeURLSearchParams)(query)
|
|
2198
2081
|
});
|
|
@@ -2206,7 +2089,7 @@ var MonetizationAPI = class {
|
|
|
2206
2089
|
* @param options - The options for fetching the entitlement
|
|
2207
2090
|
*/
|
|
2208
2091
|
async getEntitlement(applicationId, entitlementId, { signal } = {}) {
|
|
2209
|
-
return this.rest.get(
|
|
2092
|
+
return this.rest.get(import_v107.Routes.entitlement(applicationId, entitlementId), {
|
|
2210
2093
|
signal
|
|
2211
2094
|
});
|
|
2212
2095
|
}
|
|
@@ -2219,7 +2102,7 @@ var MonetizationAPI = class {
|
|
|
2219
2102
|
* @param options - The options for creating the entitlement
|
|
2220
2103
|
*/
|
|
2221
2104
|
async createTestEntitlement(applicationId, body, { signal } = {}) {
|
|
2222
|
-
return this.rest.post(
|
|
2105
|
+
return this.rest.post(import_v107.Routes.entitlements(applicationId), {
|
|
2223
2106
|
body,
|
|
2224
2107
|
signal
|
|
2225
2108
|
});
|
|
@@ -2233,7 +2116,7 @@ var MonetizationAPI = class {
|
|
|
2233
2116
|
* @param options - The options for deleting the entitlement
|
|
2234
2117
|
*/
|
|
2235
2118
|
async deleteTestEntitlement(applicationId, entitlementId, { signal } = {}) {
|
|
2236
|
-
await this.rest.delete(
|
|
2119
|
+
await this.rest.delete(import_v107.Routes.entitlement(applicationId, entitlementId), { signal });
|
|
2237
2120
|
}
|
|
2238
2121
|
/**
|
|
2239
2122
|
* Marks a given entitlement for the user as consumed. Only available for One-Time Purchase consumable SKUs.
|
|
@@ -2244,13 +2127,13 @@ var MonetizationAPI = class {
|
|
|
2244
2127
|
* @param options - The options for consuming the entitlement
|
|
2245
2128
|
*/
|
|
2246
2129
|
async consumeEntitlement(applicationId, entitlementId, { signal } = {}) {
|
|
2247
|
-
await this.rest.post(
|
|
2130
|
+
await this.rest.post(import_v107.Routes.consumeEntitlement(applicationId, entitlementId), { signal });
|
|
2248
2131
|
}
|
|
2249
2132
|
};
|
|
2250
2133
|
|
|
2251
2134
|
// src/api/oauth2.ts
|
|
2252
2135
|
var import_rest7 = require("@discordjs/rest");
|
|
2253
|
-
var
|
|
2136
|
+
var import_v108 = require("discord-api-types/v10");
|
|
2254
2137
|
var OAuth2API = class {
|
|
2255
2138
|
constructor(rest) {
|
|
2256
2139
|
this.rest = rest;
|
|
@@ -2265,7 +2148,7 @@ var OAuth2API = class {
|
|
|
2265
2148
|
* @param options - The options for creating the authorization URL
|
|
2266
2149
|
*/
|
|
2267
2150
|
generateAuthorizationURL(options) {
|
|
2268
|
-
const url = new URL(`${
|
|
2151
|
+
const url = new URL(`${import_v108.RouteBases.api}${import_v108.Routes.oauth2Authorization()}`);
|
|
2269
2152
|
url.search = (0, import_rest7.makeURLSearchParams)(options).toString();
|
|
2270
2153
|
return url.toString();
|
|
2271
2154
|
}
|
|
@@ -2277,7 +2160,7 @@ var OAuth2API = class {
|
|
|
2277
2160
|
* @param options - The options for the token exchange request
|
|
2278
2161
|
*/
|
|
2279
2162
|
async tokenExchange(body, { signal } = {}) {
|
|
2280
|
-
return this.rest.post(
|
|
2163
|
+
return this.rest.post(import_v108.Routes.oauth2TokenExchange(), {
|
|
2281
2164
|
body: (0, import_rest7.makeURLSearchParams)(body),
|
|
2282
2165
|
passThroughBody: true,
|
|
2283
2166
|
headers: {
|
|
@@ -2295,7 +2178,7 @@ var OAuth2API = class {
|
|
|
2295
2178
|
* @param options - The options for the refresh token request
|
|
2296
2179
|
*/
|
|
2297
2180
|
async refreshToken(body, { signal } = {}) {
|
|
2298
|
-
return this.rest.post(
|
|
2181
|
+
return this.rest.post(import_v108.Routes.oauth2TokenExchange(), {
|
|
2299
2182
|
body: (0, import_rest7.makeURLSearchParams)(body),
|
|
2300
2183
|
passThroughBody: true,
|
|
2301
2184
|
headers: {
|
|
@@ -2315,7 +2198,7 @@ var OAuth2API = class {
|
|
|
2315
2198
|
* @param options - The options for the client credentials grant request
|
|
2316
2199
|
*/
|
|
2317
2200
|
async getToken(body, { signal } = {}) {
|
|
2318
|
-
return this.rest.post(
|
|
2201
|
+
return this.rest.post(import_v108.Routes.oauth2TokenExchange(), {
|
|
2319
2202
|
body: (0, import_rest7.makeURLSearchParams)(body),
|
|
2320
2203
|
passThroughBody: true,
|
|
2321
2204
|
headers: {
|
|
@@ -2332,7 +2215,7 @@ var OAuth2API = class {
|
|
|
2332
2215
|
* @param options - The options for the current bot application information request
|
|
2333
2216
|
*/
|
|
2334
2217
|
async getCurrentBotApplicationInformation({ signal } = {}) {
|
|
2335
|
-
return this.rest.get(
|
|
2218
|
+
return this.rest.get(import_v108.Routes.oauth2CurrentApplication(), {
|
|
2336
2219
|
signal
|
|
2337
2220
|
});
|
|
2338
2221
|
}
|
|
@@ -2343,7 +2226,7 @@ var OAuth2API = class {
|
|
|
2343
2226
|
* @param options - The options for the current authorization information request
|
|
2344
2227
|
*/
|
|
2345
2228
|
async getCurrentAuthorizationInformation({ signal } = {}) {
|
|
2346
|
-
return this.rest.get(
|
|
2229
|
+
return this.rest.get(import_v108.Routes.oauth2CurrentAuthorization(), {
|
|
2347
2230
|
signal
|
|
2348
2231
|
});
|
|
2349
2232
|
}
|
|
@@ -2357,7 +2240,7 @@ var OAuth2API = class {
|
|
|
2357
2240
|
* @param options - The options for the token revocation request
|
|
2358
2241
|
*/
|
|
2359
2242
|
async revokeToken(applicationId, applicationSecret, body, { signal } = {}) {
|
|
2360
|
-
await this.rest.post(
|
|
2243
|
+
await this.rest.post(import_v108.Routes.oauth2TokenRevocation(), {
|
|
2361
2244
|
body: (0, import_rest7.makeURLSearchParams)(body),
|
|
2362
2245
|
passThroughBody: true,
|
|
2363
2246
|
headers: {
|
|
@@ -2372,7 +2255,7 @@ var OAuth2API = class {
|
|
|
2372
2255
|
|
|
2373
2256
|
// src/api/poll.ts
|
|
2374
2257
|
var import_rest8 = require("@discordjs/rest");
|
|
2375
|
-
var
|
|
2258
|
+
var import_v109 = require("discord-api-types/v10");
|
|
2376
2259
|
var PollAPI = class {
|
|
2377
2260
|
constructor(rest) {
|
|
2378
2261
|
this.rest = rest;
|
|
@@ -2391,7 +2274,7 @@ var PollAPI = class {
|
|
|
2391
2274
|
* @param options - The options for getting the list of voters
|
|
2392
2275
|
*/
|
|
2393
2276
|
async getAnswerVoters(channelId, messageId, answerId, query = {}, { signal } = {}) {
|
|
2394
|
-
return this.rest.get(
|
|
2277
|
+
return this.rest.get(import_v109.Routes.pollAnswerVoters(channelId, messageId, answerId), {
|
|
2395
2278
|
signal,
|
|
2396
2279
|
query: (0, import_rest8.makeURLSearchParams)(query)
|
|
2397
2280
|
});
|
|
@@ -2405,14 +2288,14 @@ var PollAPI = class {
|
|
|
2405
2288
|
* @param options - The options for expiring the poll
|
|
2406
2289
|
*/
|
|
2407
2290
|
async expirePoll(channelId, messageId, { signal } = {}) {
|
|
2408
|
-
return this.rest.post(
|
|
2291
|
+
return this.rest.post(import_v109.Routes.expirePoll(channelId, messageId), {
|
|
2409
2292
|
signal
|
|
2410
2293
|
});
|
|
2411
2294
|
}
|
|
2412
2295
|
};
|
|
2413
2296
|
|
|
2414
2297
|
// src/api/roleConnections.ts
|
|
2415
|
-
var
|
|
2298
|
+
var import_v1010 = require("discord-api-types/v10");
|
|
2416
2299
|
var RoleConnectionsAPI = class {
|
|
2417
2300
|
constructor(rest) {
|
|
2418
2301
|
this.rest = rest;
|
|
@@ -2428,7 +2311,7 @@ var RoleConnectionsAPI = class {
|
|
|
2428
2311
|
* @param options - The options for fetching the role connection metadata records
|
|
2429
2312
|
*/
|
|
2430
2313
|
async getMetadataRecords(applicationId, { signal } = {}) {
|
|
2431
|
-
return this.rest.get(
|
|
2314
|
+
return this.rest.get(import_v1010.Routes.applicationRoleConnectionMetadata(applicationId), {
|
|
2432
2315
|
signal
|
|
2433
2316
|
});
|
|
2434
2317
|
}
|
|
@@ -2441,7 +2324,7 @@ var RoleConnectionsAPI = class {
|
|
|
2441
2324
|
* @param options - The options for updating the role connection metadata records
|
|
2442
2325
|
*/
|
|
2443
2326
|
async updateMetadataRecords(applicationId, body, { signal } = {}) {
|
|
2444
|
-
return this.rest.put(
|
|
2327
|
+
return this.rest.put(import_v1010.Routes.applicationRoleConnectionMetadata(applicationId), {
|
|
2445
2328
|
body,
|
|
2446
2329
|
signal
|
|
2447
2330
|
});
|
|
@@ -2449,7 +2332,7 @@ var RoleConnectionsAPI = class {
|
|
|
2449
2332
|
};
|
|
2450
2333
|
|
|
2451
2334
|
// src/api/soundboardSounds.ts
|
|
2452
|
-
var
|
|
2335
|
+
var import_v1011 = require("discord-api-types/v10");
|
|
2453
2336
|
var SoundboardSoundsAPI = class {
|
|
2454
2337
|
constructor(rest) {
|
|
2455
2338
|
this.rest = rest;
|
|
@@ -2464,14 +2347,14 @@ var SoundboardSoundsAPI = class {
|
|
|
2464
2347
|
* @param options - The options for fetching the soundboard default sounds.
|
|
2465
2348
|
*/
|
|
2466
2349
|
async getSoundboardDefaultSounds({ signal } = {}) {
|
|
2467
|
-
return this.rest.get(
|
|
2350
|
+
return this.rest.get(import_v1011.Routes.soundboardDefaultSounds(), {
|
|
2468
2351
|
signal
|
|
2469
2352
|
});
|
|
2470
2353
|
}
|
|
2471
2354
|
};
|
|
2472
2355
|
|
|
2473
2356
|
// src/api/stageInstances.ts
|
|
2474
|
-
var
|
|
2357
|
+
var import_v1012 = require("discord-api-types/v10");
|
|
2475
2358
|
var StageInstancesAPI = class {
|
|
2476
2359
|
constructor(rest) {
|
|
2477
2360
|
this.rest = rest;
|
|
@@ -2487,7 +2370,7 @@ var StageInstancesAPI = class {
|
|
|
2487
2370
|
* @param options - The options for creating the new stage instance
|
|
2488
2371
|
*/
|
|
2489
2372
|
async create(body, { reason, signal } = {}) {
|
|
2490
|
-
return this.rest.post(
|
|
2373
|
+
return this.rest.post(import_v1012.Routes.stageInstances(), {
|
|
2491
2374
|
body,
|
|
2492
2375
|
reason,
|
|
2493
2376
|
signal
|
|
@@ -2501,7 +2384,7 @@ var StageInstancesAPI = class {
|
|
|
2501
2384
|
* @param options - The options for fetching the stage instance
|
|
2502
2385
|
*/
|
|
2503
2386
|
async get(channelId, { signal } = {}) {
|
|
2504
|
-
return this.rest.get(
|
|
2387
|
+
return this.rest.get(import_v1012.Routes.stageInstance(channelId), { signal });
|
|
2505
2388
|
}
|
|
2506
2389
|
/**
|
|
2507
2390
|
* Edits a stage instance
|
|
@@ -2512,7 +2395,7 @@ var StageInstancesAPI = class {
|
|
|
2512
2395
|
* @param options - The options for editing the stage instance
|
|
2513
2396
|
*/
|
|
2514
2397
|
async edit(channelId, body, { reason, signal } = {}) {
|
|
2515
|
-
return this.rest.patch(
|
|
2398
|
+
return this.rest.patch(import_v1012.Routes.stageInstance(channelId), {
|
|
2516
2399
|
body,
|
|
2517
2400
|
reason,
|
|
2518
2401
|
signal
|
|
@@ -2526,12 +2409,12 @@ var StageInstancesAPI = class {
|
|
|
2526
2409
|
* @param options - The options for deleting the stage instance
|
|
2527
2410
|
*/
|
|
2528
2411
|
async delete(channelId, { reason, signal } = {}) {
|
|
2529
|
-
await this.rest.delete(
|
|
2412
|
+
await this.rest.delete(import_v1012.Routes.stageInstance(channelId), { reason, signal });
|
|
2530
2413
|
}
|
|
2531
2414
|
};
|
|
2532
2415
|
|
|
2533
2416
|
// src/api/sticker.ts
|
|
2534
|
-
var
|
|
2417
|
+
var import_v1013 = require("discord-api-types/v10");
|
|
2535
2418
|
var StickersAPI = class {
|
|
2536
2419
|
constructor(rest) {
|
|
2537
2420
|
this.rest = rest;
|
|
@@ -2547,7 +2430,7 @@ var StickersAPI = class {
|
|
|
2547
2430
|
* @param options - The options for fetching the sticker pack
|
|
2548
2431
|
*/
|
|
2549
2432
|
async getStickerPack(packId, { signal } = {}) {
|
|
2550
|
-
return this.rest.get(
|
|
2433
|
+
return this.rest.get(import_v1013.Routes.stickerPack(packId), { signal });
|
|
2551
2434
|
}
|
|
2552
2435
|
/**
|
|
2553
2436
|
* Fetches all of the sticker packs
|
|
@@ -2556,17 +2439,7 @@ var StickersAPI = class {
|
|
|
2556
2439
|
* @param options - The options for fetching the sticker packs
|
|
2557
2440
|
*/
|
|
2558
2441
|
async getStickers({ signal } = {}) {
|
|
2559
|
-
return this.rest.get(
|
|
2560
|
-
}
|
|
2561
|
-
/**
|
|
2562
|
-
* Fetches all of the sticker packs
|
|
2563
|
-
*
|
|
2564
|
-
* @see {@link https://discord.com/developers/docs/resources/sticker#list-sticker-packs}
|
|
2565
|
-
* @param options - The options for fetching the sticker packs
|
|
2566
|
-
* @deprecated Use {@link StickersAPI.getStickers} instead.
|
|
2567
|
-
*/
|
|
2568
|
-
async getNitroStickers(options = {}) {
|
|
2569
|
-
return this.getStickers(options);
|
|
2442
|
+
return this.rest.get(import_v1013.Routes.stickerPacks(), { signal });
|
|
2570
2443
|
}
|
|
2571
2444
|
/**
|
|
2572
2445
|
* Fetches a sticker
|
|
@@ -2576,12 +2449,12 @@ var StickersAPI = class {
|
|
|
2576
2449
|
* @param options - The options for fetching the sticker
|
|
2577
2450
|
*/
|
|
2578
2451
|
async get(stickerId, { signal } = {}) {
|
|
2579
|
-
return this.rest.get(
|
|
2452
|
+
return this.rest.get(import_v1013.Routes.sticker(stickerId), { signal });
|
|
2580
2453
|
}
|
|
2581
2454
|
};
|
|
2582
2455
|
|
|
2583
2456
|
// src/api/thread.ts
|
|
2584
|
-
var
|
|
2457
|
+
var import_v1014 = require("discord-api-types/v10");
|
|
2585
2458
|
var ThreadsAPI = class {
|
|
2586
2459
|
constructor(rest) {
|
|
2587
2460
|
this.rest = rest;
|
|
@@ -2597,7 +2470,7 @@ var ThreadsAPI = class {
|
|
|
2597
2470
|
* @param options - The options for joining the thread
|
|
2598
2471
|
*/
|
|
2599
2472
|
async join(threadId, { signal } = {}) {
|
|
2600
|
-
await this.rest.put(
|
|
2473
|
+
await this.rest.put(import_v1014.Routes.threadMembers(threadId, "@me"), { signal });
|
|
2601
2474
|
}
|
|
2602
2475
|
/**
|
|
2603
2476
|
* Adds a member to a thread
|
|
@@ -2608,7 +2481,7 @@ var ThreadsAPI = class {
|
|
|
2608
2481
|
* @param options - The options for adding the member to the thread
|
|
2609
2482
|
*/
|
|
2610
2483
|
async addMember(threadId, userId, { signal } = {}) {
|
|
2611
|
-
await this.rest.put(
|
|
2484
|
+
await this.rest.put(import_v1014.Routes.threadMembers(threadId, userId), { signal });
|
|
2612
2485
|
}
|
|
2613
2486
|
/**
|
|
2614
2487
|
* Removes the current user from a thread
|
|
@@ -2618,7 +2491,7 @@ var ThreadsAPI = class {
|
|
|
2618
2491
|
* @param options - The options for leaving the thread
|
|
2619
2492
|
*/
|
|
2620
2493
|
async leave(threadId, { signal } = {}) {
|
|
2621
|
-
await this.rest.delete(
|
|
2494
|
+
await this.rest.delete(import_v1014.Routes.threadMembers(threadId, "@me"), { signal });
|
|
2622
2495
|
}
|
|
2623
2496
|
/**
|
|
2624
2497
|
* Removes a member from a thread
|
|
@@ -2629,7 +2502,7 @@ var ThreadsAPI = class {
|
|
|
2629
2502
|
* @param options - The options for removing the member from the thread
|
|
2630
2503
|
*/
|
|
2631
2504
|
async removeMember(threadId, userId, { signal } = {}) {
|
|
2632
|
-
await this.rest.delete(
|
|
2505
|
+
await this.rest.delete(import_v1014.Routes.threadMembers(threadId, userId), { signal });
|
|
2633
2506
|
}
|
|
2634
2507
|
/**
|
|
2635
2508
|
* Fetches a member of a thread
|
|
@@ -2640,7 +2513,7 @@ var ThreadsAPI = class {
|
|
|
2640
2513
|
* @param options - The options for fetching the member
|
|
2641
2514
|
*/
|
|
2642
2515
|
async getMember(threadId, userId, { signal } = {}) {
|
|
2643
|
-
return this.rest.get(
|
|
2516
|
+
return this.rest.get(import_v1014.Routes.threadMembers(threadId, userId), { signal });
|
|
2644
2517
|
}
|
|
2645
2518
|
/**
|
|
2646
2519
|
* Fetches all members of a thread
|
|
@@ -2650,13 +2523,13 @@ var ThreadsAPI = class {
|
|
|
2650
2523
|
* @param options - The options for fetching the members
|
|
2651
2524
|
*/
|
|
2652
2525
|
async getAllMembers(threadId, { signal } = {}) {
|
|
2653
|
-
return this.rest.get(
|
|
2526
|
+
return this.rest.get(import_v1014.Routes.threadMembers(threadId), { signal });
|
|
2654
2527
|
}
|
|
2655
2528
|
};
|
|
2656
2529
|
|
|
2657
2530
|
// src/api/user.ts
|
|
2658
2531
|
var import_rest9 = require("@discordjs/rest");
|
|
2659
|
-
var
|
|
2532
|
+
var import_v1015 = require("discord-api-types/v10");
|
|
2660
2533
|
var UsersAPI = class {
|
|
2661
2534
|
constructor(rest) {
|
|
2662
2535
|
this.rest = rest;
|
|
@@ -2672,7 +2545,7 @@ var UsersAPI = class {
|
|
|
2672
2545
|
* @param options - The options for fetching the user
|
|
2673
2546
|
*/
|
|
2674
2547
|
async get(userId, { signal } = {}) {
|
|
2675
|
-
return this.rest.get(
|
|
2548
|
+
return this.rest.get(import_v1015.Routes.user(userId), { signal });
|
|
2676
2549
|
}
|
|
2677
2550
|
/**
|
|
2678
2551
|
* Returns the user object of the requester's account
|
|
@@ -2681,7 +2554,7 @@ var UsersAPI = class {
|
|
|
2681
2554
|
* @param options - The options for fetching the current user
|
|
2682
2555
|
*/
|
|
2683
2556
|
async getCurrent({ signal } = {}) {
|
|
2684
|
-
return this.rest.get(
|
|
2557
|
+
return this.rest.get(import_v1015.Routes.user("@me"), { signal });
|
|
2685
2558
|
}
|
|
2686
2559
|
/**
|
|
2687
2560
|
* Returns a list of partial guild objects the current user is a member of
|
|
@@ -2691,7 +2564,7 @@ var UsersAPI = class {
|
|
|
2691
2564
|
* @param options - The options for fetching the guilds
|
|
2692
2565
|
*/
|
|
2693
2566
|
async getGuilds(query = {}, { signal } = {}) {
|
|
2694
|
-
return this.rest.get(
|
|
2567
|
+
return this.rest.get(import_v1015.Routes.userGuilds(), {
|
|
2695
2568
|
query: (0, import_rest9.makeURLSearchParams)(query),
|
|
2696
2569
|
signal
|
|
2697
2570
|
});
|
|
@@ -2704,7 +2577,7 @@ var UsersAPI = class {
|
|
|
2704
2577
|
* @param options - The options for leaving the guild
|
|
2705
2578
|
*/
|
|
2706
2579
|
async leaveGuild(guildId, { signal } = {}) {
|
|
2707
|
-
await this.rest.delete(
|
|
2580
|
+
await this.rest.delete(import_v1015.Routes.userGuild(guildId), { signal });
|
|
2708
2581
|
}
|
|
2709
2582
|
/**
|
|
2710
2583
|
* Edits the current user
|
|
@@ -2714,7 +2587,7 @@ var UsersAPI = class {
|
|
|
2714
2587
|
* @param options - The options for editing the user
|
|
2715
2588
|
*/
|
|
2716
2589
|
async edit(body, { signal } = {}) {
|
|
2717
|
-
return this.rest.patch(
|
|
2590
|
+
return this.rest.patch(import_v1015.Routes.user("@me"), { body, signal });
|
|
2718
2591
|
}
|
|
2719
2592
|
/**
|
|
2720
2593
|
* Fetches the guild member for the current user
|
|
@@ -2724,7 +2597,7 @@ var UsersAPI = class {
|
|
|
2724
2597
|
* @param options - The options for fetching the guild member
|
|
2725
2598
|
*/
|
|
2726
2599
|
async getGuildMember(guildId, { signal } = {}) {
|
|
2727
|
-
return this.rest.get(
|
|
2600
|
+
return this.rest.get(import_v1015.Routes.userGuildMember(guildId), { signal });
|
|
2728
2601
|
}
|
|
2729
2602
|
/**
|
|
2730
2603
|
* Edits the guild member for the current user
|
|
@@ -2735,7 +2608,7 @@ var UsersAPI = class {
|
|
|
2735
2608
|
* @param options - The options for editing the guild member
|
|
2736
2609
|
*/
|
|
2737
2610
|
async editCurrentGuildMember(guildId, body = {}, { reason, signal } = {}) {
|
|
2738
|
-
return this.rest.patch(
|
|
2611
|
+
return this.rest.patch(import_v1015.Routes.guildMember(guildId, "@me"), {
|
|
2739
2612
|
reason,
|
|
2740
2613
|
body,
|
|
2741
2614
|
signal
|
|
@@ -2749,7 +2622,7 @@ var UsersAPI = class {
|
|
|
2749
2622
|
* @param options - The options for opening the DM
|
|
2750
2623
|
*/
|
|
2751
2624
|
async createDM(userId, { signal } = {}) {
|
|
2752
|
-
return this.rest.post(
|
|
2625
|
+
return this.rest.post(import_v1015.Routes.userChannels(), {
|
|
2753
2626
|
body: { recipient_id: userId },
|
|
2754
2627
|
signal
|
|
2755
2628
|
});
|
|
@@ -2761,7 +2634,7 @@ var UsersAPI = class {
|
|
|
2761
2634
|
* @param options - The options for fetching the user's connections
|
|
2762
2635
|
*/
|
|
2763
2636
|
async getConnections({ signal } = {}) {
|
|
2764
|
-
return this.rest.get(
|
|
2637
|
+
return this.rest.get(import_v1015.Routes.userConnections(), { signal });
|
|
2765
2638
|
}
|
|
2766
2639
|
/**
|
|
2767
2640
|
* Gets the current user's active application role connection
|
|
@@ -2771,7 +2644,7 @@ var UsersAPI = class {
|
|
|
2771
2644
|
* @param options - The options for fetching the role connections
|
|
2772
2645
|
*/
|
|
2773
2646
|
async getApplicationRoleConnection(applicationId, { signal } = {}) {
|
|
2774
|
-
return this.rest.get(
|
|
2647
|
+
return this.rest.get(import_v1015.Routes.userApplicationRoleConnection(applicationId), {
|
|
2775
2648
|
signal
|
|
2776
2649
|
});
|
|
2777
2650
|
}
|
|
@@ -2784,7 +2657,79 @@ var UsersAPI = class {
|
|
|
2784
2657
|
* @param options - The options for updating the application role connection
|
|
2785
2658
|
*/
|
|
2786
2659
|
async updateApplicationRoleConnection(applicationId, body, { signal } = {}) {
|
|
2787
|
-
return this.rest.put(
|
|
2660
|
+
return this.rest.put(import_v1015.Routes.userApplicationRoleConnection(applicationId), {
|
|
2661
|
+
body,
|
|
2662
|
+
signal
|
|
2663
|
+
});
|
|
2664
|
+
}
|
|
2665
|
+
};
|
|
2666
|
+
|
|
2667
|
+
// src/api/voice.ts
|
|
2668
|
+
var import_v1016 = require("discord-api-types/v10");
|
|
2669
|
+
var VoiceAPI = class {
|
|
2670
|
+
constructor(rest) {
|
|
2671
|
+
this.rest = rest;
|
|
2672
|
+
}
|
|
2673
|
+
static {
|
|
2674
|
+
__name(this, "VoiceAPI");
|
|
2675
|
+
}
|
|
2676
|
+
/**
|
|
2677
|
+
* Fetches all voice regions
|
|
2678
|
+
*
|
|
2679
|
+
* @see {@link https://discord.com/developers/docs/resources/voice#list-voice-regions}
|
|
2680
|
+
* @param options - The options for fetching the voice regions
|
|
2681
|
+
*/
|
|
2682
|
+
async getVoiceRegions({ signal } = {}) {
|
|
2683
|
+
return this.rest.get(import_v1016.Routes.voiceRegions(), { signal });
|
|
2684
|
+
}
|
|
2685
|
+
/**
|
|
2686
|
+
* Fetches voice state of a user by their id
|
|
2687
|
+
*
|
|
2688
|
+
* @see {@link https://discord.com/developers/docs/resources/voice#get-user-voice-state}
|
|
2689
|
+
* @param options - The options for fetching user voice state
|
|
2690
|
+
*/
|
|
2691
|
+
async getUserVoiceState(guildId, userId, { signal } = {}) {
|
|
2692
|
+
return this.rest.get(import_v1016.Routes.guildVoiceState(guildId, userId), {
|
|
2693
|
+
signal
|
|
2694
|
+
});
|
|
2695
|
+
}
|
|
2696
|
+
/**
|
|
2697
|
+
* Fetches the current user's voice state
|
|
2698
|
+
*
|
|
2699
|
+
* @see {@link https://discord.com/developers/docs/resources/voice#get-current-user-voice-state}
|
|
2700
|
+
* @param options - The options for fetching user voice state
|
|
2701
|
+
*/
|
|
2702
|
+
async getVoiceState(guildId, { signal } = {}) {
|
|
2703
|
+
return this.rest.get(import_v1016.Routes.guildVoiceState(guildId, "@me"), {
|
|
2704
|
+
signal
|
|
2705
|
+
});
|
|
2706
|
+
}
|
|
2707
|
+
/**
|
|
2708
|
+
* Edits a user's voice state in a guild
|
|
2709
|
+
*
|
|
2710
|
+
* @see {@link https://discord.com/developers/docs/resources/voice#modify-user-voice-state}
|
|
2711
|
+
* @param guildId - The id of the guild to edit the current user's voice state in
|
|
2712
|
+
* @param userId - The id of the user to edit the voice state for
|
|
2713
|
+
* @param body - The data for editing the voice state
|
|
2714
|
+
* @param options - The options for editing the voice state
|
|
2715
|
+
*/
|
|
2716
|
+
async editUserVoiceState(guildId, userId, body, { reason, signal } = {}) {
|
|
2717
|
+
return this.rest.patch(import_v1016.Routes.guildVoiceState(guildId, userId), {
|
|
2718
|
+
reason,
|
|
2719
|
+
body,
|
|
2720
|
+
signal
|
|
2721
|
+
});
|
|
2722
|
+
}
|
|
2723
|
+
/**
|
|
2724
|
+
* Edits the voice state for the current user
|
|
2725
|
+
*
|
|
2726
|
+
* @see {@link https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state}
|
|
2727
|
+
* @param guildId - The id of the guild
|
|
2728
|
+
* @param body - The data for editing the voice state
|
|
2729
|
+
* @param options - The options for editing the voice state
|
|
2730
|
+
*/
|
|
2731
|
+
async editVoiceState(guildId, body = {}, { signal } = {}) {
|
|
2732
|
+
return this.rest.patch(import_v1016.Routes.guildVoiceState(guildId, "@me"), {
|
|
2788
2733
|
body,
|
|
2789
2734
|
signal
|
|
2790
2735
|
});
|
|
@@ -3166,7 +3111,7 @@ __name(withFiles, "withFiles");
|
|
|
3166
3111
|
|
|
3167
3112
|
// src/index.ts
|
|
3168
3113
|
__reExport(src_exports, require("discord-api-types/v10"), module.exports);
|
|
3169
|
-
var version = "3.0.0-dev.
|
|
3114
|
+
var version = "3.0.0-dev.1734135156-35ebcc7d5";
|
|
3170
3115
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3171
3116
|
0 && (module.exports = {
|
|
3172
3117
|
API,
|