@discordjs/core 2.2.2 → 2.3.0
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 +50 -2
- package/dist/http-only.d.ts +50 -2
- package/dist/http-only.js +235 -157
- package/dist/http-only.js.map +1 -1
- package/dist/http-only.mjs +227 -150
- package/dist/http-only.mjs.map +1 -1
- package/dist/index.d.mts +50 -2
- package/dist/index.d.ts +50 -2
- package/dist/index.js +240 -162
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +227 -150
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -27,6 +27,7 @@ __export(src_exports, {
|
|
|
27
27
|
ApplicationsAPI: () => ApplicationsAPI,
|
|
28
28
|
ChannelsAPI: () => ChannelsAPI,
|
|
29
29
|
Client: () => Client,
|
|
30
|
+
GatewayAPI: () => GatewayAPI,
|
|
30
31
|
GuildsAPI: () => GuildsAPI,
|
|
31
32
|
InteractionsAPI: () => InteractionsAPI,
|
|
32
33
|
InvitesAPI: () => InvitesAPI,
|
|
@@ -791,14 +792,74 @@ var ChannelsAPI = class {
|
|
|
791
792
|
signal
|
|
792
793
|
});
|
|
793
794
|
}
|
|
795
|
+
/**
|
|
796
|
+
* Adds a recipient to a group DM channel
|
|
797
|
+
*
|
|
798
|
+
* @see {@link https://discord.com/developers/docs/resources/channel#group-dm-add-recipient}
|
|
799
|
+
* @param channelId - The id of the channel to add the recipient to
|
|
800
|
+
* @param userId - The id of the user to add as a recipient
|
|
801
|
+
* @param body - The data for adding the recipient
|
|
802
|
+
* @param options - The options for adding the recipient
|
|
803
|
+
*/
|
|
804
|
+
async addGroupDMRecipient(channelId, userId, body, { signal } = {}) {
|
|
805
|
+
await this.rest.put(import_v103.Routes.channelRecipient(channelId, userId), {
|
|
806
|
+
body,
|
|
807
|
+
signal
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* Removes a recipient from a group DM channel
|
|
812
|
+
*
|
|
813
|
+
* @see {@link https://discord.com/developers/docs/resources/channel#group-dm-remove-recipient}
|
|
814
|
+
* @param channelId - The id of the channel to remove the recipient from
|
|
815
|
+
* @param userId - The id of the user to remove as a recipient
|
|
816
|
+
* @param options - The options for removing the recipient
|
|
817
|
+
*/
|
|
818
|
+
async removeGroupDMRecipient(channelId, userId, { signal } = {}) {
|
|
819
|
+
await this.rest.delete(import_v103.Routes.channelRecipient(channelId, userId), {
|
|
820
|
+
signal
|
|
821
|
+
});
|
|
822
|
+
}
|
|
823
|
+
};
|
|
824
|
+
|
|
825
|
+
// src/api/gateway.ts
|
|
826
|
+
var import_v104 = require("discord-api-types/v10");
|
|
827
|
+
var GatewayAPI = class {
|
|
828
|
+
constructor(rest) {
|
|
829
|
+
this.rest = rest;
|
|
830
|
+
}
|
|
831
|
+
static {
|
|
832
|
+
__name(this, "GatewayAPI");
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
835
|
+
* Gets gateway information.
|
|
836
|
+
*
|
|
837
|
+
* @see {@link https://discord.com/developers/docs/events/gateway#get-gateway}
|
|
838
|
+
* @param options - The options for fetching the gateway information
|
|
839
|
+
*/
|
|
840
|
+
async get({ signal } = {}) {
|
|
841
|
+
return this.rest.get(import_v104.Routes.gateway(), {
|
|
842
|
+
auth: false,
|
|
843
|
+
signal
|
|
844
|
+
});
|
|
845
|
+
}
|
|
846
|
+
/**
|
|
847
|
+
* Gets gateway information with additional metadata.
|
|
848
|
+
*
|
|
849
|
+
* @see {@link https://discord.com/developers/docs/events/gateway#get-gateway-bot}
|
|
850
|
+
* @param options - The options for fetching the gateway information
|
|
851
|
+
*/
|
|
852
|
+
async getBot({ signal } = {}) {
|
|
853
|
+
return this.rest.get(import_v104.Routes.gatewayBot(), { signal });
|
|
854
|
+
}
|
|
794
855
|
};
|
|
795
856
|
|
|
796
857
|
// src/api/guild.ts
|
|
797
858
|
var import_rest3 = require("@discordjs/rest");
|
|
798
|
-
var
|
|
859
|
+
var import_v106 = require("discord-api-types/v10");
|
|
799
860
|
|
|
800
861
|
// src/api/voice.ts
|
|
801
|
-
var
|
|
862
|
+
var import_v105 = require("discord-api-types/v10");
|
|
802
863
|
var VoiceAPI = class {
|
|
803
864
|
constructor(rest) {
|
|
804
865
|
this.rest = rest;
|
|
@@ -813,7 +874,7 @@ var VoiceAPI = class {
|
|
|
813
874
|
* @param options - The options for fetching the voice regions
|
|
814
875
|
*/
|
|
815
876
|
async getVoiceRegions({ signal } = {}) {
|
|
816
|
-
return this.rest.get(
|
|
877
|
+
return this.rest.get(import_v105.Routes.voiceRegions(), { signal });
|
|
817
878
|
}
|
|
818
879
|
/**
|
|
819
880
|
* Fetches voice state of a user by their id
|
|
@@ -822,7 +883,7 @@ var VoiceAPI = class {
|
|
|
822
883
|
* @param options - The options for fetching user voice state
|
|
823
884
|
*/
|
|
824
885
|
async getUserVoiceState(guildId, userId, { signal } = {}) {
|
|
825
|
-
return this.rest.get(
|
|
886
|
+
return this.rest.get(import_v105.Routes.guildVoiceState(guildId, userId), {
|
|
826
887
|
signal
|
|
827
888
|
});
|
|
828
889
|
}
|
|
@@ -833,7 +894,7 @@ var VoiceAPI = class {
|
|
|
833
894
|
* @param options - The options for fetching user voice state
|
|
834
895
|
*/
|
|
835
896
|
async getVoiceState(guildId, { signal } = {}) {
|
|
836
|
-
return this.rest.get(
|
|
897
|
+
return this.rest.get(import_v105.Routes.guildVoiceState(guildId, "@me"), {
|
|
837
898
|
signal
|
|
838
899
|
});
|
|
839
900
|
}
|
|
@@ -847,7 +908,7 @@ var VoiceAPI = class {
|
|
|
847
908
|
* @param options - The options for editing the voice state
|
|
848
909
|
*/
|
|
849
910
|
async editUserVoiceState(guildId, userId, body, { reason, signal } = {}) {
|
|
850
|
-
return this.rest.patch(
|
|
911
|
+
return this.rest.patch(import_v105.Routes.guildVoiceState(guildId, userId), {
|
|
851
912
|
reason,
|
|
852
913
|
body,
|
|
853
914
|
signal
|
|
@@ -862,7 +923,7 @@ var VoiceAPI = class {
|
|
|
862
923
|
* @param options - The options for editing the voice state
|
|
863
924
|
*/
|
|
864
925
|
async editVoiceState(guildId, body = {}, { signal } = {}) {
|
|
865
|
-
return this.rest.patch(
|
|
926
|
+
return this.rest.patch(import_v105.Routes.guildVoiceState(guildId, "@me"), {
|
|
866
927
|
body,
|
|
867
928
|
signal
|
|
868
929
|
});
|
|
@@ -884,7 +945,7 @@ var GuildsAPI = class {
|
|
|
884
945
|
if ("with_counts" in queryOrOptions) {
|
|
885
946
|
requestData.query = (0, import_rest3.makeURLSearchParams)(queryOrOptions);
|
|
886
947
|
}
|
|
887
|
-
return this.rest.get(
|
|
948
|
+
return this.rest.get(import_v106.Routes.guild(guildId), requestData);
|
|
888
949
|
}
|
|
889
950
|
/**
|
|
890
951
|
* Fetches a guild preview
|
|
@@ -894,7 +955,7 @@ var GuildsAPI = class {
|
|
|
894
955
|
* @param options - The options for fetching the guild preview
|
|
895
956
|
*/
|
|
896
957
|
async getPreview(guildId, { signal } = {}) {
|
|
897
|
-
return this.rest.get(
|
|
958
|
+
return this.rest.get(import_v106.Routes.guildPreview(guildId), {
|
|
898
959
|
signal
|
|
899
960
|
});
|
|
900
961
|
}
|
|
@@ -907,7 +968,7 @@ var GuildsAPI = class {
|
|
|
907
968
|
* @deprecated API related to guild ownership may no longer be used.
|
|
908
969
|
*/
|
|
909
970
|
async create(body, { signal } = {}) {
|
|
910
|
-
return this.rest.post(
|
|
971
|
+
return this.rest.post(import_v106.Routes.guilds(), { body, signal });
|
|
911
972
|
}
|
|
912
973
|
/**
|
|
913
974
|
* Edits a guild
|
|
@@ -918,7 +979,7 @@ var GuildsAPI = class {
|
|
|
918
979
|
* @param options - The options for editing the guild
|
|
919
980
|
*/
|
|
920
981
|
async edit(guildId, body, { reason, signal } = {}) {
|
|
921
|
-
return this.rest.patch(
|
|
982
|
+
return this.rest.patch(import_v106.Routes.guild(guildId), {
|
|
922
983
|
reason,
|
|
923
984
|
body,
|
|
924
985
|
signal
|
|
@@ -933,7 +994,7 @@ var GuildsAPI = class {
|
|
|
933
994
|
* @deprecated API related to guild ownership may no longer be used.
|
|
934
995
|
*/
|
|
935
996
|
async delete(guildId, { signal } = {}) {
|
|
936
|
-
await this.rest.delete(
|
|
997
|
+
await this.rest.delete(import_v106.Routes.guild(guildId), { signal });
|
|
937
998
|
}
|
|
938
999
|
/**
|
|
939
1000
|
* Adds user to the guild
|
|
@@ -945,7 +1006,7 @@ var GuildsAPI = class {
|
|
|
945
1006
|
* @param options - The options for adding users to the guild
|
|
946
1007
|
*/
|
|
947
1008
|
async addMember(guildId, userId, body, { signal } = {}) {
|
|
948
|
-
return this.rest.put(
|
|
1009
|
+
return this.rest.put(import_v106.Routes.guildMember(guildId, userId), {
|
|
949
1010
|
body,
|
|
950
1011
|
signal
|
|
951
1012
|
});
|
|
@@ -959,7 +1020,7 @@ var GuildsAPI = class {
|
|
|
959
1020
|
* @param options - The options for fetching the guild members
|
|
960
1021
|
*/
|
|
961
1022
|
async getMembers(guildId, query = {}, { signal } = {}) {
|
|
962
|
-
return this.rest.get(
|
|
1023
|
+
return this.rest.get(import_v106.Routes.guildMembers(guildId), {
|
|
963
1024
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
964
1025
|
signal
|
|
965
1026
|
});
|
|
@@ -972,7 +1033,7 @@ var GuildsAPI = class {
|
|
|
972
1033
|
* @param options - The options for fetching the guild channels
|
|
973
1034
|
*/
|
|
974
1035
|
async getChannels(guildId, { signal } = {}) {
|
|
975
|
-
return this.rest.get(
|
|
1036
|
+
return this.rest.get(import_v106.Routes.guildChannels(guildId), {
|
|
976
1037
|
signal
|
|
977
1038
|
});
|
|
978
1039
|
}
|
|
@@ -985,7 +1046,7 @@ var GuildsAPI = class {
|
|
|
985
1046
|
* @param options - The options for creating the guild channel
|
|
986
1047
|
*/
|
|
987
1048
|
async createChannel(guildId, body, { reason, signal } = {}) {
|
|
988
|
-
return this.rest.post(
|
|
1049
|
+
return this.rest.post(import_v106.Routes.guildChannels(guildId), {
|
|
989
1050
|
reason,
|
|
990
1051
|
body,
|
|
991
1052
|
signal
|
|
@@ -1000,7 +1061,7 @@ var GuildsAPI = class {
|
|
|
1000
1061
|
* @param options - The options for editing the guild channel positions
|
|
1001
1062
|
*/
|
|
1002
1063
|
async setChannelPositions(guildId, body, { reason, signal } = {}) {
|
|
1003
|
-
await this.rest.patch(
|
|
1064
|
+
await this.rest.patch(import_v106.Routes.guildChannels(guildId), { reason, body, signal });
|
|
1004
1065
|
}
|
|
1005
1066
|
/**
|
|
1006
1067
|
* Fetches the active threads in a guild
|
|
@@ -1010,7 +1071,7 @@ var GuildsAPI = class {
|
|
|
1010
1071
|
* @param options - The options for fetching the active threads
|
|
1011
1072
|
*/
|
|
1012
1073
|
async getActiveThreads(guildId, { signal } = {}) {
|
|
1013
|
-
return this.rest.get(
|
|
1074
|
+
return this.rest.get(import_v106.Routes.guildActiveThreads(guildId), { signal });
|
|
1014
1075
|
}
|
|
1015
1076
|
/**
|
|
1016
1077
|
* Fetches a guild member ban
|
|
@@ -1021,7 +1082,7 @@ var GuildsAPI = class {
|
|
|
1021
1082
|
* @param options - The options for fetching the ban
|
|
1022
1083
|
*/
|
|
1023
1084
|
async getMemberBan(guildId, userId, { signal } = {}) {
|
|
1024
|
-
return this.rest.get(
|
|
1085
|
+
return this.rest.get(import_v106.Routes.guildBan(guildId, userId), { signal });
|
|
1025
1086
|
}
|
|
1026
1087
|
/**
|
|
1027
1088
|
* Fetches guild member bans
|
|
@@ -1032,7 +1093,7 @@ var GuildsAPI = class {
|
|
|
1032
1093
|
* @param options - The options for fetching the bans
|
|
1033
1094
|
*/
|
|
1034
1095
|
async getMemberBans(guildId, query = {}, { signal } = {}) {
|
|
1035
|
-
return this.rest.get(
|
|
1096
|
+
return this.rest.get(import_v106.Routes.guildBans(guildId), {
|
|
1036
1097
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1037
1098
|
signal
|
|
1038
1099
|
});
|
|
@@ -1047,7 +1108,7 @@ var GuildsAPI = class {
|
|
|
1047
1108
|
* @param options - The options for banning the user
|
|
1048
1109
|
*/
|
|
1049
1110
|
async banUser(guildId, userId, body = {}, { reason, signal } = {}) {
|
|
1050
|
-
await this.rest.put(
|
|
1111
|
+
await this.rest.put(import_v106.Routes.guildBan(guildId, userId), { reason, body, signal });
|
|
1051
1112
|
}
|
|
1052
1113
|
/**
|
|
1053
1114
|
* Unbans a user from a guild
|
|
@@ -1058,7 +1119,7 @@ var GuildsAPI = class {
|
|
|
1058
1119
|
* @param options - The options for unbanning the user
|
|
1059
1120
|
*/
|
|
1060
1121
|
async unbanUser(guildId, userId, { reason, signal } = {}) {
|
|
1061
|
-
await this.rest.delete(
|
|
1122
|
+
await this.rest.delete(import_v106.Routes.guildBan(guildId, userId), { reason, signal });
|
|
1062
1123
|
}
|
|
1063
1124
|
/**
|
|
1064
1125
|
* Bulk ban users from a guild
|
|
@@ -1069,7 +1130,7 @@ var GuildsAPI = class {
|
|
|
1069
1130
|
* @param options - The options for bulk banning users
|
|
1070
1131
|
*/
|
|
1071
1132
|
async bulkBanUsers(guildId, body, { reason, signal } = {}) {
|
|
1072
|
-
return this.rest.post(
|
|
1133
|
+
return this.rest.post(import_v106.Routes.guildBulkBan(guildId), {
|
|
1073
1134
|
reason,
|
|
1074
1135
|
body,
|
|
1075
1136
|
signal
|
|
@@ -1083,7 +1144,7 @@ var GuildsAPI = class {
|
|
|
1083
1144
|
* @param options - The options for fetching the guild roles
|
|
1084
1145
|
*/
|
|
1085
1146
|
async getRoles(guildId, { signal } = {}) {
|
|
1086
|
-
return this.rest.get(
|
|
1147
|
+
return this.rest.get(import_v106.Routes.guildRoles(guildId), { signal });
|
|
1087
1148
|
}
|
|
1088
1149
|
/**
|
|
1089
1150
|
* Get a role in a guild
|
|
@@ -1094,7 +1155,7 @@ var GuildsAPI = class {
|
|
|
1094
1155
|
* @param options - The options for fetching the guild role
|
|
1095
1156
|
*/
|
|
1096
1157
|
async getRole(guildId, roleId, { signal } = {}) {
|
|
1097
|
-
return this.rest.get(
|
|
1158
|
+
return this.rest.get(import_v106.Routes.guildRole(guildId, roleId), { signal });
|
|
1098
1159
|
}
|
|
1099
1160
|
/**
|
|
1100
1161
|
* Creates a guild role
|
|
@@ -1105,7 +1166,7 @@ var GuildsAPI = class {
|
|
|
1105
1166
|
* @param options - The options for creating the guild role
|
|
1106
1167
|
*/
|
|
1107
1168
|
async createRole(guildId, body, { reason, signal } = {}) {
|
|
1108
|
-
return this.rest.post(
|
|
1169
|
+
return this.rest.post(import_v106.Routes.guildRoles(guildId), { reason, body, signal });
|
|
1109
1170
|
}
|
|
1110
1171
|
/**
|
|
1111
1172
|
* Sets role positions in a guild
|
|
@@ -1116,7 +1177,7 @@ var GuildsAPI = class {
|
|
|
1116
1177
|
* @param options - The options for setting role positions
|
|
1117
1178
|
*/
|
|
1118
1179
|
async setRolePositions(guildId, body, { reason, signal } = {}) {
|
|
1119
|
-
return this.rest.patch(
|
|
1180
|
+
return this.rest.patch(import_v106.Routes.guildRoles(guildId), {
|
|
1120
1181
|
reason,
|
|
1121
1182
|
body,
|
|
1122
1183
|
signal
|
|
@@ -1132,7 +1193,7 @@ var GuildsAPI = class {
|
|
|
1132
1193
|
* @param options - The options for editing the guild role
|
|
1133
1194
|
*/
|
|
1134
1195
|
async editRole(guildId, roleId, body, { reason, signal } = {}) {
|
|
1135
|
-
return this.rest.patch(
|
|
1196
|
+
return this.rest.patch(import_v106.Routes.guildRole(guildId, roleId), {
|
|
1136
1197
|
reason,
|
|
1137
1198
|
body,
|
|
1138
1199
|
signal
|
|
@@ -1147,7 +1208,7 @@ var GuildsAPI = class {
|
|
|
1147
1208
|
* @param options - The options for deleting the guild role
|
|
1148
1209
|
*/
|
|
1149
1210
|
async deleteRole(guildId, roleId, { reason, signal } = {}) {
|
|
1150
|
-
await this.rest.delete(
|
|
1211
|
+
await this.rest.delete(import_v106.Routes.guildRole(guildId, roleId), { reason, signal });
|
|
1151
1212
|
}
|
|
1152
1213
|
/**
|
|
1153
1214
|
* Edits the multi-factor-authentication (MFA) level of a guild
|
|
@@ -1159,7 +1220,7 @@ var GuildsAPI = class {
|
|
|
1159
1220
|
* @deprecated API related to guild ownership may no longer be used.
|
|
1160
1221
|
*/
|
|
1161
1222
|
async editMFALevel(guildId, level, { reason, signal } = {}) {
|
|
1162
|
-
return this.rest.post(
|
|
1223
|
+
return this.rest.post(import_v106.Routes.guildMFA(guildId), {
|
|
1163
1224
|
reason,
|
|
1164
1225
|
signal,
|
|
1165
1226
|
body: { level }
|
|
@@ -1174,7 +1235,7 @@ var GuildsAPI = class {
|
|
|
1174
1235
|
* @param options - The options for fetching the number of pruned members
|
|
1175
1236
|
*/
|
|
1176
1237
|
async getPruneCount(guildId, query = {}, { signal } = {}) {
|
|
1177
|
-
return this.rest.get(
|
|
1238
|
+
return this.rest.get(import_v106.Routes.guildPrune(guildId), {
|
|
1178
1239
|
signal,
|
|
1179
1240
|
query: (0, import_rest3.makeURLSearchParams)(query)
|
|
1180
1241
|
});
|
|
@@ -1188,7 +1249,7 @@ var GuildsAPI = class {
|
|
|
1188
1249
|
* @param options - The options for initiating the prune
|
|
1189
1250
|
*/
|
|
1190
1251
|
async beginPrune(guildId, body = {}, { reason, signal } = {}) {
|
|
1191
|
-
return this.rest.post(
|
|
1252
|
+
return this.rest.post(import_v106.Routes.guildPrune(guildId), {
|
|
1192
1253
|
body,
|
|
1193
1254
|
reason,
|
|
1194
1255
|
signal
|
|
@@ -1202,7 +1263,7 @@ var GuildsAPI = class {
|
|
|
1202
1263
|
* @param options - The options for fetching the voice regions
|
|
1203
1264
|
*/
|
|
1204
1265
|
async getVoiceRegions(guildId, { signal } = {}) {
|
|
1205
|
-
return this.rest.get(
|
|
1266
|
+
return this.rest.get(import_v106.Routes.guildVoiceRegions(guildId), { signal });
|
|
1206
1267
|
}
|
|
1207
1268
|
/**
|
|
1208
1269
|
* Fetches the invites for a guild
|
|
@@ -1212,7 +1273,7 @@ var GuildsAPI = class {
|
|
|
1212
1273
|
* @param options - The options for fetching the invites
|
|
1213
1274
|
*/
|
|
1214
1275
|
async getInvites(guildId, { signal } = {}) {
|
|
1215
|
-
return this.rest.get(
|
|
1276
|
+
return this.rest.get(import_v106.Routes.guildInvites(guildId), { signal });
|
|
1216
1277
|
}
|
|
1217
1278
|
/**
|
|
1218
1279
|
* Fetches the integrations for a guild
|
|
@@ -1222,7 +1283,7 @@ var GuildsAPI = class {
|
|
|
1222
1283
|
* @param options - The options for fetching the integrations
|
|
1223
1284
|
*/
|
|
1224
1285
|
async getIntegrations(guildId, { signal } = {}) {
|
|
1225
|
-
return this.rest.get(
|
|
1286
|
+
return this.rest.get(import_v106.Routes.guildIntegrations(guildId), { signal });
|
|
1226
1287
|
}
|
|
1227
1288
|
/**
|
|
1228
1289
|
* Deletes an integration from a guild
|
|
@@ -1233,7 +1294,7 @@ var GuildsAPI = class {
|
|
|
1233
1294
|
* @param options - The options for deleting the integration
|
|
1234
1295
|
*/
|
|
1235
1296
|
async deleteIntegration(guildId, integrationId, { reason, signal } = {}) {
|
|
1236
|
-
await this.rest.delete(
|
|
1297
|
+
await this.rest.delete(import_v106.Routes.guildIntegration(guildId, integrationId), { reason, signal });
|
|
1237
1298
|
}
|
|
1238
1299
|
/**
|
|
1239
1300
|
* Fetches the widget settings for a guild
|
|
@@ -1243,7 +1304,7 @@ var GuildsAPI = class {
|
|
|
1243
1304
|
* @param options - The options for fetching the widget settings
|
|
1244
1305
|
*/
|
|
1245
1306
|
async getWidgetSettings(guildId, { signal } = {}) {
|
|
1246
|
-
return this.rest.get(
|
|
1307
|
+
return this.rest.get(import_v106.Routes.guildWidgetSettings(guildId), {
|
|
1247
1308
|
signal
|
|
1248
1309
|
});
|
|
1249
1310
|
}
|
|
@@ -1256,7 +1317,7 @@ var GuildsAPI = class {
|
|
|
1256
1317
|
* @param options - The options for editing the widget settings
|
|
1257
1318
|
*/
|
|
1258
1319
|
async editWidgetSettings(guildId, body, { reason, signal } = {}) {
|
|
1259
|
-
return this.rest.patch(
|
|
1320
|
+
return this.rest.patch(import_v106.Routes.guildWidgetSettings(guildId), {
|
|
1260
1321
|
reason,
|
|
1261
1322
|
body,
|
|
1262
1323
|
signal
|
|
@@ -1270,7 +1331,7 @@ var GuildsAPI = class {
|
|
|
1270
1331
|
* @param options - The options for fetching the widget
|
|
1271
1332
|
*/
|
|
1272
1333
|
async getWidget(guildId, { signal } = {}) {
|
|
1273
|
-
return this.rest.get(
|
|
1334
|
+
return this.rest.get(import_v106.Routes.guildWidgetJSON(guildId), { signal });
|
|
1274
1335
|
}
|
|
1275
1336
|
/**
|
|
1276
1337
|
* Fetches the vanity url for a guild
|
|
@@ -1280,7 +1341,7 @@ var GuildsAPI = class {
|
|
|
1280
1341
|
* @param options - The options for fetching the vanity url
|
|
1281
1342
|
*/
|
|
1282
1343
|
async getVanityURL(guildId, { signal } = {}) {
|
|
1283
|
-
return this.rest.get(
|
|
1344
|
+
return this.rest.get(import_v106.Routes.guildVanityUrl(guildId), { signal });
|
|
1284
1345
|
}
|
|
1285
1346
|
/**
|
|
1286
1347
|
* Fetches the widget image for a guild
|
|
@@ -1291,7 +1352,7 @@ var GuildsAPI = class {
|
|
|
1291
1352
|
* @param options - The options for fetching the widget image
|
|
1292
1353
|
*/
|
|
1293
1354
|
async getWidgetImage(guildId, style, { signal } = {}) {
|
|
1294
|
-
return this.rest.get(
|
|
1355
|
+
return this.rest.get(import_v106.Routes.guildWidgetImage(guildId), {
|
|
1295
1356
|
query: (0, import_rest3.makeURLSearchParams)({ style }),
|
|
1296
1357
|
signal
|
|
1297
1358
|
});
|
|
@@ -1304,7 +1365,7 @@ var GuildsAPI = class {
|
|
|
1304
1365
|
* @param options - The options for fetching the welcome screen
|
|
1305
1366
|
*/
|
|
1306
1367
|
async getWelcomeScreen(guildId, { signal } = {}) {
|
|
1307
|
-
return this.rest.get(
|
|
1368
|
+
return this.rest.get(import_v106.Routes.guildWelcomeScreen(guildId), { signal });
|
|
1308
1369
|
}
|
|
1309
1370
|
/**
|
|
1310
1371
|
* Edits the welcome screen for a guild
|
|
@@ -1315,7 +1376,7 @@ var GuildsAPI = class {
|
|
|
1315
1376
|
* @param options - The options for editing the welcome screen
|
|
1316
1377
|
*/
|
|
1317
1378
|
async editWelcomeScreen(guildId, body, { reason, signal } = {}) {
|
|
1318
|
-
return this.rest.patch(
|
|
1379
|
+
return this.rest.patch(import_v106.Routes.guildWelcomeScreen(guildId), {
|
|
1319
1380
|
reason,
|
|
1320
1381
|
body,
|
|
1321
1382
|
signal
|
|
@@ -1342,7 +1403,7 @@ var GuildsAPI = class {
|
|
|
1342
1403
|
* @param options - The options for fetching the emojis
|
|
1343
1404
|
*/
|
|
1344
1405
|
async getEmojis(guildId, { signal } = {}) {
|
|
1345
|
-
return this.rest.get(
|
|
1406
|
+
return this.rest.get(import_v106.Routes.guildEmojis(guildId), { signal });
|
|
1346
1407
|
}
|
|
1347
1408
|
/**
|
|
1348
1409
|
* Fetches an emoji for a guild
|
|
@@ -1353,7 +1414,7 @@ var GuildsAPI = class {
|
|
|
1353
1414
|
* @param options - The options for fetching the emoji
|
|
1354
1415
|
*/
|
|
1355
1416
|
async getEmoji(guildId, emojiId, { signal } = {}) {
|
|
1356
|
-
return this.rest.get(
|
|
1417
|
+
return this.rest.get(import_v106.Routes.guildEmoji(guildId, emojiId), { signal });
|
|
1357
1418
|
}
|
|
1358
1419
|
/**
|
|
1359
1420
|
* Creates a new emoji for a guild
|
|
@@ -1364,7 +1425,7 @@ var GuildsAPI = class {
|
|
|
1364
1425
|
* @param options - The options for creating the emoji
|
|
1365
1426
|
*/
|
|
1366
1427
|
async createEmoji(guildId, body, { reason, signal } = {}) {
|
|
1367
|
-
return this.rest.post(
|
|
1428
|
+
return this.rest.post(import_v106.Routes.guildEmojis(guildId), {
|
|
1368
1429
|
reason,
|
|
1369
1430
|
body,
|
|
1370
1431
|
signal
|
|
@@ -1380,7 +1441,7 @@ var GuildsAPI = class {
|
|
|
1380
1441
|
* @param options - The options for editing the emoji
|
|
1381
1442
|
*/
|
|
1382
1443
|
async editEmoji(guildId, emojiId, body, { reason, signal } = {}) {
|
|
1383
|
-
return this.rest.patch(
|
|
1444
|
+
return this.rest.patch(import_v106.Routes.guildEmoji(guildId, emojiId), {
|
|
1384
1445
|
reason,
|
|
1385
1446
|
body,
|
|
1386
1447
|
signal
|
|
@@ -1395,7 +1456,7 @@ var GuildsAPI = class {
|
|
|
1395
1456
|
* @param options - The options for deleting the emoji
|
|
1396
1457
|
*/
|
|
1397
1458
|
async deleteEmoji(guildId, emojiId, { reason, signal } = {}) {
|
|
1398
|
-
await this.rest.delete(
|
|
1459
|
+
await this.rest.delete(import_v106.Routes.guildEmoji(guildId, emojiId), { reason, signal });
|
|
1399
1460
|
}
|
|
1400
1461
|
/**
|
|
1401
1462
|
* Fetches all scheduled events for a guild
|
|
@@ -1406,7 +1467,7 @@ var GuildsAPI = class {
|
|
|
1406
1467
|
* @param options - The options for fetching the scheduled events
|
|
1407
1468
|
*/
|
|
1408
1469
|
async getScheduledEvents(guildId, query = {}, { signal } = {}) {
|
|
1409
|
-
return this.rest.get(
|
|
1470
|
+
return this.rest.get(import_v106.Routes.guildScheduledEvents(guildId), {
|
|
1410
1471
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1411
1472
|
signal
|
|
1412
1473
|
});
|
|
@@ -1420,7 +1481,7 @@ var GuildsAPI = class {
|
|
|
1420
1481
|
* @param options - The options for creating the scheduled event
|
|
1421
1482
|
*/
|
|
1422
1483
|
async createScheduledEvent(guildId, body, { reason, signal } = {}) {
|
|
1423
|
-
return this.rest.post(
|
|
1484
|
+
return this.rest.post(import_v106.Routes.guildScheduledEvents(guildId), {
|
|
1424
1485
|
reason,
|
|
1425
1486
|
body,
|
|
1426
1487
|
signal
|
|
@@ -1436,7 +1497,7 @@ var GuildsAPI = class {
|
|
|
1436
1497
|
* @param options - The options for fetching the scheduled event
|
|
1437
1498
|
*/
|
|
1438
1499
|
async getScheduledEvent(guildId, eventId, query = {}, { signal } = {}) {
|
|
1439
|
-
return this.rest.get(
|
|
1500
|
+
return this.rest.get(import_v106.Routes.guildScheduledEvent(guildId, eventId), {
|
|
1440
1501
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1441
1502
|
signal
|
|
1442
1503
|
});
|
|
@@ -1451,7 +1512,7 @@ var GuildsAPI = class {
|
|
|
1451
1512
|
* @param options - The options for editing the scheduled event
|
|
1452
1513
|
*/
|
|
1453
1514
|
async editScheduledEvent(guildId, eventId, body, { reason, signal } = {}) {
|
|
1454
|
-
return this.rest.patch(
|
|
1515
|
+
return this.rest.patch(import_v106.Routes.guildScheduledEvent(guildId, eventId), {
|
|
1455
1516
|
reason,
|
|
1456
1517
|
body,
|
|
1457
1518
|
signal
|
|
@@ -1466,7 +1527,7 @@ var GuildsAPI = class {
|
|
|
1466
1527
|
* @param options - The options for deleting the scheduled event
|
|
1467
1528
|
*/
|
|
1468
1529
|
async deleteScheduledEvent(guildId, eventId, { reason, signal } = {}) {
|
|
1469
|
-
await this.rest.delete(
|
|
1530
|
+
await this.rest.delete(import_v106.Routes.guildScheduledEvent(guildId, eventId), { reason, signal });
|
|
1470
1531
|
}
|
|
1471
1532
|
/**
|
|
1472
1533
|
* Gets all users that are interested in a scheduled event
|
|
@@ -1478,7 +1539,7 @@ var GuildsAPI = class {
|
|
|
1478
1539
|
* @param options - The options for fetching the scheduled event users
|
|
1479
1540
|
*/
|
|
1480
1541
|
async getScheduledEventUsers(guildId, eventId, query = {}, { signal } = {}) {
|
|
1481
|
-
return this.rest.get(
|
|
1542
|
+
return this.rest.get(import_v106.Routes.guildScheduledEventUsers(guildId, eventId), {
|
|
1482
1543
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1483
1544
|
signal
|
|
1484
1545
|
});
|
|
@@ -1491,7 +1552,7 @@ var GuildsAPI = class {
|
|
|
1491
1552
|
* @param options - The options for fetching the templates
|
|
1492
1553
|
*/
|
|
1493
1554
|
async getTemplates(guildId, { signal } = {}) {
|
|
1494
|
-
return this.rest.get(
|
|
1555
|
+
return this.rest.get(import_v106.Routes.guildTemplates(guildId), { signal });
|
|
1495
1556
|
}
|
|
1496
1557
|
/**
|
|
1497
1558
|
* Syncs a template for a guild
|
|
@@ -1502,7 +1563,7 @@ var GuildsAPI = class {
|
|
|
1502
1563
|
* @param options - The options for syncing the template
|
|
1503
1564
|
*/
|
|
1504
1565
|
async syncTemplate(guildId, templateCode, { signal } = {}) {
|
|
1505
|
-
return this.rest.put(
|
|
1566
|
+
return this.rest.put(import_v106.Routes.guildTemplate(guildId, templateCode), {
|
|
1506
1567
|
signal
|
|
1507
1568
|
});
|
|
1508
1569
|
}
|
|
@@ -1516,7 +1577,7 @@ var GuildsAPI = class {
|
|
|
1516
1577
|
* @param options - The options for editing the template
|
|
1517
1578
|
*/
|
|
1518
1579
|
async editTemplate(guildId, templateCode, body, { signal } = {}) {
|
|
1519
|
-
return this.rest.patch(
|
|
1580
|
+
return this.rest.patch(import_v106.Routes.guildTemplate(guildId, templateCode), {
|
|
1520
1581
|
body,
|
|
1521
1582
|
signal
|
|
1522
1583
|
});
|
|
@@ -1530,7 +1591,7 @@ var GuildsAPI = class {
|
|
|
1530
1591
|
* @param options - The options for deleting the template
|
|
1531
1592
|
*/
|
|
1532
1593
|
async deleteTemplate(guildId, templateCode, { signal } = {}) {
|
|
1533
|
-
await this.rest.delete(
|
|
1594
|
+
await this.rest.delete(import_v106.Routes.guildTemplate(guildId, templateCode), { signal });
|
|
1534
1595
|
}
|
|
1535
1596
|
/**
|
|
1536
1597
|
* Fetches all the stickers for a guild
|
|
@@ -1540,7 +1601,7 @@ var GuildsAPI = class {
|
|
|
1540
1601
|
* @param options - The options for fetching the stickers
|
|
1541
1602
|
*/
|
|
1542
1603
|
async getStickers(guildId, { signal } = {}) {
|
|
1543
|
-
return this.rest.get(
|
|
1604
|
+
return this.rest.get(import_v106.Routes.guildStickers(guildId), { signal });
|
|
1544
1605
|
}
|
|
1545
1606
|
/**
|
|
1546
1607
|
* Fetches a sticker for a guild
|
|
@@ -1551,7 +1612,7 @@ var GuildsAPI = class {
|
|
|
1551
1612
|
* @param options - The options for fetching the sticker
|
|
1552
1613
|
*/
|
|
1553
1614
|
async getSticker(guildId, stickerId, { signal } = {}) {
|
|
1554
|
-
return this.rest.get(
|
|
1615
|
+
return this.rest.get(import_v106.Routes.guildSticker(guildId, stickerId), { signal });
|
|
1555
1616
|
}
|
|
1556
1617
|
/**
|
|
1557
1618
|
* Creates a sticker for a guild
|
|
@@ -1563,7 +1624,7 @@ var GuildsAPI = class {
|
|
|
1563
1624
|
*/
|
|
1564
1625
|
async createSticker(guildId, { file, ...body }, { reason, signal } = {}) {
|
|
1565
1626
|
const fileData = { ...file, key: "file" };
|
|
1566
|
-
return this.rest.post(
|
|
1627
|
+
return this.rest.post(import_v106.Routes.guildStickers(guildId), {
|
|
1567
1628
|
appendToFormData: true,
|
|
1568
1629
|
body,
|
|
1569
1630
|
files: [fileData],
|
|
@@ -1581,7 +1642,7 @@ var GuildsAPI = class {
|
|
|
1581
1642
|
* @param options - The options for editing the sticker
|
|
1582
1643
|
*/
|
|
1583
1644
|
async editSticker(guildId, stickerId, body, { reason, signal } = {}) {
|
|
1584
|
-
return this.rest.patch(
|
|
1645
|
+
return this.rest.patch(import_v106.Routes.guildSticker(guildId, stickerId), {
|
|
1585
1646
|
reason,
|
|
1586
1647
|
body,
|
|
1587
1648
|
signal
|
|
@@ -1596,7 +1657,7 @@ var GuildsAPI = class {
|
|
|
1596
1657
|
* @param options - The options for deleting the sticker
|
|
1597
1658
|
*/
|
|
1598
1659
|
async deleteSticker(guildId, stickerId, { reason, signal } = {}) {
|
|
1599
|
-
await this.rest.delete(
|
|
1660
|
+
await this.rest.delete(import_v106.Routes.guildSticker(guildId, stickerId), { reason, signal });
|
|
1600
1661
|
}
|
|
1601
1662
|
/**
|
|
1602
1663
|
* Fetches the audit logs for a guild
|
|
@@ -1607,7 +1668,7 @@ var GuildsAPI = class {
|
|
|
1607
1668
|
* @param options - The options for fetching the audit logs
|
|
1608
1669
|
*/
|
|
1609
1670
|
async getAuditLogs(guildId, query = {}, { signal } = {}) {
|
|
1610
|
-
return this.rest.get(
|
|
1671
|
+
return this.rest.get(import_v106.Routes.guildAuditLog(guildId), {
|
|
1611
1672
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1612
1673
|
signal
|
|
1613
1674
|
});
|
|
@@ -1620,7 +1681,7 @@ var GuildsAPI = class {
|
|
|
1620
1681
|
* @param options - The options for fetching the auto moderation rules
|
|
1621
1682
|
*/
|
|
1622
1683
|
async getAutoModerationRules(guildId, { signal } = {}) {
|
|
1623
|
-
return this.rest.get(
|
|
1684
|
+
return this.rest.get(import_v106.Routes.guildAutoModerationRules(guildId), {
|
|
1624
1685
|
signal
|
|
1625
1686
|
});
|
|
1626
1687
|
}
|
|
@@ -1633,7 +1694,7 @@ var GuildsAPI = class {
|
|
|
1633
1694
|
* @param options - The options for fetching the auto moderation rule
|
|
1634
1695
|
*/
|
|
1635
1696
|
async getAutoModerationRule(guildId, ruleId, { signal } = {}) {
|
|
1636
|
-
return this.rest.get(
|
|
1697
|
+
return this.rest.get(import_v106.Routes.guildAutoModerationRule(guildId, ruleId), {
|
|
1637
1698
|
signal
|
|
1638
1699
|
});
|
|
1639
1700
|
}
|
|
@@ -1646,7 +1707,7 @@ var GuildsAPI = class {
|
|
|
1646
1707
|
* @param options - The options for creating the auto moderation rule
|
|
1647
1708
|
*/
|
|
1648
1709
|
async createAutoModerationRule(guildId, body, { reason, signal } = {}) {
|
|
1649
|
-
return this.rest.post(
|
|
1710
|
+
return this.rest.post(import_v106.Routes.guildAutoModerationRules(guildId), {
|
|
1650
1711
|
reason,
|
|
1651
1712
|
body,
|
|
1652
1713
|
signal
|
|
@@ -1662,7 +1723,7 @@ var GuildsAPI = class {
|
|
|
1662
1723
|
* @param options - The options for editing the auto moderation rule
|
|
1663
1724
|
*/
|
|
1664
1725
|
async editAutoModerationRule(guildId, ruleId, body, { reason, signal } = {}) {
|
|
1665
|
-
return this.rest.patch(
|
|
1726
|
+
return this.rest.patch(import_v106.Routes.guildAutoModerationRule(guildId, ruleId), {
|
|
1666
1727
|
reason,
|
|
1667
1728
|
body,
|
|
1668
1729
|
signal
|
|
@@ -1677,7 +1738,7 @@ var GuildsAPI = class {
|
|
|
1677
1738
|
* @param options - The options for deleting the auto moderation rule
|
|
1678
1739
|
*/
|
|
1679
1740
|
async deleteAutoModerationRule(guildId, ruleId, { reason, signal } = {}) {
|
|
1680
|
-
await this.rest.delete(
|
|
1741
|
+
await this.rest.delete(import_v106.Routes.guildAutoModerationRule(guildId, ruleId), { reason, signal });
|
|
1681
1742
|
}
|
|
1682
1743
|
/**
|
|
1683
1744
|
* Fetches a guild member
|
|
@@ -1688,7 +1749,7 @@ var GuildsAPI = class {
|
|
|
1688
1749
|
* @param options - The options for fetching the guild member
|
|
1689
1750
|
*/
|
|
1690
1751
|
async getMember(guildId, userId, { signal } = {}) {
|
|
1691
|
-
return this.rest.get(
|
|
1752
|
+
return this.rest.get(import_v106.Routes.guildMember(guildId, userId), { signal });
|
|
1692
1753
|
}
|
|
1693
1754
|
/**
|
|
1694
1755
|
* Searches for guild members
|
|
@@ -1699,7 +1760,7 @@ var GuildsAPI = class {
|
|
|
1699
1760
|
* @param options - The options for searching for guild members
|
|
1700
1761
|
*/
|
|
1701
1762
|
async searchForMembers(guildId, query, { signal } = {}) {
|
|
1702
|
-
return this.rest.get(
|
|
1763
|
+
return this.rest.get(import_v106.Routes.guildMembersSearch(guildId), {
|
|
1703
1764
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1704
1765
|
signal
|
|
1705
1766
|
});
|
|
@@ -1714,7 +1775,7 @@ var GuildsAPI = class {
|
|
|
1714
1775
|
* @param options - The options for editing the guild member
|
|
1715
1776
|
*/
|
|
1716
1777
|
async editMember(guildId, userId, body = {}, { reason, signal } = {}) {
|
|
1717
|
-
return this.rest.patch(
|
|
1778
|
+
return this.rest.patch(import_v106.Routes.guildMember(guildId, userId), {
|
|
1718
1779
|
reason,
|
|
1719
1780
|
body,
|
|
1720
1781
|
signal
|
|
@@ -1729,7 +1790,7 @@ var GuildsAPI = class {
|
|
|
1729
1790
|
* @param options - The options for removing the guild member
|
|
1730
1791
|
*/
|
|
1731
1792
|
async removeMember(guildId, userId, { reason, signal } = {}) {
|
|
1732
|
-
return this.rest.delete(
|
|
1793
|
+
return this.rest.delete(import_v106.Routes.guildMember(guildId, userId), { reason, signal });
|
|
1733
1794
|
}
|
|
1734
1795
|
/**
|
|
1735
1796
|
* Adds a role to a guild member
|
|
@@ -1741,7 +1802,7 @@ var GuildsAPI = class {
|
|
|
1741
1802
|
* @param options - The options for adding a role to a guild member
|
|
1742
1803
|
*/
|
|
1743
1804
|
async addRoleToMember(guildId, userId, roleId, { reason, signal } = {}) {
|
|
1744
|
-
await this.rest.put(
|
|
1805
|
+
await this.rest.put(import_v106.Routes.guildMemberRole(guildId, userId, roleId), { reason, signal });
|
|
1745
1806
|
}
|
|
1746
1807
|
/**
|
|
1747
1808
|
* Removes a role from a guild member
|
|
@@ -1753,7 +1814,7 @@ var GuildsAPI = class {
|
|
|
1753
1814
|
* @param options - The options for removing a role from a guild member
|
|
1754
1815
|
*/
|
|
1755
1816
|
async removeRoleFromMember(guildId, userId, roleId, { reason, signal } = {}) {
|
|
1756
|
-
await this.rest.delete(
|
|
1817
|
+
await this.rest.delete(import_v106.Routes.guildMemberRole(guildId, userId, roleId), { reason, signal });
|
|
1757
1818
|
}
|
|
1758
1819
|
/**
|
|
1759
1820
|
* Fetches a guild template
|
|
@@ -1763,7 +1824,7 @@ var GuildsAPI = class {
|
|
|
1763
1824
|
* @param options - The options for fetching the guild template
|
|
1764
1825
|
*/
|
|
1765
1826
|
async getTemplate(templateCode, { signal } = {}) {
|
|
1766
|
-
return this.rest.get(
|
|
1827
|
+
return this.rest.get(import_v106.Routes.template(templateCode), { signal });
|
|
1767
1828
|
}
|
|
1768
1829
|
/**
|
|
1769
1830
|
* Creates a new template
|
|
@@ -1774,7 +1835,7 @@ var GuildsAPI = class {
|
|
|
1774
1835
|
* @param options - The options for creating the template
|
|
1775
1836
|
*/
|
|
1776
1837
|
async createTemplate(guildId, body, { signal } = {}) {
|
|
1777
|
-
return this.rest.post(
|
|
1838
|
+
return this.rest.post(import_v106.Routes.guildTemplates(guildId), { body, signal });
|
|
1778
1839
|
}
|
|
1779
1840
|
/**
|
|
1780
1841
|
* Fetches webhooks for a guild
|
|
@@ -1783,7 +1844,7 @@ var GuildsAPI = class {
|
|
|
1783
1844
|
* @param id - The id of the guild
|
|
1784
1845
|
*/
|
|
1785
1846
|
async getWebhooks(id) {
|
|
1786
|
-
return this.rest.get(
|
|
1847
|
+
return this.rest.get(import_v106.Routes.guildWebhooks(id));
|
|
1787
1848
|
}
|
|
1788
1849
|
/**
|
|
1789
1850
|
* Sets the voice state for the current user
|
|
@@ -1805,7 +1866,7 @@ var GuildsAPI = class {
|
|
|
1805
1866
|
* @param options - The options for fetching the guild onboarding
|
|
1806
1867
|
*/
|
|
1807
1868
|
async getOnboarding(guildId, { signal } = {}) {
|
|
1808
|
-
return this.rest.get(
|
|
1869
|
+
return this.rest.get(import_v106.Routes.guildOnboarding(guildId), { signal });
|
|
1809
1870
|
}
|
|
1810
1871
|
/**
|
|
1811
1872
|
* Edits a guild onboarding
|
|
@@ -1816,16 +1877,30 @@ var GuildsAPI = class {
|
|
|
1816
1877
|
* @param options - The options for editing the guild onboarding
|
|
1817
1878
|
*/
|
|
1818
1879
|
async editOnboarding(guildId, body, { reason, signal } = {}) {
|
|
1819
|
-
return this.rest.put(
|
|
1880
|
+
return this.rest.put(import_v106.Routes.guildOnboarding(guildId), {
|
|
1820
1881
|
reason,
|
|
1821
1882
|
body,
|
|
1822
1883
|
signal
|
|
1823
1884
|
});
|
|
1824
1885
|
}
|
|
1886
|
+
/**
|
|
1887
|
+
* Modifies incident actions for a guild.
|
|
1888
|
+
*
|
|
1889
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-incident-actions}
|
|
1890
|
+
* @param guildId - The id of the guild
|
|
1891
|
+
* @param body - The data for modifying guild incident actions
|
|
1892
|
+
* @param options - The options for modifying guild incident actions
|
|
1893
|
+
*/
|
|
1894
|
+
async editIncidentActions(guildId, body, { signal } = {}) {
|
|
1895
|
+
return this.rest.put(import_v106.Routes.guildIncidentActions(guildId), {
|
|
1896
|
+
body,
|
|
1897
|
+
signal
|
|
1898
|
+
});
|
|
1899
|
+
}
|
|
1825
1900
|
};
|
|
1826
1901
|
|
|
1827
1902
|
// src/api/interactions.ts
|
|
1828
|
-
var
|
|
1903
|
+
var import_v107 = require("discord-api-types/v10");
|
|
1829
1904
|
var InteractionsAPI = class {
|
|
1830
1905
|
constructor(rest, webhooks) {
|
|
1831
1906
|
this.rest = rest;
|
|
@@ -1844,11 +1919,11 @@ var InteractionsAPI = class {
|
|
|
1844
1919
|
* @param options - The options for replying
|
|
1845
1920
|
*/
|
|
1846
1921
|
async reply(interactionId, interactionToken, { files, ...data }, { signal } = {}) {
|
|
1847
|
-
await this.rest.post(
|
|
1922
|
+
await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1848
1923
|
files,
|
|
1849
1924
|
auth: false,
|
|
1850
1925
|
body: {
|
|
1851
|
-
type:
|
|
1926
|
+
type: import_v107.InteractionResponseType.ChannelMessageWithSource,
|
|
1852
1927
|
data
|
|
1853
1928
|
},
|
|
1854
1929
|
signal
|
|
@@ -1864,10 +1939,10 @@ var InteractionsAPI = class {
|
|
|
1864
1939
|
* @param options - The options for deferring
|
|
1865
1940
|
*/
|
|
1866
1941
|
async defer(interactionId, interactionToken, data, { signal } = {}) {
|
|
1867
|
-
await this.rest.post(
|
|
1942
|
+
await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1868
1943
|
auth: false,
|
|
1869
1944
|
body: {
|
|
1870
|
-
type:
|
|
1945
|
+
type: import_v107.InteractionResponseType.DeferredChannelMessageWithSource,
|
|
1871
1946
|
data
|
|
1872
1947
|
},
|
|
1873
1948
|
signal
|
|
@@ -1882,10 +1957,10 @@ var InteractionsAPI = class {
|
|
|
1882
1957
|
* @param options - The options for deferring
|
|
1883
1958
|
*/
|
|
1884
1959
|
async deferMessageUpdate(interactionId, interactionToken, { signal } = {}) {
|
|
1885
|
-
await this.rest.post(
|
|
1960
|
+
await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1886
1961
|
auth: false,
|
|
1887
1962
|
body: {
|
|
1888
|
-
type:
|
|
1963
|
+
type: import_v107.InteractionResponseType.DeferredMessageUpdate
|
|
1889
1964
|
},
|
|
1890
1965
|
signal
|
|
1891
1966
|
});
|
|
@@ -1958,11 +2033,11 @@ var InteractionsAPI = class {
|
|
|
1958
2033
|
* @param options - The options for updating the interaction
|
|
1959
2034
|
*/
|
|
1960
2035
|
async updateMessage(interactionId, interactionToken, { files, ...data }, { signal } = {}) {
|
|
1961
|
-
await this.rest.post(
|
|
2036
|
+
await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1962
2037
|
files,
|
|
1963
2038
|
auth: false,
|
|
1964
2039
|
body: {
|
|
1965
|
-
type:
|
|
2040
|
+
type: import_v107.InteractionResponseType.UpdateMessage,
|
|
1966
2041
|
data
|
|
1967
2042
|
},
|
|
1968
2043
|
signal
|
|
@@ -1978,10 +2053,10 @@ var InteractionsAPI = class {
|
|
|
1978
2053
|
* @param options - The options for sending the autocomplete response
|
|
1979
2054
|
*/
|
|
1980
2055
|
async createAutocompleteResponse(interactionId, interactionToken, callbackData, { signal } = {}) {
|
|
1981
|
-
await this.rest.post(
|
|
2056
|
+
await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1982
2057
|
auth: false,
|
|
1983
2058
|
body: {
|
|
1984
|
-
type:
|
|
2059
|
+
type: import_v107.InteractionResponseType.ApplicationCommandAutocompleteResult,
|
|
1985
2060
|
data: callbackData
|
|
1986
2061
|
},
|
|
1987
2062
|
signal
|
|
@@ -1997,10 +2072,10 @@ var InteractionsAPI = class {
|
|
|
1997
2072
|
* @param options - The options for sending the modal
|
|
1998
2073
|
*/
|
|
1999
2074
|
async createModal(interactionId, interactionToken, callbackData, { signal } = {}) {
|
|
2000
|
-
await this.rest.post(
|
|
2075
|
+
await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
|
|
2001
2076
|
auth: false,
|
|
2002
2077
|
body: {
|
|
2003
|
-
type:
|
|
2078
|
+
type: import_v107.InteractionResponseType.Modal,
|
|
2004
2079
|
data: callbackData
|
|
2005
2080
|
},
|
|
2006
2081
|
signal
|
|
@@ -2016,10 +2091,10 @@ var InteractionsAPI = class {
|
|
|
2016
2091
|
* @deprecated Sending a premium-style button is the new Discord behavior.
|
|
2017
2092
|
*/
|
|
2018
2093
|
async sendPremiumRequired(interactionId, interactionToken, { signal } = {}) {
|
|
2019
|
-
await this.rest.post(
|
|
2094
|
+
await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
|
|
2020
2095
|
auth: false,
|
|
2021
2096
|
body: {
|
|
2022
|
-
type:
|
|
2097
|
+
type: import_v107.InteractionResponseType.PremiumRequired
|
|
2023
2098
|
},
|
|
2024
2099
|
signal
|
|
2025
2100
|
});
|
|
@@ -2028,7 +2103,7 @@ var InteractionsAPI = class {
|
|
|
2028
2103
|
|
|
2029
2104
|
// src/api/invite.ts
|
|
2030
2105
|
var import_rest4 = require("@discordjs/rest");
|
|
2031
|
-
var
|
|
2106
|
+
var import_v108 = require("discord-api-types/v10");
|
|
2032
2107
|
var InvitesAPI = class {
|
|
2033
2108
|
constructor(rest) {
|
|
2034
2109
|
this.rest = rest;
|
|
@@ -2045,7 +2120,7 @@ var InvitesAPI = class {
|
|
|
2045
2120
|
* @param options - The options for fetching the invite
|
|
2046
2121
|
*/
|
|
2047
2122
|
async get(code, query = {}, { signal } = {}) {
|
|
2048
|
-
return this.rest.get(
|
|
2123
|
+
return this.rest.get(import_v108.Routes.invite(code), {
|
|
2049
2124
|
query: (0, import_rest4.makeURLSearchParams)(query),
|
|
2050
2125
|
signal
|
|
2051
2126
|
});
|
|
@@ -2058,13 +2133,13 @@ var InvitesAPI = class {
|
|
|
2058
2133
|
* @param options - The options for deleting the invite
|
|
2059
2134
|
*/
|
|
2060
2135
|
async delete(code, { reason, signal } = {}) {
|
|
2061
|
-
await this.rest.delete(
|
|
2136
|
+
await this.rest.delete(import_v108.Routes.invite(code), { reason, signal });
|
|
2062
2137
|
}
|
|
2063
2138
|
};
|
|
2064
2139
|
|
|
2065
2140
|
// src/api/monetization.ts
|
|
2066
2141
|
var import_rest5 = require("@discordjs/rest");
|
|
2067
|
-
var
|
|
2142
|
+
var import_v109 = require("discord-api-types/v10");
|
|
2068
2143
|
var MonetizationAPI = class {
|
|
2069
2144
|
constructor(rest) {
|
|
2070
2145
|
this.rest = rest;
|
|
@@ -2079,7 +2154,7 @@ var MonetizationAPI = class {
|
|
|
2079
2154
|
* @param options - The options for fetching the SKUs.
|
|
2080
2155
|
*/
|
|
2081
2156
|
async getSKUs(applicationId, { signal } = {}) {
|
|
2082
|
-
return this.rest.get(
|
|
2157
|
+
return this.rest.get(import_v109.Routes.skus(applicationId), { signal });
|
|
2083
2158
|
}
|
|
2084
2159
|
/**
|
|
2085
2160
|
* Fetches the entitlements for an application.
|
|
@@ -2090,7 +2165,7 @@ var MonetizationAPI = class {
|
|
|
2090
2165
|
* @param options - The options for fetching entitlements
|
|
2091
2166
|
*/
|
|
2092
2167
|
async getEntitlements(applicationId, query, { signal } = {}) {
|
|
2093
|
-
return this.rest.get(
|
|
2168
|
+
return this.rest.get(import_v109.Routes.entitlements(applicationId), {
|
|
2094
2169
|
signal,
|
|
2095
2170
|
query: (0, import_rest5.makeURLSearchParams)(query)
|
|
2096
2171
|
});
|
|
@@ -2104,7 +2179,7 @@ var MonetizationAPI = class {
|
|
|
2104
2179
|
* @param options - The options for creating the entitlement
|
|
2105
2180
|
*/
|
|
2106
2181
|
async createTestEntitlement(applicationId, body, { signal } = {}) {
|
|
2107
|
-
return this.rest.post(
|
|
2182
|
+
return this.rest.post(import_v109.Routes.entitlements(applicationId), {
|
|
2108
2183
|
body,
|
|
2109
2184
|
signal
|
|
2110
2185
|
});
|
|
@@ -2118,7 +2193,7 @@ var MonetizationAPI = class {
|
|
|
2118
2193
|
* @param options - The options for deleting the entitlement
|
|
2119
2194
|
*/
|
|
2120
2195
|
async deleteTestEntitlement(applicationId, entitlementId, { signal } = {}) {
|
|
2121
|
-
await this.rest.delete(
|
|
2196
|
+
await this.rest.delete(import_v109.Routes.entitlement(applicationId, entitlementId), { signal });
|
|
2122
2197
|
}
|
|
2123
2198
|
/**
|
|
2124
2199
|
* Marks a given entitlement for the user as consumed. Only available for One-Time Purchase consumable SKUs.
|
|
@@ -2129,13 +2204,13 @@ var MonetizationAPI = class {
|
|
|
2129
2204
|
* @param options - The options for consuming the entitlement
|
|
2130
2205
|
*/
|
|
2131
2206
|
async consumeEntitlement(applicationId, entitlementId, { signal } = {}) {
|
|
2132
|
-
await this.rest.post(
|
|
2207
|
+
await this.rest.post(import_v109.Routes.consumeEntitlement(applicationId, entitlementId), { signal });
|
|
2133
2208
|
}
|
|
2134
2209
|
};
|
|
2135
2210
|
|
|
2136
2211
|
// src/api/oauth2.ts
|
|
2137
2212
|
var import_rest6 = require("@discordjs/rest");
|
|
2138
|
-
var
|
|
2213
|
+
var import_v1010 = require("discord-api-types/v10");
|
|
2139
2214
|
var OAuth2API = class {
|
|
2140
2215
|
constructor(rest) {
|
|
2141
2216
|
this.rest = rest;
|
|
@@ -2150,7 +2225,7 @@ var OAuth2API = class {
|
|
|
2150
2225
|
* @param options - The options for creating the authorization URL
|
|
2151
2226
|
*/
|
|
2152
2227
|
generateAuthorizationURL(options) {
|
|
2153
|
-
const url = new URL(`${
|
|
2228
|
+
const url = new URL(`${import_v1010.RouteBases.api}${import_v1010.Routes.oauth2Authorization()}`);
|
|
2154
2229
|
url.search = (0, import_rest6.makeURLSearchParams)(options).toString();
|
|
2155
2230
|
return url.toString();
|
|
2156
2231
|
}
|
|
@@ -2162,7 +2237,7 @@ var OAuth2API = class {
|
|
|
2162
2237
|
* @param options - The options for the token exchange request
|
|
2163
2238
|
*/
|
|
2164
2239
|
async tokenExchange(body, { signal } = {}) {
|
|
2165
|
-
return this.rest.post(
|
|
2240
|
+
return this.rest.post(import_v1010.Routes.oauth2TokenExchange(), {
|
|
2166
2241
|
body: (0, import_rest6.makeURLSearchParams)(body),
|
|
2167
2242
|
passThroughBody: true,
|
|
2168
2243
|
headers: {
|
|
@@ -2180,7 +2255,7 @@ var OAuth2API = class {
|
|
|
2180
2255
|
* @param options - The options for the refresh token request
|
|
2181
2256
|
*/
|
|
2182
2257
|
async refreshToken(body, { signal } = {}) {
|
|
2183
|
-
return this.rest.post(
|
|
2258
|
+
return this.rest.post(import_v1010.Routes.oauth2TokenExchange(), {
|
|
2184
2259
|
body: (0, import_rest6.makeURLSearchParams)(body),
|
|
2185
2260
|
passThroughBody: true,
|
|
2186
2261
|
headers: {
|
|
@@ -2200,7 +2275,7 @@ var OAuth2API = class {
|
|
|
2200
2275
|
* @param options - The options for the client credentials grant request
|
|
2201
2276
|
*/
|
|
2202
2277
|
async getToken(body, { signal } = {}) {
|
|
2203
|
-
return this.rest.post(
|
|
2278
|
+
return this.rest.post(import_v1010.Routes.oauth2TokenExchange(), {
|
|
2204
2279
|
body: (0, import_rest6.makeURLSearchParams)(body),
|
|
2205
2280
|
passThroughBody: true,
|
|
2206
2281
|
headers: {
|
|
@@ -2217,7 +2292,7 @@ var OAuth2API = class {
|
|
|
2217
2292
|
* @param options - The options for the current bot application information request
|
|
2218
2293
|
*/
|
|
2219
2294
|
async getCurrentBotApplicationInformation({ signal } = {}) {
|
|
2220
|
-
return this.rest.get(
|
|
2295
|
+
return this.rest.get(import_v1010.Routes.oauth2CurrentApplication(), {
|
|
2221
2296
|
signal
|
|
2222
2297
|
});
|
|
2223
2298
|
}
|
|
@@ -2228,7 +2303,7 @@ var OAuth2API = class {
|
|
|
2228
2303
|
* @param options - The options for the current authorization information request
|
|
2229
2304
|
*/
|
|
2230
2305
|
async getCurrentAuthorizationInformation({ signal } = {}) {
|
|
2231
|
-
return this.rest.get(
|
|
2306
|
+
return this.rest.get(import_v1010.Routes.oauth2CurrentAuthorization(), {
|
|
2232
2307
|
signal
|
|
2233
2308
|
});
|
|
2234
2309
|
}
|
|
@@ -2242,7 +2317,7 @@ var OAuth2API = class {
|
|
|
2242
2317
|
* @param options - The options for the token revocation request
|
|
2243
2318
|
*/
|
|
2244
2319
|
async revokeToken(applicationId, applicationSecret, body, { signal } = {}) {
|
|
2245
|
-
await this.rest.post(
|
|
2320
|
+
await this.rest.post(import_v1010.Routes.oauth2TokenRevocation(), {
|
|
2246
2321
|
body: (0, import_rest6.makeURLSearchParams)(body),
|
|
2247
2322
|
passThroughBody: true,
|
|
2248
2323
|
headers: {
|
|
@@ -2257,7 +2332,7 @@ var OAuth2API = class {
|
|
|
2257
2332
|
|
|
2258
2333
|
// src/api/poll.ts
|
|
2259
2334
|
var import_rest7 = require("@discordjs/rest");
|
|
2260
|
-
var
|
|
2335
|
+
var import_v1011 = require("discord-api-types/v10");
|
|
2261
2336
|
var PollAPI = class {
|
|
2262
2337
|
constructor(rest) {
|
|
2263
2338
|
this.rest = rest;
|
|
@@ -2276,7 +2351,7 @@ var PollAPI = class {
|
|
|
2276
2351
|
* @param options - The options for getting the list of voters
|
|
2277
2352
|
*/
|
|
2278
2353
|
async getAnswerVoters(channelId, messageId, answerId, query, { signal } = {}) {
|
|
2279
|
-
return this.rest.get(
|
|
2354
|
+
return this.rest.get(import_v1011.Routes.pollAnswerVoters(channelId, messageId, answerId), {
|
|
2280
2355
|
signal,
|
|
2281
2356
|
query: (0, import_rest7.makeURLSearchParams)(query)
|
|
2282
2357
|
});
|
|
@@ -2290,14 +2365,14 @@ var PollAPI = class {
|
|
|
2290
2365
|
* @param options - The options for expiring the poll
|
|
2291
2366
|
*/
|
|
2292
2367
|
async expirePoll(channelId, messageId, { signal } = {}) {
|
|
2293
|
-
return this.rest.post(
|
|
2368
|
+
return this.rest.post(import_v1011.Routes.expirePoll(channelId, messageId), {
|
|
2294
2369
|
signal
|
|
2295
2370
|
});
|
|
2296
2371
|
}
|
|
2297
2372
|
};
|
|
2298
2373
|
|
|
2299
2374
|
// src/api/roleConnections.ts
|
|
2300
|
-
var
|
|
2375
|
+
var import_v1012 = require("discord-api-types/v10");
|
|
2301
2376
|
var RoleConnectionsAPI = class {
|
|
2302
2377
|
constructor(rest) {
|
|
2303
2378
|
this.rest = rest;
|
|
@@ -2313,7 +2388,7 @@ var RoleConnectionsAPI = class {
|
|
|
2313
2388
|
* @param options - The options for fetching the role connection metadata records
|
|
2314
2389
|
*/
|
|
2315
2390
|
async getMetadataRecords(applicationId, { signal } = {}) {
|
|
2316
|
-
return this.rest.get(
|
|
2391
|
+
return this.rest.get(import_v1012.Routes.applicationRoleConnectionMetadata(applicationId), {
|
|
2317
2392
|
signal
|
|
2318
2393
|
});
|
|
2319
2394
|
}
|
|
@@ -2326,7 +2401,7 @@ var RoleConnectionsAPI = class {
|
|
|
2326
2401
|
* @param options - The options for updating the role connection metadata records
|
|
2327
2402
|
*/
|
|
2328
2403
|
async updateMetadataRecords(applicationId, body, { signal } = {}) {
|
|
2329
|
-
return this.rest.put(
|
|
2404
|
+
return this.rest.put(import_v1012.Routes.applicationRoleConnectionMetadata(applicationId), {
|
|
2330
2405
|
body,
|
|
2331
2406
|
signal
|
|
2332
2407
|
});
|
|
@@ -2334,7 +2409,7 @@ var RoleConnectionsAPI = class {
|
|
|
2334
2409
|
};
|
|
2335
2410
|
|
|
2336
2411
|
// src/api/stageInstances.ts
|
|
2337
|
-
var
|
|
2412
|
+
var import_v1013 = require("discord-api-types/v10");
|
|
2338
2413
|
var StageInstancesAPI = class {
|
|
2339
2414
|
constructor(rest) {
|
|
2340
2415
|
this.rest = rest;
|
|
@@ -2350,7 +2425,7 @@ var StageInstancesAPI = class {
|
|
|
2350
2425
|
* @param options - The options for creating the new stage instance
|
|
2351
2426
|
*/
|
|
2352
2427
|
async create(body, { reason, signal } = {}) {
|
|
2353
|
-
return this.rest.post(
|
|
2428
|
+
return this.rest.post(import_v1013.Routes.stageInstances(), {
|
|
2354
2429
|
body,
|
|
2355
2430
|
reason,
|
|
2356
2431
|
signal
|
|
@@ -2364,7 +2439,7 @@ var StageInstancesAPI = class {
|
|
|
2364
2439
|
* @param options - The options for fetching the stage instance
|
|
2365
2440
|
*/
|
|
2366
2441
|
async get(channelId, { signal } = {}) {
|
|
2367
|
-
return this.rest.get(
|
|
2442
|
+
return this.rest.get(import_v1013.Routes.stageInstance(channelId), { signal });
|
|
2368
2443
|
}
|
|
2369
2444
|
/**
|
|
2370
2445
|
* Edits a stage instance
|
|
@@ -2375,7 +2450,7 @@ var StageInstancesAPI = class {
|
|
|
2375
2450
|
* @param options - The options for editing the stage instance
|
|
2376
2451
|
*/
|
|
2377
2452
|
async edit(channelId, body, { reason, signal } = {}) {
|
|
2378
|
-
return this.rest.patch(
|
|
2453
|
+
return this.rest.patch(import_v1013.Routes.stageInstance(channelId), {
|
|
2379
2454
|
body,
|
|
2380
2455
|
reason,
|
|
2381
2456
|
signal
|
|
@@ -2389,12 +2464,12 @@ var StageInstancesAPI = class {
|
|
|
2389
2464
|
* @param options - The options for deleting the stage instance
|
|
2390
2465
|
*/
|
|
2391
2466
|
async delete(channelId, { reason, signal } = {}) {
|
|
2392
|
-
await this.rest.delete(
|
|
2467
|
+
await this.rest.delete(import_v1013.Routes.stageInstance(channelId), { reason, signal });
|
|
2393
2468
|
}
|
|
2394
2469
|
};
|
|
2395
2470
|
|
|
2396
2471
|
// src/api/sticker.ts
|
|
2397
|
-
var
|
|
2472
|
+
var import_v1014 = require("discord-api-types/v10");
|
|
2398
2473
|
var StickersAPI = class {
|
|
2399
2474
|
constructor(rest) {
|
|
2400
2475
|
this.rest = rest;
|
|
@@ -2410,7 +2485,7 @@ var StickersAPI = class {
|
|
|
2410
2485
|
* @param options - The options for fetching the sticker pack
|
|
2411
2486
|
*/
|
|
2412
2487
|
async getStickerPack(packId, { signal } = {}) {
|
|
2413
|
-
return this.rest.get(
|
|
2488
|
+
return this.rest.get(import_v1014.Routes.stickerPack(packId), { signal });
|
|
2414
2489
|
}
|
|
2415
2490
|
/**
|
|
2416
2491
|
* Fetches all of the sticker packs
|
|
@@ -2419,7 +2494,7 @@ var StickersAPI = class {
|
|
|
2419
2494
|
* @param options - The options for fetching the sticker packs
|
|
2420
2495
|
*/
|
|
2421
2496
|
async getStickers({ signal } = {}) {
|
|
2422
|
-
return this.rest.get(
|
|
2497
|
+
return this.rest.get(import_v1014.Routes.stickerPacks(), { signal });
|
|
2423
2498
|
}
|
|
2424
2499
|
/**
|
|
2425
2500
|
* Fetches all of the sticker packs
|
|
@@ -2439,12 +2514,12 @@ var StickersAPI = class {
|
|
|
2439
2514
|
* @param options - The options for fetching the sticker
|
|
2440
2515
|
*/
|
|
2441
2516
|
async get(stickerId, { signal } = {}) {
|
|
2442
|
-
return this.rest.get(
|
|
2517
|
+
return this.rest.get(import_v1014.Routes.sticker(stickerId), { signal });
|
|
2443
2518
|
}
|
|
2444
2519
|
};
|
|
2445
2520
|
|
|
2446
2521
|
// src/api/thread.ts
|
|
2447
|
-
var
|
|
2522
|
+
var import_v1015 = require("discord-api-types/v10");
|
|
2448
2523
|
var ThreadsAPI = class {
|
|
2449
2524
|
constructor(rest) {
|
|
2450
2525
|
this.rest = rest;
|
|
@@ -2460,7 +2535,7 @@ var ThreadsAPI = class {
|
|
|
2460
2535
|
* @param options - The options for joining the thread
|
|
2461
2536
|
*/
|
|
2462
2537
|
async join(threadId, { signal } = {}) {
|
|
2463
|
-
await this.rest.put(
|
|
2538
|
+
await this.rest.put(import_v1015.Routes.threadMembers(threadId, "@me"), { signal });
|
|
2464
2539
|
}
|
|
2465
2540
|
/**
|
|
2466
2541
|
* Adds a member to a thread
|
|
@@ -2471,7 +2546,7 @@ var ThreadsAPI = class {
|
|
|
2471
2546
|
* @param options - The options for adding the member to the thread
|
|
2472
2547
|
*/
|
|
2473
2548
|
async addMember(threadId, userId, { signal } = {}) {
|
|
2474
|
-
await this.rest.put(
|
|
2549
|
+
await this.rest.put(import_v1015.Routes.threadMembers(threadId, userId), { signal });
|
|
2475
2550
|
}
|
|
2476
2551
|
/**
|
|
2477
2552
|
* Removes the current user from a thread
|
|
@@ -2481,7 +2556,7 @@ var ThreadsAPI = class {
|
|
|
2481
2556
|
* @param options - The options for leaving the thread
|
|
2482
2557
|
*/
|
|
2483
2558
|
async leave(threadId, { signal } = {}) {
|
|
2484
|
-
await this.rest.delete(
|
|
2559
|
+
await this.rest.delete(import_v1015.Routes.threadMembers(threadId, "@me"), { signal });
|
|
2485
2560
|
}
|
|
2486
2561
|
/**
|
|
2487
2562
|
* Removes a member from a thread
|
|
@@ -2492,7 +2567,7 @@ var ThreadsAPI = class {
|
|
|
2492
2567
|
* @param options - The options for removing the member from the thread
|
|
2493
2568
|
*/
|
|
2494
2569
|
async removeMember(threadId, userId, { signal } = {}) {
|
|
2495
|
-
await this.rest.delete(
|
|
2570
|
+
await this.rest.delete(import_v1015.Routes.threadMembers(threadId, userId), { signal });
|
|
2496
2571
|
}
|
|
2497
2572
|
/**
|
|
2498
2573
|
* Fetches a member of a thread
|
|
@@ -2503,7 +2578,7 @@ var ThreadsAPI = class {
|
|
|
2503
2578
|
* @param options - The options for fetching the member
|
|
2504
2579
|
*/
|
|
2505
2580
|
async getMember(threadId, userId, { signal } = {}) {
|
|
2506
|
-
return this.rest.get(
|
|
2581
|
+
return this.rest.get(import_v1015.Routes.threadMembers(threadId, userId), { signal });
|
|
2507
2582
|
}
|
|
2508
2583
|
/**
|
|
2509
2584
|
* Fetches all members of a thread
|
|
@@ -2513,13 +2588,13 @@ var ThreadsAPI = class {
|
|
|
2513
2588
|
* @param options - The options for fetching the members
|
|
2514
2589
|
*/
|
|
2515
2590
|
async getAllMembers(threadId, { signal } = {}) {
|
|
2516
|
-
return this.rest.get(
|
|
2591
|
+
return this.rest.get(import_v1015.Routes.threadMembers(threadId), { signal });
|
|
2517
2592
|
}
|
|
2518
2593
|
};
|
|
2519
2594
|
|
|
2520
2595
|
// src/api/user.ts
|
|
2521
2596
|
var import_rest8 = require("@discordjs/rest");
|
|
2522
|
-
var
|
|
2597
|
+
var import_v1016 = require("discord-api-types/v10");
|
|
2523
2598
|
var UsersAPI = class {
|
|
2524
2599
|
constructor(rest) {
|
|
2525
2600
|
this.rest = rest;
|
|
@@ -2535,7 +2610,7 @@ var UsersAPI = class {
|
|
|
2535
2610
|
* @param options - The options for fetching the user
|
|
2536
2611
|
*/
|
|
2537
2612
|
async get(userId, { signal } = {}) {
|
|
2538
|
-
return this.rest.get(
|
|
2613
|
+
return this.rest.get(import_v1016.Routes.user(userId), { signal });
|
|
2539
2614
|
}
|
|
2540
2615
|
/**
|
|
2541
2616
|
* Returns the user object of the requester's account
|
|
@@ -2544,7 +2619,7 @@ var UsersAPI = class {
|
|
|
2544
2619
|
* @param options - The options for fetching the current user
|
|
2545
2620
|
*/
|
|
2546
2621
|
async getCurrent({ signal } = {}) {
|
|
2547
|
-
return this.rest.get(
|
|
2622
|
+
return this.rest.get(import_v1016.Routes.user("@me"), { signal });
|
|
2548
2623
|
}
|
|
2549
2624
|
/**
|
|
2550
2625
|
* Returns a list of partial guild objects the current user is a member of
|
|
@@ -2554,7 +2629,7 @@ var UsersAPI = class {
|
|
|
2554
2629
|
* @param options - The options for fetching the guilds
|
|
2555
2630
|
*/
|
|
2556
2631
|
async getGuilds(query = {}, { signal } = {}) {
|
|
2557
|
-
return this.rest.get(
|
|
2632
|
+
return this.rest.get(import_v1016.Routes.userGuilds(), {
|
|
2558
2633
|
query: (0, import_rest8.makeURLSearchParams)(query),
|
|
2559
2634
|
signal
|
|
2560
2635
|
});
|
|
@@ -2567,7 +2642,7 @@ var UsersAPI = class {
|
|
|
2567
2642
|
* @param options - The options for leaving the guild
|
|
2568
2643
|
*/
|
|
2569
2644
|
async leaveGuild(guildId, { signal } = {}) {
|
|
2570
|
-
await this.rest.delete(
|
|
2645
|
+
await this.rest.delete(import_v1016.Routes.userGuild(guildId), { signal });
|
|
2571
2646
|
}
|
|
2572
2647
|
/**
|
|
2573
2648
|
* Edits the current user
|
|
@@ -2577,7 +2652,7 @@ var UsersAPI = class {
|
|
|
2577
2652
|
* @param options - The options for editing the user
|
|
2578
2653
|
*/
|
|
2579
2654
|
async edit(body, { signal } = {}) {
|
|
2580
|
-
return this.rest.patch(
|
|
2655
|
+
return this.rest.patch(import_v1016.Routes.user("@me"), { body, signal });
|
|
2581
2656
|
}
|
|
2582
2657
|
/**
|
|
2583
2658
|
* Fetches the guild member for the current user
|
|
@@ -2587,7 +2662,7 @@ var UsersAPI = class {
|
|
|
2587
2662
|
* @param options - The options for fetching the guild member
|
|
2588
2663
|
*/
|
|
2589
2664
|
async getGuildMember(guildId, { signal } = {}) {
|
|
2590
|
-
return this.rest.get(
|
|
2665
|
+
return this.rest.get(import_v1016.Routes.userGuildMember(guildId), { signal });
|
|
2591
2666
|
}
|
|
2592
2667
|
/**
|
|
2593
2668
|
* Edits the guild member for the current user
|
|
@@ -2598,7 +2673,7 @@ var UsersAPI = class {
|
|
|
2598
2673
|
* @param options - The options for editing the guild member
|
|
2599
2674
|
*/
|
|
2600
2675
|
async editCurrentGuildMember(guildId, body = {}, { reason, signal } = {}) {
|
|
2601
|
-
return this.rest.patch(
|
|
2676
|
+
return this.rest.patch(import_v1016.Routes.guildMember(guildId, "@me"), {
|
|
2602
2677
|
reason,
|
|
2603
2678
|
body,
|
|
2604
2679
|
signal
|
|
@@ -2612,7 +2687,7 @@ var UsersAPI = class {
|
|
|
2612
2687
|
* @param options - The options for opening the DM
|
|
2613
2688
|
*/
|
|
2614
2689
|
async createDM(userId, { signal } = {}) {
|
|
2615
|
-
return this.rest.post(
|
|
2690
|
+
return this.rest.post(import_v1016.Routes.userChannels(), {
|
|
2616
2691
|
body: { recipient_id: userId },
|
|
2617
2692
|
signal
|
|
2618
2693
|
});
|
|
@@ -2624,7 +2699,7 @@ var UsersAPI = class {
|
|
|
2624
2699
|
* @param options - The options for fetching the user's connections
|
|
2625
2700
|
*/
|
|
2626
2701
|
async getConnections({ signal } = {}) {
|
|
2627
|
-
return this.rest.get(
|
|
2702
|
+
return this.rest.get(import_v1016.Routes.userConnections(), { signal });
|
|
2628
2703
|
}
|
|
2629
2704
|
/**
|
|
2630
2705
|
* Gets the current user's active application role connection
|
|
@@ -2634,7 +2709,7 @@ var UsersAPI = class {
|
|
|
2634
2709
|
* @param options - The options for fetching the role connections
|
|
2635
2710
|
*/
|
|
2636
2711
|
async getApplicationRoleConnection(applicationId, { signal } = {}) {
|
|
2637
|
-
return this.rest.get(
|
|
2712
|
+
return this.rest.get(import_v1016.Routes.userApplicationRoleConnection(applicationId), {
|
|
2638
2713
|
signal
|
|
2639
2714
|
});
|
|
2640
2715
|
}
|
|
@@ -2647,7 +2722,7 @@ var UsersAPI = class {
|
|
|
2647
2722
|
* @param options - The options for updating the application role connection
|
|
2648
2723
|
*/
|
|
2649
2724
|
async updateApplicationRoleConnection(applicationId, body, { signal } = {}) {
|
|
2650
|
-
return this.rest.put(
|
|
2725
|
+
return this.rest.put(import_v1016.Routes.userApplicationRoleConnection(applicationId), {
|
|
2651
2726
|
body,
|
|
2652
2727
|
signal
|
|
2653
2728
|
});
|
|
@@ -2656,7 +2731,7 @@ var UsersAPI = class {
|
|
|
2656
2731
|
|
|
2657
2732
|
// src/api/webhook.ts
|
|
2658
2733
|
var import_rest9 = require("@discordjs/rest");
|
|
2659
|
-
var
|
|
2734
|
+
var import_v1017 = require("discord-api-types/v10");
|
|
2660
2735
|
var WebhooksAPI = class {
|
|
2661
2736
|
constructor(rest) {
|
|
2662
2737
|
this.rest = rest;
|
|
@@ -2673,7 +2748,7 @@ var WebhooksAPI = class {
|
|
|
2673
2748
|
* @param options - The options for fetching the webhook
|
|
2674
2749
|
*/
|
|
2675
2750
|
async get(id, { token, signal } = {}) {
|
|
2676
|
-
return this.rest.get(
|
|
2751
|
+
return this.rest.get(import_v1017.Routes.webhook(id, token), {
|
|
2677
2752
|
signal,
|
|
2678
2753
|
auth: !token
|
|
2679
2754
|
});
|
|
@@ -2688,7 +2763,7 @@ var WebhooksAPI = class {
|
|
|
2688
2763
|
* @param options - The options for editing the webhook
|
|
2689
2764
|
*/
|
|
2690
2765
|
async edit(id, body, { token, reason, signal } = {}) {
|
|
2691
|
-
return this.rest.patch(
|
|
2766
|
+
return this.rest.patch(import_v1017.Routes.webhook(id, token), {
|
|
2692
2767
|
reason,
|
|
2693
2768
|
body,
|
|
2694
2769
|
signal,
|
|
@@ -2704,7 +2779,7 @@ var WebhooksAPI = class {
|
|
|
2704
2779
|
* @param options - The options for deleting the webhook
|
|
2705
2780
|
*/
|
|
2706
2781
|
async delete(id, { token, reason, signal } = {}) {
|
|
2707
|
-
await this.rest.delete(
|
|
2782
|
+
await this.rest.delete(import_v1017.Routes.webhook(id, token), {
|
|
2708
2783
|
reason,
|
|
2709
2784
|
signal,
|
|
2710
2785
|
auth: !token
|
|
@@ -2726,7 +2801,7 @@ var WebhooksAPI = class {
|
|
|
2726
2801
|
files,
|
|
2727
2802
|
...body
|
|
2728
2803
|
}, { signal } = {}) {
|
|
2729
|
-
return this.rest.post(
|
|
2804
|
+
return this.rest.post(import_v1017.Routes.webhook(id, token), {
|
|
2730
2805
|
query: (0, import_rest9.makeURLSearchParams)({ wait, thread_id, with_components }),
|
|
2731
2806
|
files,
|
|
2732
2807
|
body,
|
|
@@ -2746,7 +2821,7 @@ var WebhooksAPI = class {
|
|
|
2746
2821
|
* @param options - The options for executing the webhook
|
|
2747
2822
|
*/
|
|
2748
2823
|
async executeSlack(id, token, body, query = {}, { signal } = {}) {
|
|
2749
|
-
await this.rest.post(
|
|
2824
|
+
await this.rest.post(import_v1017.Routes.webhookPlatform(id, token, "slack"), {
|
|
2750
2825
|
query: (0, import_rest9.makeURLSearchParams)(query),
|
|
2751
2826
|
body,
|
|
2752
2827
|
auth: false,
|
|
@@ -2764,7 +2839,7 @@ var WebhooksAPI = class {
|
|
|
2764
2839
|
* @param options - The options for executing the webhook
|
|
2765
2840
|
*/
|
|
2766
2841
|
async executeGitHub(id, token, body, query = {}, { signal } = {}) {
|
|
2767
|
-
await this.rest.post(
|
|
2842
|
+
await this.rest.post(import_v1017.Routes.webhookPlatform(id, token, "github"), {
|
|
2768
2843
|
query: (0, import_rest9.makeURLSearchParams)(query),
|
|
2769
2844
|
body,
|
|
2770
2845
|
signal,
|
|
@@ -2782,7 +2857,7 @@ var WebhooksAPI = class {
|
|
|
2782
2857
|
* @param options - The options for fetching the message
|
|
2783
2858
|
*/
|
|
2784
2859
|
async getMessage(id, token, messageId, query = {}, { signal } = {}) {
|
|
2785
|
-
return this.rest.get(
|
|
2860
|
+
return this.rest.get(import_v1017.Routes.webhookMessage(id, token, messageId), {
|
|
2786
2861
|
query: (0, import_rest9.makeURLSearchParams)(query),
|
|
2787
2862
|
auth: false,
|
|
2788
2863
|
signal
|
|
@@ -2804,7 +2879,7 @@ var WebhooksAPI = class {
|
|
|
2804
2879
|
files,
|
|
2805
2880
|
...body
|
|
2806
2881
|
}, { signal } = {}) {
|
|
2807
|
-
return this.rest.patch(
|
|
2882
|
+
return this.rest.patch(import_v1017.Routes.webhookMessage(id, token, messageId), {
|
|
2808
2883
|
query: (0, import_rest9.makeURLSearchParams)({ thread_id, with_components }),
|
|
2809
2884
|
auth: false,
|
|
2810
2885
|
body,
|
|
@@ -2823,7 +2898,7 @@ var WebhooksAPI = class {
|
|
|
2823
2898
|
* @param options - The options for deleting the message
|
|
2824
2899
|
*/
|
|
2825
2900
|
async deleteMessage(id, token, messageId, query = {}, { signal } = {}) {
|
|
2826
|
-
await this.rest.delete(
|
|
2901
|
+
await this.rest.delete(import_v1017.Routes.webhookMessage(id, token, messageId), {
|
|
2827
2902
|
query: (0, import_rest9.makeURLSearchParams)(query),
|
|
2828
2903
|
auth: false,
|
|
2829
2904
|
signal
|
|
@@ -2838,6 +2913,7 @@ var API = class {
|
|
|
2838
2913
|
this.applicationCommands = new ApplicationCommandsAPI(rest);
|
|
2839
2914
|
this.applications = new ApplicationsAPI(rest);
|
|
2840
2915
|
this.channels = new ChannelsAPI(rest);
|
|
2916
|
+
this.gateway = new GatewayAPI(rest);
|
|
2841
2917
|
this.guilds = new GuildsAPI(rest);
|
|
2842
2918
|
this.invites = new InvitesAPI(rest);
|
|
2843
2919
|
this.monetization = new MonetizationAPI(rest);
|
|
@@ -2858,6 +2934,7 @@ var API = class {
|
|
|
2858
2934
|
applicationCommands;
|
|
2859
2935
|
applications;
|
|
2860
2936
|
channels;
|
|
2937
|
+
gateway;
|
|
2861
2938
|
guilds;
|
|
2862
2939
|
interactions;
|
|
2863
2940
|
invites;
|
|
@@ -2879,7 +2956,7 @@ var import_util = require("@discordjs/util");
|
|
|
2879
2956
|
var import_ws = require("@discordjs/ws");
|
|
2880
2957
|
var import_snowflake = require("@sapphire/snowflake");
|
|
2881
2958
|
var import_async_event_emitter = require("@vladfrangu/async_event_emitter");
|
|
2882
|
-
var
|
|
2959
|
+
var import_v1018 = require("discord-api-types/v10");
|
|
2883
2960
|
var Client = class extends import_async_event_emitter.AsyncEventEmitter {
|
|
2884
2961
|
static {
|
|
2885
2962
|
__name(this, "Client");
|
|
@@ -2919,7 +2996,7 @@ var Client = class extends import_async_event_emitter.AsyncEventEmitter {
|
|
|
2919
2996
|
}, timeout), "createTimer");
|
|
2920
2997
|
let timer = createTimer();
|
|
2921
2998
|
await this.gateway.send(shardId, {
|
|
2922
|
-
op:
|
|
2999
|
+
op: import_v1018.GatewayOpcodes.RequestGuildMembers,
|
|
2923
3000
|
// eslint-disable-next-line id-length
|
|
2924
3001
|
d: {
|
|
2925
3002
|
...options,
|
|
@@ -2927,7 +3004,7 @@ var Client = class extends import_async_event_emitter.AsyncEventEmitter {
|
|
|
2927
3004
|
}
|
|
2928
3005
|
});
|
|
2929
3006
|
try {
|
|
2930
|
-
const iterator = import_async_event_emitter.AsyncEventEmitter.on(this,
|
|
3007
|
+
const iterator = import_async_event_emitter.AsyncEventEmitter.on(this, import_v1018.GatewayDispatchEvents.GuildMembersChunk, {
|
|
2931
3008
|
signal: controller.signal
|
|
2932
3009
|
});
|
|
2933
3010
|
for await (const [{ data }] of iterator) {
|
|
@@ -2992,7 +3069,7 @@ var Client = class extends import_async_event_emitter.AsyncEventEmitter {
|
|
|
2992
3069
|
async updateVoiceState(options) {
|
|
2993
3070
|
const shardId = (0, import_util.calculateShardId)(options.guild_id, await this.gateway.getShardCount());
|
|
2994
3071
|
await this.gateway.send(shardId, {
|
|
2995
|
-
op:
|
|
3072
|
+
op: import_v1018.GatewayOpcodes.VoiceStateUpdate,
|
|
2996
3073
|
// eslint-disable-next-line id-length
|
|
2997
3074
|
d: options
|
|
2998
3075
|
});
|
|
@@ -3005,7 +3082,7 @@ var Client = class extends import_async_event_emitter.AsyncEventEmitter {
|
|
|
3005
3082
|
*/
|
|
3006
3083
|
async updatePresence(shardId, options) {
|
|
3007
3084
|
await this.gateway.send(shardId, {
|
|
3008
|
-
op:
|
|
3085
|
+
op: import_v1018.GatewayOpcodes.PresenceUpdate,
|
|
3009
3086
|
// eslint-disable-next-line id-length
|
|
3010
3087
|
d: options
|
|
3011
3088
|
});
|
|
@@ -3038,7 +3115,7 @@ __name(withFiles, "withFiles");
|
|
|
3038
3115
|
|
|
3039
3116
|
// src/index.ts
|
|
3040
3117
|
__reExport(src_exports, require("discord-api-types/v10"), module.exports);
|
|
3041
|
-
var version = "2.
|
|
3118
|
+
var version = "2.3.0";
|
|
3042
3119
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3043
3120
|
0 && (module.exports = {
|
|
3044
3121
|
API,
|
|
@@ -3046,6 +3123,7 @@ var version = "2.2.2";
|
|
|
3046
3123
|
ApplicationsAPI,
|
|
3047
3124
|
ChannelsAPI,
|
|
3048
3125
|
Client,
|
|
3126
|
+
GatewayAPI,
|
|
3049
3127
|
GuildsAPI,
|
|
3050
3128
|
InteractionsAPI,
|
|
3051
3129
|
InvitesAPI,
|