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