@discordjs/core 2.2.1 → 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 +57 -6
- package/dist/http-only.d.ts +57 -6
- package/dist/http-only.js +240 -159
- package/dist/http-only.js.map +1 -1
- package/dist/http-only.mjs +232 -152
- package/dist/http-only.mjs.map +1 -1
- package/dist/index.d.mts +57 -6
- package/dist/index.d.ts +57 -6
- package/dist/index.js +245 -164
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +232 -152
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
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
|
}
|
|
@@ -904,9 +965,10 @@ var GuildsAPI = class {
|
|
|
904
965
|
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild}
|
|
905
966
|
* @param body - The guild to create
|
|
906
967
|
* @param options - The options for creating the guild
|
|
968
|
+
* @deprecated API related to guild ownership may no longer be used.
|
|
907
969
|
*/
|
|
908
970
|
async create(body, { signal } = {}) {
|
|
909
|
-
return this.rest.post(
|
|
971
|
+
return this.rest.post(import_v106.Routes.guilds(), { body, signal });
|
|
910
972
|
}
|
|
911
973
|
/**
|
|
912
974
|
* Edits a guild
|
|
@@ -917,7 +979,7 @@ var GuildsAPI = class {
|
|
|
917
979
|
* @param options - The options for editing the guild
|
|
918
980
|
*/
|
|
919
981
|
async edit(guildId, body, { reason, signal } = {}) {
|
|
920
|
-
return this.rest.patch(
|
|
982
|
+
return this.rest.patch(import_v106.Routes.guild(guildId), {
|
|
921
983
|
reason,
|
|
922
984
|
body,
|
|
923
985
|
signal
|
|
@@ -929,9 +991,10 @@ var GuildsAPI = class {
|
|
|
929
991
|
* @see {@link https://discord.com/developers/docs/resources/guild#delete-guild}
|
|
930
992
|
* @param guildId - The id of the guild to delete
|
|
931
993
|
* @param options - The options for deleting this guild
|
|
994
|
+
* @deprecated API related to guild ownership may no longer be used.
|
|
932
995
|
*/
|
|
933
996
|
async delete(guildId, { signal } = {}) {
|
|
934
|
-
await this.rest.delete(
|
|
997
|
+
await this.rest.delete(import_v106.Routes.guild(guildId), { signal });
|
|
935
998
|
}
|
|
936
999
|
/**
|
|
937
1000
|
* Adds user to the guild
|
|
@@ -943,7 +1006,7 @@ var GuildsAPI = class {
|
|
|
943
1006
|
* @param options - The options for adding users to the guild
|
|
944
1007
|
*/
|
|
945
1008
|
async addMember(guildId, userId, body, { signal } = {}) {
|
|
946
|
-
return this.rest.put(
|
|
1009
|
+
return this.rest.put(import_v106.Routes.guildMember(guildId, userId), {
|
|
947
1010
|
body,
|
|
948
1011
|
signal
|
|
949
1012
|
});
|
|
@@ -957,7 +1020,7 @@ var GuildsAPI = class {
|
|
|
957
1020
|
* @param options - The options for fetching the guild members
|
|
958
1021
|
*/
|
|
959
1022
|
async getMembers(guildId, query = {}, { signal } = {}) {
|
|
960
|
-
return this.rest.get(
|
|
1023
|
+
return this.rest.get(import_v106.Routes.guildMembers(guildId), {
|
|
961
1024
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
962
1025
|
signal
|
|
963
1026
|
});
|
|
@@ -970,7 +1033,7 @@ var GuildsAPI = class {
|
|
|
970
1033
|
* @param options - The options for fetching the guild channels
|
|
971
1034
|
*/
|
|
972
1035
|
async getChannels(guildId, { signal } = {}) {
|
|
973
|
-
return this.rest.get(
|
|
1036
|
+
return this.rest.get(import_v106.Routes.guildChannels(guildId), {
|
|
974
1037
|
signal
|
|
975
1038
|
});
|
|
976
1039
|
}
|
|
@@ -983,7 +1046,7 @@ var GuildsAPI = class {
|
|
|
983
1046
|
* @param options - The options for creating the guild channel
|
|
984
1047
|
*/
|
|
985
1048
|
async createChannel(guildId, body, { reason, signal } = {}) {
|
|
986
|
-
return this.rest.post(
|
|
1049
|
+
return this.rest.post(import_v106.Routes.guildChannels(guildId), {
|
|
987
1050
|
reason,
|
|
988
1051
|
body,
|
|
989
1052
|
signal
|
|
@@ -998,7 +1061,7 @@ var GuildsAPI = class {
|
|
|
998
1061
|
* @param options - The options for editing the guild channel positions
|
|
999
1062
|
*/
|
|
1000
1063
|
async setChannelPositions(guildId, body, { reason, signal } = {}) {
|
|
1001
|
-
await this.rest.patch(
|
|
1064
|
+
await this.rest.patch(import_v106.Routes.guildChannels(guildId), { reason, body, signal });
|
|
1002
1065
|
}
|
|
1003
1066
|
/**
|
|
1004
1067
|
* Fetches the active threads in a guild
|
|
@@ -1008,7 +1071,7 @@ var GuildsAPI = class {
|
|
|
1008
1071
|
* @param options - The options for fetching the active threads
|
|
1009
1072
|
*/
|
|
1010
1073
|
async getActiveThreads(guildId, { signal } = {}) {
|
|
1011
|
-
return this.rest.get(
|
|
1074
|
+
return this.rest.get(import_v106.Routes.guildActiveThreads(guildId), { signal });
|
|
1012
1075
|
}
|
|
1013
1076
|
/**
|
|
1014
1077
|
* Fetches a guild member ban
|
|
@@ -1019,7 +1082,7 @@ var GuildsAPI = class {
|
|
|
1019
1082
|
* @param options - The options for fetching the ban
|
|
1020
1083
|
*/
|
|
1021
1084
|
async getMemberBan(guildId, userId, { signal } = {}) {
|
|
1022
|
-
return this.rest.get(
|
|
1085
|
+
return this.rest.get(import_v106.Routes.guildBan(guildId, userId), { signal });
|
|
1023
1086
|
}
|
|
1024
1087
|
/**
|
|
1025
1088
|
* Fetches guild member bans
|
|
@@ -1030,7 +1093,7 @@ var GuildsAPI = class {
|
|
|
1030
1093
|
* @param options - The options for fetching the bans
|
|
1031
1094
|
*/
|
|
1032
1095
|
async getMemberBans(guildId, query = {}, { signal } = {}) {
|
|
1033
|
-
return this.rest.get(
|
|
1096
|
+
return this.rest.get(import_v106.Routes.guildBans(guildId), {
|
|
1034
1097
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1035
1098
|
signal
|
|
1036
1099
|
});
|
|
@@ -1045,7 +1108,7 @@ var GuildsAPI = class {
|
|
|
1045
1108
|
* @param options - The options for banning the user
|
|
1046
1109
|
*/
|
|
1047
1110
|
async banUser(guildId, userId, body = {}, { reason, signal } = {}) {
|
|
1048
|
-
await this.rest.put(
|
|
1111
|
+
await this.rest.put(import_v106.Routes.guildBan(guildId, userId), { reason, body, signal });
|
|
1049
1112
|
}
|
|
1050
1113
|
/**
|
|
1051
1114
|
* Unbans a user from a guild
|
|
@@ -1056,7 +1119,7 @@ var GuildsAPI = class {
|
|
|
1056
1119
|
* @param options - The options for unbanning the user
|
|
1057
1120
|
*/
|
|
1058
1121
|
async unbanUser(guildId, userId, { reason, signal } = {}) {
|
|
1059
|
-
await this.rest.delete(
|
|
1122
|
+
await this.rest.delete(import_v106.Routes.guildBan(guildId, userId), { reason, signal });
|
|
1060
1123
|
}
|
|
1061
1124
|
/**
|
|
1062
1125
|
* Bulk ban users from a guild
|
|
@@ -1067,7 +1130,7 @@ var GuildsAPI = class {
|
|
|
1067
1130
|
* @param options - The options for bulk banning users
|
|
1068
1131
|
*/
|
|
1069
1132
|
async bulkBanUsers(guildId, body, { reason, signal } = {}) {
|
|
1070
|
-
return this.rest.post(
|
|
1133
|
+
return this.rest.post(import_v106.Routes.guildBulkBan(guildId), {
|
|
1071
1134
|
reason,
|
|
1072
1135
|
body,
|
|
1073
1136
|
signal
|
|
@@ -1081,7 +1144,7 @@ var GuildsAPI = class {
|
|
|
1081
1144
|
* @param options - The options for fetching the guild roles
|
|
1082
1145
|
*/
|
|
1083
1146
|
async getRoles(guildId, { signal } = {}) {
|
|
1084
|
-
return this.rest.get(
|
|
1147
|
+
return this.rest.get(import_v106.Routes.guildRoles(guildId), { signal });
|
|
1085
1148
|
}
|
|
1086
1149
|
/**
|
|
1087
1150
|
* Get a role in a guild
|
|
@@ -1092,7 +1155,7 @@ var GuildsAPI = class {
|
|
|
1092
1155
|
* @param options - The options for fetching the guild role
|
|
1093
1156
|
*/
|
|
1094
1157
|
async getRole(guildId, roleId, { signal } = {}) {
|
|
1095
|
-
return this.rest.get(
|
|
1158
|
+
return this.rest.get(import_v106.Routes.guildRole(guildId, roleId), { signal });
|
|
1096
1159
|
}
|
|
1097
1160
|
/**
|
|
1098
1161
|
* Creates a guild role
|
|
@@ -1103,7 +1166,7 @@ var GuildsAPI = class {
|
|
|
1103
1166
|
* @param options - The options for creating the guild role
|
|
1104
1167
|
*/
|
|
1105
1168
|
async createRole(guildId, body, { reason, signal } = {}) {
|
|
1106
|
-
return this.rest.post(
|
|
1169
|
+
return this.rest.post(import_v106.Routes.guildRoles(guildId), { reason, body, signal });
|
|
1107
1170
|
}
|
|
1108
1171
|
/**
|
|
1109
1172
|
* Sets role positions in a guild
|
|
@@ -1114,7 +1177,7 @@ var GuildsAPI = class {
|
|
|
1114
1177
|
* @param options - The options for setting role positions
|
|
1115
1178
|
*/
|
|
1116
1179
|
async setRolePositions(guildId, body, { reason, signal } = {}) {
|
|
1117
|
-
return this.rest.patch(
|
|
1180
|
+
return this.rest.patch(import_v106.Routes.guildRoles(guildId), {
|
|
1118
1181
|
reason,
|
|
1119
1182
|
body,
|
|
1120
1183
|
signal
|
|
@@ -1130,7 +1193,7 @@ var GuildsAPI = class {
|
|
|
1130
1193
|
* @param options - The options for editing the guild role
|
|
1131
1194
|
*/
|
|
1132
1195
|
async editRole(guildId, roleId, body, { reason, signal } = {}) {
|
|
1133
|
-
return this.rest.patch(
|
|
1196
|
+
return this.rest.patch(import_v106.Routes.guildRole(guildId, roleId), {
|
|
1134
1197
|
reason,
|
|
1135
1198
|
body,
|
|
1136
1199
|
signal
|
|
@@ -1145,7 +1208,7 @@ var GuildsAPI = class {
|
|
|
1145
1208
|
* @param options - The options for deleting the guild role
|
|
1146
1209
|
*/
|
|
1147
1210
|
async deleteRole(guildId, roleId, { reason, signal } = {}) {
|
|
1148
|
-
await this.rest.delete(
|
|
1211
|
+
await this.rest.delete(import_v106.Routes.guildRole(guildId, roleId), { reason, signal });
|
|
1149
1212
|
}
|
|
1150
1213
|
/**
|
|
1151
1214
|
* Edits the multi-factor-authentication (MFA) level of a guild
|
|
@@ -1154,9 +1217,10 @@ var GuildsAPI = class {
|
|
|
1154
1217
|
* @param guildId - The id of the guild to edit the MFA level for
|
|
1155
1218
|
* @param level - The new MFA level
|
|
1156
1219
|
* @param options - The options for editing the MFA level
|
|
1220
|
+
* @deprecated API related to guild ownership may no longer be used.
|
|
1157
1221
|
*/
|
|
1158
1222
|
async editMFALevel(guildId, level, { reason, signal } = {}) {
|
|
1159
|
-
return this.rest.post(
|
|
1223
|
+
return this.rest.post(import_v106.Routes.guildMFA(guildId), {
|
|
1160
1224
|
reason,
|
|
1161
1225
|
signal,
|
|
1162
1226
|
body: { level }
|
|
@@ -1171,7 +1235,7 @@ var GuildsAPI = class {
|
|
|
1171
1235
|
* @param options - The options for fetching the number of pruned members
|
|
1172
1236
|
*/
|
|
1173
1237
|
async getPruneCount(guildId, query = {}, { signal } = {}) {
|
|
1174
|
-
return this.rest.get(
|
|
1238
|
+
return this.rest.get(import_v106.Routes.guildPrune(guildId), {
|
|
1175
1239
|
signal,
|
|
1176
1240
|
query: (0, import_rest3.makeURLSearchParams)(query)
|
|
1177
1241
|
});
|
|
@@ -1185,7 +1249,7 @@ var GuildsAPI = class {
|
|
|
1185
1249
|
* @param options - The options for initiating the prune
|
|
1186
1250
|
*/
|
|
1187
1251
|
async beginPrune(guildId, body = {}, { reason, signal } = {}) {
|
|
1188
|
-
return this.rest.post(
|
|
1252
|
+
return this.rest.post(import_v106.Routes.guildPrune(guildId), {
|
|
1189
1253
|
body,
|
|
1190
1254
|
reason,
|
|
1191
1255
|
signal
|
|
@@ -1199,7 +1263,7 @@ var GuildsAPI = class {
|
|
|
1199
1263
|
* @param options - The options for fetching the voice regions
|
|
1200
1264
|
*/
|
|
1201
1265
|
async getVoiceRegions(guildId, { signal } = {}) {
|
|
1202
|
-
return this.rest.get(
|
|
1266
|
+
return this.rest.get(import_v106.Routes.guildVoiceRegions(guildId), { signal });
|
|
1203
1267
|
}
|
|
1204
1268
|
/**
|
|
1205
1269
|
* Fetches the invites for a guild
|
|
@@ -1209,7 +1273,7 @@ var GuildsAPI = class {
|
|
|
1209
1273
|
* @param options - The options for fetching the invites
|
|
1210
1274
|
*/
|
|
1211
1275
|
async getInvites(guildId, { signal } = {}) {
|
|
1212
|
-
return this.rest.get(
|
|
1276
|
+
return this.rest.get(import_v106.Routes.guildInvites(guildId), { signal });
|
|
1213
1277
|
}
|
|
1214
1278
|
/**
|
|
1215
1279
|
* Fetches the integrations for a guild
|
|
@@ -1219,7 +1283,7 @@ var GuildsAPI = class {
|
|
|
1219
1283
|
* @param options - The options for fetching the integrations
|
|
1220
1284
|
*/
|
|
1221
1285
|
async getIntegrations(guildId, { signal } = {}) {
|
|
1222
|
-
return this.rest.get(
|
|
1286
|
+
return this.rest.get(import_v106.Routes.guildIntegrations(guildId), { signal });
|
|
1223
1287
|
}
|
|
1224
1288
|
/**
|
|
1225
1289
|
* Deletes an integration from a guild
|
|
@@ -1230,7 +1294,7 @@ var GuildsAPI = class {
|
|
|
1230
1294
|
* @param options - The options for deleting the integration
|
|
1231
1295
|
*/
|
|
1232
1296
|
async deleteIntegration(guildId, integrationId, { reason, signal } = {}) {
|
|
1233
|
-
await this.rest.delete(
|
|
1297
|
+
await this.rest.delete(import_v106.Routes.guildIntegration(guildId, integrationId), { reason, signal });
|
|
1234
1298
|
}
|
|
1235
1299
|
/**
|
|
1236
1300
|
* Fetches the widget settings for a guild
|
|
@@ -1240,7 +1304,7 @@ var GuildsAPI = class {
|
|
|
1240
1304
|
* @param options - The options for fetching the widget settings
|
|
1241
1305
|
*/
|
|
1242
1306
|
async getWidgetSettings(guildId, { signal } = {}) {
|
|
1243
|
-
return this.rest.get(
|
|
1307
|
+
return this.rest.get(import_v106.Routes.guildWidgetSettings(guildId), {
|
|
1244
1308
|
signal
|
|
1245
1309
|
});
|
|
1246
1310
|
}
|
|
@@ -1253,7 +1317,7 @@ var GuildsAPI = class {
|
|
|
1253
1317
|
* @param options - The options for editing the widget settings
|
|
1254
1318
|
*/
|
|
1255
1319
|
async editWidgetSettings(guildId, body, { reason, signal } = {}) {
|
|
1256
|
-
return this.rest.patch(
|
|
1320
|
+
return this.rest.patch(import_v106.Routes.guildWidgetSettings(guildId), {
|
|
1257
1321
|
reason,
|
|
1258
1322
|
body,
|
|
1259
1323
|
signal
|
|
@@ -1267,7 +1331,7 @@ var GuildsAPI = class {
|
|
|
1267
1331
|
* @param options - The options for fetching the widget
|
|
1268
1332
|
*/
|
|
1269
1333
|
async getWidget(guildId, { signal } = {}) {
|
|
1270
|
-
return this.rest.get(
|
|
1334
|
+
return this.rest.get(import_v106.Routes.guildWidgetJSON(guildId), { signal });
|
|
1271
1335
|
}
|
|
1272
1336
|
/**
|
|
1273
1337
|
* Fetches the vanity url for a guild
|
|
@@ -1277,7 +1341,7 @@ var GuildsAPI = class {
|
|
|
1277
1341
|
* @param options - The options for fetching the vanity url
|
|
1278
1342
|
*/
|
|
1279
1343
|
async getVanityURL(guildId, { signal } = {}) {
|
|
1280
|
-
return this.rest.get(
|
|
1344
|
+
return this.rest.get(import_v106.Routes.guildVanityUrl(guildId), { signal });
|
|
1281
1345
|
}
|
|
1282
1346
|
/**
|
|
1283
1347
|
* Fetches the widget image for a guild
|
|
@@ -1288,7 +1352,7 @@ var GuildsAPI = class {
|
|
|
1288
1352
|
* @param options - The options for fetching the widget image
|
|
1289
1353
|
*/
|
|
1290
1354
|
async getWidgetImage(guildId, style, { signal } = {}) {
|
|
1291
|
-
return this.rest.get(
|
|
1355
|
+
return this.rest.get(import_v106.Routes.guildWidgetImage(guildId), {
|
|
1292
1356
|
query: (0, import_rest3.makeURLSearchParams)({ style }),
|
|
1293
1357
|
signal
|
|
1294
1358
|
});
|
|
@@ -1301,7 +1365,7 @@ var GuildsAPI = class {
|
|
|
1301
1365
|
* @param options - The options for fetching the welcome screen
|
|
1302
1366
|
*/
|
|
1303
1367
|
async getWelcomeScreen(guildId, { signal } = {}) {
|
|
1304
|
-
return this.rest.get(
|
|
1368
|
+
return this.rest.get(import_v106.Routes.guildWelcomeScreen(guildId), { signal });
|
|
1305
1369
|
}
|
|
1306
1370
|
/**
|
|
1307
1371
|
* Edits the welcome screen for a guild
|
|
@@ -1312,7 +1376,7 @@ var GuildsAPI = class {
|
|
|
1312
1376
|
* @param options - The options for editing the welcome screen
|
|
1313
1377
|
*/
|
|
1314
1378
|
async editWelcomeScreen(guildId, body, { reason, signal } = {}) {
|
|
1315
|
-
return this.rest.patch(
|
|
1379
|
+
return this.rest.patch(import_v106.Routes.guildWelcomeScreen(guildId), {
|
|
1316
1380
|
reason,
|
|
1317
1381
|
body,
|
|
1318
1382
|
signal
|
|
@@ -1339,7 +1403,7 @@ var GuildsAPI = class {
|
|
|
1339
1403
|
* @param options - The options for fetching the emojis
|
|
1340
1404
|
*/
|
|
1341
1405
|
async getEmojis(guildId, { signal } = {}) {
|
|
1342
|
-
return this.rest.get(
|
|
1406
|
+
return this.rest.get(import_v106.Routes.guildEmojis(guildId), { signal });
|
|
1343
1407
|
}
|
|
1344
1408
|
/**
|
|
1345
1409
|
* Fetches an emoji for a guild
|
|
@@ -1350,7 +1414,7 @@ var GuildsAPI = class {
|
|
|
1350
1414
|
* @param options - The options for fetching the emoji
|
|
1351
1415
|
*/
|
|
1352
1416
|
async getEmoji(guildId, emojiId, { signal } = {}) {
|
|
1353
|
-
return this.rest.get(
|
|
1417
|
+
return this.rest.get(import_v106.Routes.guildEmoji(guildId, emojiId), { signal });
|
|
1354
1418
|
}
|
|
1355
1419
|
/**
|
|
1356
1420
|
* Creates a new emoji for a guild
|
|
@@ -1361,7 +1425,7 @@ var GuildsAPI = class {
|
|
|
1361
1425
|
* @param options - The options for creating the emoji
|
|
1362
1426
|
*/
|
|
1363
1427
|
async createEmoji(guildId, body, { reason, signal } = {}) {
|
|
1364
|
-
return this.rest.post(
|
|
1428
|
+
return this.rest.post(import_v106.Routes.guildEmojis(guildId), {
|
|
1365
1429
|
reason,
|
|
1366
1430
|
body,
|
|
1367
1431
|
signal
|
|
@@ -1377,7 +1441,7 @@ var GuildsAPI = class {
|
|
|
1377
1441
|
* @param options - The options for editing the emoji
|
|
1378
1442
|
*/
|
|
1379
1443
|
async editEmoji(guildId, emojiId, body, { reason, signal } = {}) {
|
|
1380
|
-
return this.rest.patch(
|
|
1444
|
+
return this.rest.patch(import_v106.Routes.guildEmoji(guildId, emojiId), {
|
|
1381
1445
|
reason,
|
|
1382
1446
|
body,
|
|
1383
1447
|
signal
|
|
@@ -1392,7 +1456,7 @@ var GuildsAPI = class {
|
|
|
1392
1456
|
* @param options - The options for deleting the emoji
|
|
1393
1457
|
*/
|
|
1394
1458
|
async deleteEmoji(guildId, emojiId, { reason, signal } = {}) {
|
|
1395
|
-
await this.rest.delete(
|
|
1459
|
+
await this.rest.delete(import_v106.Routes.guildEmoji(guildId, emojiId), { reason, signal });
|
|
1396
1460
|
}
|
|
1397
1461
|
/**
|
|
1398
1462
|
* Fetches all scheduled events for a guild
|
|
@@ -1403,7 +1467,7 @@ var GuildsAPI = class {
|
|
|
1403
1467
|
* @param options - The options for fetching the scheduled events
|
|
1404
1468
|
*/
|
|
1405
1469
|
async getScheduledEvents(guildId, query = {}, { signal } = {}) {
|
|
1406
|
-
return this.rest.get(
|
|
1470
|
+
return this.rest.get(import_v106.Routes.guildScheduledEvents(guildId), {
|
|
1407
1471
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1408
1472
|
signal
|
|
1409
1473
|
});
|
|
@@ -1417,7 +1481,7 @@ var GuildsAPI = class {
|
|
|
1417
1481
|
* @param options - The options for creating the scheduled event
|
|
1418
1482
|
*/
|
|
1419
1483
|
async createScheduledEvent(guildId, body, { reason, signal } = {}) {
|
|
1420
|
-
return this.rest.post(
|
|
1484
|
+
return this.rest.post(import_v106.Routes.guildScheduledEvents(guildId), {
|
|
1421
1485
|
reason,
|
|
1422
1486
|
body,
|
|
1423
1487
|
signal
|
|
@@ -1433,7 +1497,7 @@ var GuildsAPI = class {
|
|
|
1433
1497
|
* @param options - The options for fetching the scheduled event
|
|
1434
1498
|
*/
|
|
1435
1499
|
async getScheduledEvent(guildId, eventId, query = {}, { signal } = {}) {
|
|
1436
|
-
return this.rest.get(
|
|
1500
|
+
return this.rest.get(import_v106.Routes.guildScheduledEvent(guildId, eventId), {
|
|
1437
1501
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1438
1502
|
signal
|
|
1439
1503
|
});
|
|
@@ -1448,7 +1512,7 @@ var GuildsAPI = class {
|
|
|
1448
1512
|
* @param options - The options for editing the scheduled event
|
|
1449
1513
|
*/
|
|
1450
1514
|
async editScheduledEvent(guildId, eventId, body, { reason, signal } = {}) {
|
|
1451
|
-
return this.rest.patch(
|
|
1515
|
+
return this.rest.patch(import_v106.Routes.guildScheduledEvent(guildId, eventId), {
|
|
1452
1516
|
reason,
|
|
1453
1517
|
body,
|
|
1454
1518
|
signal
|
|
@@ -1463,7 +1527,7 @@ var GuildsAPI = class {
|
|
|
1463
1527
|
* @param options - The options for deleting the scheduled event
|
|
1464
1528
|
*/
|
|
1465
1529
|
async deleteScheduledEvent(guildId, eventId, { reason, signal } = {}) {
|
|
1466
|
-
await this.rest.delete(
|
|
1530
|
+
await this.rest.delete(import_v106.Routes.guildScheduledEvent(guildId, eventId), { reason, signal });
|
|
1467
1531
|
}
|
|
1468
1532
|
/**
|
|
1469
1533
|
* Gets all users that are interested in a scheduled event
|
|
@@ -1475,7 +1539,7 @@ var GuildsAPI = class {
|
|
|
1475
1539
|
* @param options - The options for fetching the scheduled event users
|
|
1476
1540
|
*/
|
|
1477
1541
|
async getScheduledEventUsers(guildId, eventId, query = {}, { signal } = {}) {
|
|
1478
|
-
return this.rest.get(
|
|
1542
|
+
return this.rest.get(import_v106.Routes.guildScheduledEventUsers(guildId, eventId), {
|
|
1479
1543
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1480
1544
|
signal
|
|
1481
1545
|
});
|
|
@@ -1488,7 +1552,7 @@ var GuildsAPI = class {
|
|
|
1488
1552
|
* @param options - The options for fetching the templates
|
|
1489
1553
|
*/
|
|
1490
1554
|
async getTemplates(guildId, { signal } = {}) {
|
|
1491
|
-
return this.rest.get(
|
|
1555
|
+
return this.rest.get(import_v106.Routes.guildTemplates(guildId), { signal });
|
|
1492
1556
|
}
|
|
1493
1557
|
/**
|
|
1494
1558
|
* Syncs a template for a guild
|
|
@@ -1499,7 +1563,7 @@ var GuildsAPI = class {
|
|
|
1499
1563
|
* @param options - The options for syncing the template
|
|
1500
1564
|
*/
|
|
1501
1565
|
async syncTemplate(guildId, templateCode, { signal } = {}) {
|
|
1502
|
-
return this.rest.put(
|
|
1566
|
+
return this.rest.put(import_v106.Routes.guildTemplate(guildId, templateCode), {
|
|
1503
1567
|
signal
|
|
1504
1568
|
});
|
|
1505
1569
|
}
|
|
@@ -1513,7 +1577,7 @@ var GuildsAPI = class {
|
|
|
1513
1577
|
* @param options - The options for editing the template
|
|
1514
1578
|
*/
|
|
1515
1579
|
async editTemplate(guildId, templateCode, body, { signal } = {}) {
|
|
1516
|
-
return this.rest.patch(
|
|
1580
|
+
return this.rest.patch(import_v106.Routes.guildTemplate(guildId, templateCode), {
|
|
1517
1581
|
body,
|
|
1518
1582
|
signal
|
|
1519
1583
|
});
|
|
@@ -1527,7 +1591,7 @@ var GuildsAPI = class {
|
|
|
1527
1591
|
* @param options - The options for deleting the template
|
|
1528
1592
|
*/
|
|
1529
1593
|
async deleteTemplate(guildId, templateCode, { signal } = {}) {
|
|
1530
|
-
await this.rest.delete(
|
|
1594
|
+
await this.rest.delete(import_v106.Routes.guildTemplate(guildId, templateCode), { signal });
|
|
1531
1595
|
}
|
|
1532
1596
|
/**
|
|
1533
1597
|
* Fetches all the stickers for a guild
|
|
@@ -1537,7 +1601,7 @@ var GuildsAPI = class {
|
|
|
1537
1601
|
* @param options - The options for fetching the stickers
|
|
1538
1602
|
*/
|
|
1539
1603
|
async getStickers(guildId, { signal } = {}) {
|
|
1540
|
-
return this.rest.get(
|
|
1604
|
+
return this.rest.get(import_v106.Routes.guildStickers(guildId), { signal });
|
|
1541
1605
|
}
|
|
1542
1606
|
/**
|
|
1543
1607
|
* Fetches a sticker for a guild
|
|
@@ -1548,7 +1612,7 @@ var GuildsAPI = class {
|
|
|
1548
1612
|
* @param options - The options for fetching the sticker
|
|
1549
1613
|
*/
|
|
1550
1614
|
async getSticker(guildId, stickerId, { signal } = {}) {
|
|
1551
|
-
return this.rest.get(
|
|
1615
|
+
return this.rest.get(import_v106.Routes.guildSticker(guildId, stickerId), { signal });
|
|
1552
1616
|
}
|
|
1553
1617
|
/**
|
|
1554
1618
|
* Creates a sticker for a guild
|
|
@@ -1560,7 +1624,7 @@ var GuildsAPI = class {
|
|
|
1560
1624
|
*/
|
|
1561
1625
|
async createSticker(guildId, { file, ...body }, { reason, signal } = {}) {
|
|
1562
1626
|
const fileData = { ...file, key: "file" };
|
|
1563
|
-
return this.rest.post(
|
|
1627
|
+
return this.rest.post(import_v106.Routes.guildStickers(guildId), {
|
|
1564
1628
|
appendToFormData: true,
|
|
1565
1629
|
body,
|
|
1566
1630
|
files: [fileData],
|
|
@@ -1578,7 +1642,7 @@ var GuildsAPI = class {
|
|
|
1578
1642
|
* @param options - The options for editing the sticker
|
|
1579
1643
|
*/
|
|
1580
1644
|
async editSticker(guildId, stickerId, body, { reason, signal } = {}) {
|
|
1581
|
-
return this.rest.patch(
|
|
1645
|
+
return this.rest.patch(import_v106.Routes.guildSticker(guildId, stickerId), {
|
|
1582
1646
|
reason,
|
|
1583
1647
|
body,
|
|
1584
1648
|
signal
|
|
@@ -1593,7 +1657,7 @@ var GuildsAPI = class {
|
|
|
1593
1657
|
* @param options - The options for deleting the sticker
|
|
1594
1658
|
*/
|
|
1595
1659
|
async deleteSticker(guildId, stickerId, { reason, signal } = {}) {
|
|
1596
|
-
await this.rest.delete(
|
|
1660
|
+
await this.rest.delete(import_v106.Routes.guildSticker(guildId, stickerId), { reason, signal });
|
|
1597
1661
|
}
|
|
1598
1662
|
/**
|
|
1599
1663
|
* Fetches the audit logs for a guild
|
|
@@ -1604,7 +1668,7 @@ var GuildsAPI = class {
|
|
|
1604
1668
|
* @param options - The options for fetching the audit logs
|
|
1605
1669
|
*/
|
|
1606
1670
|
async getAuditLogs(guildId, query = {}, { signal } = {}) {
|
|
1607
|
-
return this.rest.get(
|
|
1671
|
+
return this.rest.get(import_v106.Routes.guildAuditLog(guildId), {
|
|
1608
1672
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1609
1673
|
signal
|
|
1610
1674
|
});
|
|
@@ -1617,7 +1681,7 @@ var GuildsAPI = class {
|
|
|
1617
1681
|
* @param options - The options for fetching the auto moderation rules
|
|
1618
1682
|
*/
|
|
1619
1683
|
async getAutoModerationRules(guildId, { signal } = {}) {
|
|
1620
|
-
return this.rest.get(
|
|
1684
|
+
return this.rest.get(import_v106.Routes.guildAutoModerationRules(guildId), {
|
|
1621
1685
|
signal
|
|
1622
1686
|
});
|
|
1623
1687
|
}
|
|
@@ -1630,7 +1694,7 @@ var GuildsAPI = class {
|
|
|
1630
1694
|
* @param options - The options for fetching the auto moderation rule
|
|
1631
1695
|
*/
|
|
1632
1696
|
async getAutoModerationRule(guildId, ruleId, { signal } = {}) {
|
|
1633
|
-
return this.rest.get(
|
|
1697
|
+
return this.rest.get(import_v106.Routes.guildAutoModerationRule(guildId, ruleId), {
|
|
1634
1698
|
signal
|
|
1635
1699
|
});
|
|
1636
1700
|
}
|
|
@@ -1643,7 +1707,7 @@ var GuildsAPI = class {
|
|
|
1643
1707
|
* @param options - The options for creating the auto moderation rule
|
|
1644
1708
|
*/
|
|
1645
1709
|
async createAutoModerationRule(guildId, body, { reason, signal } = {}) {
|
|
1646
|
-
return this.rest.post(
|
|
1710
|
+
return this.rest.post(import_v106.Routes.guildAutoModerationRules(guildId), {
|
|
1647
1711
|
reason,
|
|
1648
1712
|
body,
|
|
1649
1713
|
signal
|
|
@@ -1659,7 +1723,7 @@ var GuildsAPI = class {
|
|
|
1659
1723
|
* @param options - The options for editing the auto moderation rule
|
|
1660
1724
|
*/
|
|
1661
1725
|
async editAutoModerationRule(guildId, ruleId, body, { reason, signal } = {}) {
|
|
1662
|
-
return this.rest.patch(
|
|
1726
|
+
return this.rest.patch(import_v106.Routes.guildAutoModerationRule(guildId, ruleId), {
|
|
1663
1727
|
reason,
|
|
1664
1728
|
body,
|
|
1665
1729
|
signal
|
|
@@ -1674,7 +1738,7 @@ var GuildsAPI = class {
|
|
|
1674
1738
|
* @param options - The options for deleting the auto moderation rule
|
|
1675
1739
|
*/
|
|
1676
1740
|
async deleteAutoModerationRule(guildId, ruleId, { reason, signal } = {}) {
|
|
1677
|
-
await this.rest.delete(
|
|
1741
|
+
await this.rest.delete(import_v106.Routes.guildAutoModerationRule(guildId, ruleId), { reason, signal });
|
|
1678
1742
|
}
|
|
1679
1743
|
/**
|
|
1680
1744
|
* Fetches a guild member
|
|
@@ -1685,7 +1749,7 @@ var GuildsAPI = class {
|
|
|
1685
1749
|
* @param options - The options for fetching the guild member
|
|
1686
1750
|
*/
|
|
1687
1751
|
async getMember(guildId, userId, { signal } = {}) {
|
|
1688
|
-
return this.rest.get(
|
|
1752
|
+
return this.rest.get(import_v106.Routes.guildMember(guildId, userId), { signal });
|
|
1689
1753
|
}
|
|
1690
1754
|
/**
|
|
1691
1755
|
* Searches for guild members
|
|
@@ -1696,7 +1760,7 @@ var GuildsAPI = class {
|
|
|
1696
1760
|
* @param options - The options for searching for guild members
|
|
1697
1761
|
*/
|
|
1698
1762
|
async searchForMembers(guildId, query, { signal } = {}) {
|
|
1699
|
-
return this.rest.get(
|
|
1763
|
+
return this.rest.get(import_v106.Routes.guildMembersSearch(guildId), {
|
|
1700
1764
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1701
1765
|
signal
|
|
1702
1766
|
});
|
|
@@ -1711,7 +1775,7 @@ var GuildsAPI = class {
|
|
|
1711
1775
|
* @param options - The options for editing the guild member
|
|
1712
1776
|
*/
|
|
1713
1777
|
async editMember(guildId, userId, body = {}, { reason, signal } = {}) {
|
|
1714
|
-
return this.rest.patch(
|
|
1778
|
+
return this.rest.patch(import_v106.Routes.guildMember(guildId, userId), {
|
|
1715
1779
|
reason,
|
|
1716
1780
|
body,
|
|
1717
1781
|
signal
|
|
@@ -1726,7 +1790,7 @@ var GuildsAPI = class {
|
|
|
1726
1790
|
* @param options - The options for removing the guild member
|
|
1727
1791
|
*/
|
|
1728
1792
|
async removeMember(guildId, userId, { reason, signal } = {}) {
|
|
1729
|
-
return this.rest.delete(
|
|
1793
|
+
return this.rest.delete(import_v106.Routes.guildMember(guildId, userId), { reason, signal });
|
|
1730
1794
|
}
|
|
1731
1795
|
/**
|
|
1732
1796
|
* Adds a role to a guild member
|
|
@@ -1738,7 +1802,7 @@ var GuildsAPI = class {
|
|
|
1738
1802
|
* @param options - The options for adding a role to a guild member
|
|
1739
1803
|
*/
|
|
1740
1804
|
async addRoleToMember(guildId, userId, roleId, { reason, signal } = {}) {
|
|
1741
|
-
await this.rest.put(
|
|
1805
|
+
await this.rest.put(import_v106.Routes.guildMemberRole(guildId, userId, roleId), { reason, signal });
|
|
1742
1806
|
}
|
|
1743
1807
|
/**
|
|
1744
1808
|
* Removes a role from a guild member
|
|
@@ -1750,7 +1814,7 @@ var GuildsAPI = class {
|
|
|
1750
1814
|
* @param options - The options for removing a role from a guild member
|
|
1751
1815
|
*/
|
|
1752
1816
|
async removeRoleFromMember(guildId, userId, roleId, { reason, signal } = {}) {
|
|
1753
|
-
await this.rest.delete(
|
|
1817
|
+
await this.rest.delete(import_v106.Routes.guildMemberRole(guildId, userId, roleId), { reason, signal });
|
|
1754
1818
|
}
|
|
1755
1819
|
/**
|
|
1756
1820
|
* Fetches a guild template
|
|
@@ -1760,18 +1824,18 @@ var GuildsAPI = class {
|
|
|
1760
1824
|
* @param options - The options for fetching the guild template
|
|
1761
1825
|
*/
|
|
1762
1826
|
async getTemplate(templateCode, { signal } = {}) {
|
|
1763
|
-
return this.rest.get(
|
|
1827
|
+
return this.rest.get(import_v106.Routes.template(templateCode), { signal });
|
|
1764
1828
|
}
|
|
1765
1829
|
/**
|
|
1766
1830
|
* Creates a new template
|
|
1767
1831
|
*
|
|
1768
1832
|
* @see {@link https://discord.com/developers/docs/resources/guild-template#create-guild-template}
|
|
1769
|
-
* @param
|
|
1833
|
+
* @param guildId - The id of the guild
|
|
1770
1834
|
* @param body - The data for creating the template
|
|
1771
1835
|
* @param options - The options for creating the template
|
|
1772
1836
|
*/
|
|
1773
|
-
async createTemplate(
|
|
1774
|
-
return this.rest.post(
|
|
1837
|
+
async createTemplate(guildId, body, { signal } = {}) {
|
|
1838
|
+
return this.rest.post(import_v106.Routes.guildTemplates(guildId), { body, signal });
|
|
1775
1839
|
}
|
|
1776
1840
|
/**
|
|
1777
1841
|
* Fetches webhooks for a guild
|
|
@@ -1780,7 +1844,7 @@ var GuildsAPI = class {
|
|
|
1780
1844
|
* @param id - The id of the guild
|
|
1781
1845
|
*/
|
|
1782
1846
|
async getWebhooks(id) {
|
|
1783
|
-
return this.rest.get(
|
|
1847
|
+
return this.rest.get(import_v106.Routes.guildWebhooks(id));
|
|
1784
1848
|
}
|
|
1785
1849
|
/**
|
|
1786
1850
|
* Sets the voice state for the current user
|
|
@@ -1802,7 +1866,7 @@ var GuildsAPI = class {
|
|
|
1802
1866
|
* @param options - The options for fetching the guild onboarding
|
|
1803
1867
|
*/
|
|
1804
1868
|
async getOnboarding(guildId, { signal } = {}) {
|
|
1805
|
-
return this.rest.get(
|
|
1869
|
+
return this.rest.get(import_v106.Routes.guildOnboarding(guildId), { signal });
|
|
1806
1870
|
}
|
|
1807
1871
|
/**
|
|
1808
1872
|
* Edits a guild onboarding
|
|
@@ -1813,16 +1877,30 @@ var GuildsAPI = class {
|
|
|
1813
1877
|
* @param options - The options for editing the guild onboarding
|
|
1814
1878
|
*/
|
|
1815
1879
|
async editOnboarding(guildId, body, { reason, signal } = {}) {
|
|
1816
|
-
return this.rest.put(
|
|
1880
|
+
return this.rest.put(import_v106.Routes.guildOnboarding(guildId), {
|
|
1817
1881
|
reason,
|
|
1818
1882
|
body,
|
|
1819
1883
|
signal
|
|
1820
1884
|
});
|
|
1821
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
|
+
}
|
|
1822
1900
|
};
|
|
1823
1901
|
|
|
1824
1902
|
// src/api/interactions.ts
|
|
1825
|
-
var
|
|
1903
|
+
var import_v107 = require("discord-api-types/v10");
|
|
1826
1904
|
var InteractionsAPI = class {
|
|
1827
1905
|
constructor(rest, webhooks) {
|
|
1828
1906
|
this.rest = rest;
|
|
@@ -1841,11 +1919,11 @@ var InteractionsAPI = class {
|
|
|
1841
1919
|
* @param options - The options for replying
|
|
1842
1920
|
*/
|
|
1843
1921
|
async reply(interactionId, interactionToken, { files, ...data }, { signal } = {}) {
|
|
1844
|
-
await this.rest.post(
|
|
1922
|
+
await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1845
1923
|
files,
|
|
1846
1924
|
auth: false,
|
|
1847
1925
|
body: {
|
|
1848
|
-
type:
|
|
1926
|
+
type: import_v107.InteractionResponseType.ChannelMessageWithSource,
|
|
1849
1927
|
data
|
|
1850
1928
|
},
|
|
1851
1929
|
signal
|
|
@@ -1861,10 +1939,10 @@ var InteractionsAPI = class {
|
|
|
1861
1939
|
* @param options - The options for deferring
|
|
1862
1940
|
*/
|
|
1863
1941
|
async defer(interactionId, interactionToken, data, { signal } = {}) {
|
|
1864
|
-
await this.rest.post(
|
|
1942
|
+
await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1865
1943
|
auth: false,
|
|
1866
1944
|
body: {
|
|
1867
|
-
type:
|
|
1945
|
+
type: import_v107.InteractionResponseType.DeferredChannelMessageWithSource,
|
|
1868
1946
|
data
|
|
1869
1947
|
},
|
|
1870
1948
|
signal
|
|
@@ -1879,10 +1957,10 @@ var InteractionsAPI = class {
|
|
|
1879
1957
|
* @param options - The options for deferring
|
|
1880
1958
|
*/
|
|
1881
1959
|
async deferMessageUpdate(interactionId, interactionToken, { signal } = {}) {
|
|
1882
|
-
await this.rest.post(
|
|
1960
|
+
await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1883
1961
|
auth: false,
|
|
1884
1962
|
body: {
|
|
1885
|
-
type:
|
|
1963
|
+
type: import_v107.InteractionResponseType.DeferredMessageUpdate
|
|
1886
1964
|
},
|
|
1887
1965
|
signal
|
|
1888
1966
|
});
|
|
@@ -1955,11 +2033,11 @@ var InteractionsAPI = class {
|
|
|
1955
2033
|
* @param options - The options for updating the interaction
|
|
1956
2034
|
*/
|
|
1957
2035
|
async updateMessage(interactionId, interactionToken, { files, ...data }, { signal } = {}) {
|
|
1958
|
-
await this.rest.post(
|
|
2036
|
+
await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1959
2037
|
files,
|
|
1960
2038
|
auth: false,
|
|
1961
2039
|
body: {
|
|
1962
|
-
type:
|
|
2040
|
+
type: import_v107.InteractionResponseType.UpdateMessage,
|
|
1963
2041
|
data
|
|
1964
2042
|
},
|
|
1965
2043
|
signal
|
|
@@ -1975,10 +2053,10 @@ var InteractionsAPI = class {
|
|
|
1975
2053
|
* @param options - The options for sending the autocomplete response
|
|
1976
2054
|
*/
|
|
1977
2055
|
async createAutocompleteResponse(interactionId, interactionToken, callbackData, { signal } = {}) {
|
|
1978
|
-
await this.rest.post(
|
|
2056
|
+
await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1979
2057
|
auth: false,
|
|
1980
2058
|
body: {
|
|
1981
|
-
type:
|
|
2059
|
+
type: import_v107.InteractionResponseType.ApplicationCommandAutocompleteResult,
|
|
1982
2060
|
data: callbackData
|
|
1983
2061
|
},
|
|
1984
2062
|
signal
|
|
@@ -1994,10 +2072,10 @@ var InteractionsAPI = class {
|
|
|
1994
2072
|
* @param options - The options for sending the modal
|
|
1995
2073
|
*/
|
|
1996
2074
|
async createModal(interactionId, interactionToken, callbackData, { signal } = {}) {
|
|
1997
|
-
await this.rest.post(
|
|
2075
|
+
await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1998
2076
|
auth: false,
|
|
1999
2077
|
body: {
|
|
2000
|
-
type:
|
|
2078
|
+
type: import_v107.InteractionResponseType.Modal,
|
|
2001
2079
|
data: callbackData
|
|
2002
2080
|
},
|
|
2003
2081
|
signal
|
|
@@ -2013,10 +2091,10 @@ var InteractionsAPI = class {
|
|
|
2013
2091
|
* @deprecated Sending a premium-style button is the new Discord behavior.
|
|
2014
2092
|
*/
|
|
2015
2093
|
async sendPremiumRequired(interactionId, interactionToken, { signal } = {}) {
|
|
2016
|
-
await this.rest.post(
|
|
2094
|
+
await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
|
|
2017
2095
|
auth: false,
|
|
2018
2096
|
body: {
|
|
2019
|
-
type:
|
|
2097
|
+
type: import_v107.InteractionResponseType.PremiumRequired
|
|
2020
2098
|
},
|
|
2021
2099
|
signal
|
|
2022
2100
|
});
|
|
@@ -2025,7 +2103,7 @@ var InteractionsAPI = class {
|
|
|
2025
2103
|
|
|
2026
2104
|
// src/api/invite.ts
|
|
2027
2105
|
var import_rest4 = require("@discordjs/rest");
|
|
2028
|
-
var
|
|
2106
|
+
var import_v108 = require("discord-api-types/v10");
|
|
2029
2107
|
var InvitesAPI = class {
|
|
2030
2108
|
constructor(rest) {
|
|
2031
2109
|
this.rest = rest;
|
|
@@ -2042,7 +2120,7 @@ var InvitesAPI = class {
|
|
|
2042
2120
|
* @param options - The options for fetching the invite
|
|
2043
2121
|
*/
|
|
2044
2122
|
async get(code, query = {}, { signal } = {}) {
|
|
2045
|
-
return this.rest.get(
|
|
2123
|
+
return this.rest.get(import_v108.Routes.invite(code), {
|
|
2046
2124
|
query: (0, import_rest4.makeURLSearchParams)(query),
|
|
2047
2125
|
signal
|
|
2048
2126
|
});
|
|
@@ -2055,13 +2133,13 @@ var InvitesAPI = class {
|
|
|
2055
2133
|
* @param options - The options for deleting the invite
|
|
2056
2134
|
*/
|
|
2057
2135
|
async delete(code, { reason, signal } = {}) {
|
|
2058
|
-
await this.rest.delete(
|
|
2136
|
+
await this.rest.delete(import_v108.Routes.invite(code), { reason, signal });
|
|
2059
2137
|
}
|
|
2060
2138
|
};
|
|
2061
2139
|
|
|
2062
2140
|
// src/api/monetization.ts
|
|
2063
2141
|
var import_rest5 = require("@discordjs/rest");
|
|
2064
|
-
var
|
|
2142
|
+
var import_v109 = require("discord-api-types/v10");
|
|
2065
2143
|
var MonetizationAPI = class {
|
|
2066
2144
|
constructor(rest) {
|
|
2067
2145
|
this.rest = rest;
|
|
@@ -2076,7 +2154,7 @@ var MonetizationAPI = class {
|
|
|
2076
2154
|
* @param options - The options for fetching the SKUs.
|
|
2077
2155
|
*/
|
|
2078
2156
|
async getSKUs(applicationId, { signal } = {}) {
|
|
2079
|
-
return this.rest.get(
|
|
2157
|
+
return this.rest.get(import_v109.Routes.skus(applicationId), { signal });
|
|
2080
2158
|
}
|
|
2081
2159
|
/**
|
|
2082
2160
|
* Fetches the entitlements for an application.
|
|
@@ -2087,7 +2165,7 @@ var MonetizationAPI = class {
|
|
|
2087
2165
|
* @param options - The options for fetching entitlements
|
|
2088
2166
|
*/
|
|
2089
2167
|
async getEntitlements(applicationId, query, { signal } = {}) {
|
|
2090
|
-
return this.rest.get(
|
|
2168
|
+
return this.rest.get(import_v109.Routes.entitlements(applicationId), {
|
|
2091
2169
|
signal,
|
|
2092
2170
|
query: (0, import_rest5.makeURLSearchParams)(query)
|
|
2093
2171
|
});
|
|
@@ -2101,7 +2179,7 @@ var MonetizationAPI = class {
|
|
|
2101
2179
|
* @param options - The options for creating the entitlement
|
|
2102
2180
|
*/
|
|
2103
2181
|
async createTestEntitlement(applicationId, body, { signal } = {}) {
|
|
2104
|
-
return this.rest.post(
|
|
2182
|
+
return this.rest.post(import_v109.Routes.entitlements(applicationId), {
|
|
2105
2183
|
body,
|
|
2106
2184
|
signal
|
|
2107
2185
|
});
|
|
@@ -2115,7 +2193,7 @@ var MonetizationAPI = class {
|
|
|
2115
2193
|
* @param options - The options for deleting the entitlement
|
|
2116
2194
|
*/
|
|
2117
2195
|
async deleteTestEntitlement(applicationId, entitlementId, { signal } = {}) {
|
|
2118
|
-
await this.rest.delete(
|
|
2196
|
+
await this.rest.delete(import_v109.Routes.entitlement(applicationId, entitlementId), { signal });
|
|
2119
2197
|
}
|
|
2120
2198
|
/**
|
|
2121
2199
|
* Marks a given entitlement for the user as consumed. Only available for One-Time Purchase consumable SKUs.
|
|
@@ -2126,13 +2204,13 @@ var MonetizationAPI = class {
|
|
|
2126
2204
|
* @param options - The options for consuming the entitlement
|
|
2127
2205
|
*/
|
|
2128
2206
|
async consumeEntitlement(applicationId, entitlementId, { signal } = {}) {
|
|
2129
|
-
await this.rest.post(
|
|
2207
|
+
await this.rest.post(import_v109.Routes.consumeEntitlement(applicationId, entitlementId), { signal });
|
|
2130
2208
|
}
|
|
2131
2209
|
};
|
|
2132
2210
|
|
|
2133
2211
|
// src/api/oauth2.ts
|
|
2134
2212
|
var import_rest6 = require("@discordjs/rest");
|
|
2135
|
-
var
|
|
2213
|
+
var import_v1010 = require("discord-api-types/v10");
|
|
2136
2214
|
var OAuth2API = class {
|
|
2137
2215
|
constructor(rest) {
|
|
2138
2216
|
this.rest = rest;
|
|
@@ -2147,7 +2225,7 @@ var OAuth2API = class {
|
|
|
2147
2225
|
* @param options - The options for creating the authorization URL
|
|
2148
2226
|
*/
|
|
2149
2227
|
generateAuthorizationURL(options) {
|
|
2150
|
-
const url = new URL(`${
|
|
2228
|
+
const url = new URL(`${import_v1010.RouteBases.api}${import_v1010.Routes.oauth2Authorization()}`);
|
|
2151
2229
|
url.search = (0, import_rest6.makeURLSearchParams)(options).toString();
|
|
2152
2230
|
return url.toString();
|
|
2153
2231
|
}
|
|
@@ -2159,7 +2237,7 @@ var OAuth2API = class {
|
|
|
2159
2237
|
* @param options - The options for the token exchange request
|
|
2160
2238
|
*/
|
|
2161
2239
|
async tokenExchange(body, { signal } = {}) {
|
|
2162
|
-
return this.rest.post(
|
|
2240
|
+
return this.rest.post(import_v1010.Routes.oauth2TokenExchange(), {
|
|
2163
2241
|
body: (0, import_rest6.makeURLSearchParams)(body),
|
|
2164
2242
|
passThroughBody: true,
|
|
2165
2243
|
headers: {
|
|
@@ -2177,7 +2255,7 @@ var OAuth2API = class {
|
|
|
2177
2255
|
* @param options - The options for the refresh token request
|
|
2178
2256
|
*/
|
|
2179
2257
|
async refreshToken(body, { signal } = {}) {
|
|
2180
|
-
return this.rest.post(
|
|
2258
|
+
return this.rest.post(import_v1010.Routes.oauth2TokenExchange(), {
|
|
2181
2259
|
body: (0, import_rest6.makeURLSearchParams)(body),
|
|
2182
2260
|
passThroughBody: true,
|
|
2183
2261
|
headers: {
|
|
@@ -2197,7 +2275,7 @@ var OAuth2API = class {
|
|
|
2197
2275
|
* @param options - The options for the client credentials grant request
|
|
2198
2276
|
*/
|
|
2199
2277
|
async getToken(body, { signal } = {}) {
|
|
2200
|
-
return this.rest.post(
|
|
2278
|
+
return this.rest.post(import_v1010.Routes.oauth2TokenExchange(), {
|
|
2201
2279
|
body: (0, import_rest6.makeURLSearchParams)(body),
|
|
2202
2280
|
passThroughBody: true,
|
|
2203
2281
|
headers: {
|
|
@@ -2214,7 +2292,7 @@ var OAuth2API = class {
|
|
|
2214
2292
|
* @param options - The options for the current bot application information request
|
|
2215
2293
|
*/
|
|
2216
2294
|
async getCurrentBotApplicationInformation({ signal } = {}) {
|
|
2217
|
-
return this.rest.get(
|
|
2295
|
+
return this.rest.get(import_v1010.Routes.oauth2CurrentApplication(), {
|
|
2218
2296
|
signal
|
|
2219
2297
|
});
|
|
2220
2298
|
}
|
|
@@ -2225,7 +2303,7 @@ var OAuth2API = class {
|
|
|
2225
2303
|
* @param options - The options for the current authorization information request
|
|
2226
2304
|
*/
|
|
2227
2305
|
async getCurrentAuthorizationInformation({ signal } = {}) {
|
|
2228
|
-
return this.rest.get(
|
|
2306
|
+
return this.rest.get(import_v1010.Routes.oauth2CurrentAuthorization(), {
|
|
2229
2307
|
signal
|
|
2230
2308
|
});
|
|
2231
2309
|
}
|
|
@@ -2239,7 +2317,7 @@ var OAuth2API = class {
|
|
|
2239
2317
|
* @param options - The options for the token revocation request
|
|
2240
2318
|
*/
|
|
2241
2319
|
async revokeToken(applicationId, applicationSecret, body, { signal } = {}) {
|
|
2242
|
-
await this.rest.post(
|
|
2320
|
+
await this.rest.post(import_v1010.Routes.oauth2TokenRevocation(), {
|
|
2243
2321
|
body: (0, import_rest6.makeURLSearchParams)(body),
|
|
2244
2322
|
passThroughBody: true,
|
|
2245
2323
|
headers: {
|
|
@@ -2254,7 +2332,7 @@ var OAuth2API = class {
|
|
|
2254
2332
|
|
|
2255
2333
|
// src/api/poll.ts
|
|
2256
2334
|
var import_rest7 = require("@discordjs/rest");
|
|
2257
|
-
var
|
|
2335
|
+
var import_v1011 = require("discord-api-types/v10");
|
|
2258
2336
|
var PollAPI = class {
|
|
2259
2337
|
constructor(rest) {
|
|
2260
2338
|
this.rest = rest;
|
|
@@ -2273,7 +2351,7 @@ var PollAPI = class {
|
|
|
2273
2351
|
* @param options - The options for getting the list of voters
|
|
2274
2352
|
*/
|
|
2275
2353
|
async getAnswerVoters(channelId, messageId, answerId, query, { signal } = {}) {
|
|
2276
|
-
return this.rest.get(
|
|
2354
|
+
return this.rest.get(import_v1011.Routes.pollAnswerVoters(channelId, messageId, answerId), {
|
|
2277
2355
|
signal,
|
|
2278
2356
|
query: (0, import_rest7.makeURLSearchParams)(query)
|
|
2279
2357
|
});
|
|
@@ -2287,14 +2365,14 @@ var PollAPI = class {
|
|
|
2287
2365
|
* @param options - The options for expiring the poll
|
|
2288
2366
|
*/
|
|
2289
2367
|
async expirePoll(channelId, messageId, { signal } = {}) {
|
|
2290
|
-
return this.rest.post(
|
|
2368
|
+
return this.rest.post(import_v1011.Routes.expirePoll(channelId, messageId), {
|
|
2291
2369
|
signal
|
|
2292
2370
|
});
|
|
2293
2371
|
}
|
|
2294
2372
|
};
|
|
2295
2373
|
|
|
2296
2374
|
// src/api/roleConnections.ts
|
|
2297
|
-
var
|
|
2375
|
+
var import_v1012 = require("discord-api-types/v10");
|
|
2298
2376
|
var RoleConnectionsAPI = class {
|
|
2299
2377
|
constructor(rest) {
|
|
2300
2378
|
this.rest = rest;
|
|
@@ -2310,7 +2388,7 @@ var RoleConnectionsAPI = class {
|
|
|
2310
2388
|
* @param options - The options for fetching the role connection metadata records
|
|
2311
2389
|
*/
|
|
2312
2390
|
async getMetadataRecords(applicationId, { signal } = {}) {
|
|
2313
|
-
return this.rest.get(
|
|
2391
|
+
return this.rest.get(import_v1012.Routes.applicationRoleConnectionMetadata(applicationId), {
|
|
2314
2392
|
signal
|
|
2315
2393
|
});
|
|
2316
2394
|
}
|
|
@@ -2323,7 +2401,7 @@ var RoleConnectionsAPI = class {
|
|
|
2323
2401
|
* @param options - The options for updating the role connection metadata records
|
|
2324
2402
|
*/
|
|
2325
2403
|
async updateMetadataRecords(applicationId, body, { signal } = {}) {
|
|
2326
|
-
return this.rest.put(
|
|
2404
|
+
return this.rest.put(import_v1012.Routes.applicationRoleConnectionMetadata(applicationId), {
|
|
2327
2405
|
body,
|
|
2328
2406
|
signal
|
|
2329
2407
|
});
|
|
@@ -2331,7 +2409,7 @@ var RoleConnectionsAPI = class {
|
|
|
2331
2409
|
};
|
|
2332
2410
|
|
|
2333
2411
|
// src/api/stageInstances.ts
|
|
2334
|
-
var
|
|
2412
|
+
var import_v1013 = require("discord-api-types/v10");
|
|
2335
2413
|
var StageInstancesAPI = class {
|
|
2336
2414
|
constructor(rest) {
|
|
2337
2415
|
this.rest = rest;
|
|
@@ -2347,7 +2425,7 @@ var StageInstancesAPI = class {
|
|
|
2347
2425
|
* @param options - The options for creating the new stage instance
|
|
2348
2426
|
*/
|
|
2349
2427
|
async create(body, { reason, signal } = {}) {
|
|
2350
|
-
return this.rest.post(
|
|
2428
|
+
return this.rest.post(import_v1013.Routes.stageInstances(), {
|
|
2351
2429
|
body,
|
|
2352
2430
|
reason,
|
|
2353
2431
|
signal
|
|
@@ -2361,7 +2439,7 @@ var StageInstancesAPI = class {
|
|
|
2361
2439
|
* @param options - The options for fetching the stage instance
|
|
2362
2440
|
*/
|
|
2363
2441
|
async get(channelId, { signal } = {}) {
|
|
2364
|
-
return this.rest.get(
|
|
2442
|
+
return this.rest.get(import_v1013.Routes.stageInstance(channelId), { signal });
|
|
2365
2443
|
}
|
|
2366
2444
|
/**
|
|
2367
2445
|
* Edits a stage instance
|
|
@@ -2372,7 +2450,7 @@ var StageInstancesAPI = class {
|
|
|
2372
2450
|
* @param options - The options for editing the stage instance
|
|
2373
2451
|
*/
|
|
2374
2452
|
async edit(channelId, body, { reason, signal } = {}) {
|
|
2375
|
-
return this.rest.patch(
|
|
2453
|
+
return this.rest.patch(import_v1013.Routes.stageInstance(channelId), {
|
|
2376
2454
|
body,
|
|
2377
2455
|
reason,
|
|
2378
2456
|
signal
|
|
@@ -2386,12 +2464,12 @@ var StageInstancesAPI = class {
|
|
|
2386
2464
|
* @param options - The options for deleting the stage instance
|
|
2387
2465
|
*/
|
|
2388
2466
|
async delete(channelId, { reason, signal } = {}) {
|
|
2389
|
-
await this.rest.delete(
|
|
2467
|
+
await this.rest.delete(import_v1013.Routes.stageInstance(channelId), { reason, signal });
|
|
2390
2468
|
}
|
|
2391
2469
|
};
|
|
2392
2470
|
|
|
2393
2471
|
// src/api/sticker.ts
|
|
2394
|
-
var
|
|
2472
|
+
var import_v1014 = require("discord-api-types/v10");
|
|
2395
2473
|
var StickersAPI = class {
|
|
2396
2474
|
constructor(rest) {
|
|
2397
2475
|
this.rest = rest;
|
|
@@ -2407,7 +2485,7 @@ var StickersAPI = class {
|
|
|
2407
2485
|
* @param options - The options for fetching the sticker pack
|
|
2408
2486
|
*/
|
|
2409
2487
|
async getStickerPack(packId, { signal } = {}) {
|
|
2410
|
-
return this.rest.get(
|
|
2488
|
+
return this.rest.get(import_v1014.Routes.stickerPack(packId), { signal });
|
|
2411
2489
|
}
|
|
2412
2490
|
/**
|
|
2413
2491
|
* Fetches all of the sticker packs
|
|
@@ -2416,7 +2494,7 @@ var StickersAPI = class {
|
|
|
2416
2494
|
* @param options - The options for fetching the sticker packs
|
|
2417
2495
|
*/
|
|
2418
2496
|
async getStickers({ signal } = {}) {
|
|
2419
|
-
return this.rest.get(
|
|
2497
|
+
return this.rest.get(import_v1014.Routes.stickerPacks(), { signal });
|
|
2420
2498
|
}
|
|
2421
2499
|
/**
|
|
2422
2500
|
* Fetches all of the sticker packs
|
|
@@ -2436,12 +2514,12 @@ var StickersAPI = class {
|
|
|
2436
2514
|
* @param options - The options for fetching the sticker
|
|
2437
2515
|
*/
|
|
2438
2516
|
async get(stickerId, { signal } = {}) {
|
|
2439
|
-
return this.rest.get(
|
|
2517
|
+
return this.rest.get(import_v1014.Routes.sticker(stickerId), { signal });
|
|
2440
2518
|
}
|
|
2441
2519
|
};
|
|
2442
2520
|
|
|
2443
2521
|
// src/api/thread.ts
|
|
2444
|
-
var
|
|
2522
|
+
var import_v1015 = require("discord-api-types/v10");
|
|
2445
2523
|
var ThreadsAPI = class {
|
|
2446
2524
|
constructor(rest) {
|
|
2447
2525
|
this.rest = rest;
|
|
@@ -2457,7 +2535,7 @@ var ThreadsAPI = class {
|
|
|
2457
2535
|
* @param options - The options for joining the thread
|
|
2458
2536
|
*/
|
|
2459
2537
|
async join(threadId, { signal } = {}) {
|
|
2460
|
-
await this.rest.put(
|
|
2538
|
+
await this.rest.put(import_v1015.Routes.threadMembers(threadId, "@me"), { signal });
|
|
2461
2539
|
}
|
|
2462
2540
|
/**
|
|
2463
2541
|
* Adds a member to a thread
|
|
@@ -2468,7 +2546,7 @@ var ThreadsAPI = class {
|
|
|
2468
2546
|
* @param options - The options for adding the member to the thread
|
|
2469
2547
|
*/
|
|
2470
2548
|
async addMember(threadId, userId, { signal } = {}) {
|
|
2471
|
-
await this.rest.put(
|
|
2549
|
+
await this.rest.put(import_v1015.Routes.threadMembers(threadId, userId), { signal });
|
|
2472
2550
|
}
|
|
2473
2551
|
/**
|
|
2474
2552
|
* Removes the current user from a thread
|
|
@@ -2478,7 +2556,7 @@ var ThreadsAPI = class {
|
|
|
2478
2556
|
* @param options - The options for leaving the thread
|
|
2479
2557
|
*/
|
|
2480
2558
|
async leave(threadId, { signal } = {}) {
|
|
2481
|
-
await this.rest.delete(
|
|
2559
|
+
await this.rest.delete(import_v1015.Routes.threadMembers(threadId, "@me"), { signal });
|
|
2482
2560
|
}
|
|
2483
2561
|
/**
|
|
2484
2562
|
* Removes a member from a thread
|
|
@@ -2489,7 +2567,7 @@ var ThreadsAPI = class {
|
|
|
2489
2567
|
* @param options - The options for removing the member from the thread
|
|
2490
2568
|
*/
|
|
2491
2569
|
async removeMember(threadId, userId, { signal } = {}) {
|
|
2492
|
-
await this.rest.delete(
|
|
2570
|
+
await this.rest.delete(import_v1015.Routes.threadMembers(threadId, userId), { signal });
|
|
2493
2571
|
}
|
|
2494
2572
|
/**
|
|
2495
2573
|
* Fetches a member of a thread
|
|
@@ -2500,7 +2578,7 @@ var ThreadsAPI = class {
|
|
|
2500
2578
|
* @param options - The options for fetching the member
|
|
2501
2579
|
*/
|
|
2502
2580
|
async getMember(threadId, userId, { signal } = {}) {
|
|
2503
|
-
return this.rest.get(
|
|
2581
|
+
return this.rest.get(import_v1015.Routes.threadMembers(threadId, userId), { signal });
|
|
2504
2582
|
}
|
|
2505
2583
|
/**
|
|
2506
2584
|
* Fetches all members of a thread
|
|
@@ -2510,13 +2588,13 @@ var ThreadsAPI = class {
|
|
|
2510
2588
|
* @param options - The options for fetching the members
|
|
2511
2589
|
*/
|
|
2512
2590
|
async getAllMembers(threadId, { signal } = {}) {
|
|
2513
|
-
return this.rest.get(
|
|
2591
|
+
return this.rest.get(import_v1015.Routes.threadMembers(threadId), { signal });
|
|
2514
2592
|
}
|
|
2515
2593
|
};
|
|
2516
2594
|
|
|
2517
2595
|
// src/api/user.ts
|
|
2518
2596
|
var import_rest8 = require("@discordjs/rest");
|
|
2519
|
-
var
|
|
2597
|
+
var import_v1016 = require("discord-api-types/v10");
|
|
2520
2598
|
var UsersAPI = class {
|
|
2521
2599
|
constructor(rest) {
|
|
2522
2600
|
this.rest = rest;
|
|
@@ -2532,7 +2610,7 @@ var UsersAPI = class {
|
|
|
2532
2610
|
* @param options - The options for fetching the user
|
|
2533
2611
|
*/
|
|
2534
2612
|
async get(userId, { signal } = {}) {
|
|
2535
|
-
return this.rest.get(
|
|
2613
|
+
return this.rest.get(import_v1016.Routes.user(userId), { signal });
|
|
2536
2614
|
}
|
|
2537
2615
|
/**
|
|
2538
2616
|
* Returns the user object of the requester's account
|
|
@@ -2541,7 +2619,7 @@ var UsersAPI = class {
|
|
|
2541
2619
|
* @param options - The options for fetching the current user
|
|
2542
2620
|
*/
|
|
2543
2621
|
async getCurrent({ signal } = {}) {
|
|
2544
|
-
return this.rest.get(
|
|
2622
|
+
return this.rest.get(import_v1016.Routes.user("@me"), { signal });
|
|
2545
2623
|
}
|
|
2546
2624
|
/**
|
|
2547
2625
|
* Returns a list of partial guild objects the current user is a member of
|
|
@@ -2551,7 +2629,7 @@ var UsersAPI = class {
|
|
|
2551
2629
|
* @param options - The options for fetching the guilds
|
|
2552
2630
|
*/
|
|
2553
2631
|
async getGuilds(query = {}, { signal } = {}) {
|
|
2554
|
-
return this.rest.get(
|
|
2632
|
+
return this.rest.get(import_v1016.Routes.userGuilds(), {
|
|
2555
2633
|
query: (0, import_rest8.makeURLSearchParams)(query),
|
|
2556
2634
|
signal
|
|
2557
2635
|
});
|
|
@@ -2564,7 +2642,7 @@ var UsersAPI = class {
|
|
|
2564
2642
|
* @param options - The options for leaving the guild
|
|
2565
2643
|
*/
|
|
2566
2644
|
async leaveGuild(guildId, { signal } = {}) {
|
|
2567
|
-
await this.rest.delete(
|
|
2645
|
+
await this.rest.delete(import_v1016.Routes.userGuild(guildId), { signal });
|
|
2568
2646
|
}
|
|
2569
2647
|
/**
|
|
2570
2648
|
* Edits the current user
|
|
@@ -2574,7 +2652,7 @@ var UsersAPI = class {
|
|
|
2574
2652
|
* @param options - The options for editing the user
|
|
2575
2653
|
*/
|
|
2576
2654
|
async edit(body, { signal } = {}) {
|
|
2577
|
-
return this.rest.patch(
|
|
2655
|
+
return this.rest.patch(import_v1016.Routes.user("@me"), { body, signal });
|
|
2578
2656
|
}
|
|
2579
2657
|
/**
|
|
2580
2658
|
* Fetches the guild member for the current user
|
|
@@ -2584,7 +2662,7 @@ var UsersAPI = class {
|
|
|
2584
2662
|
* @param options - The options for fetching the guild member
|
|
2585
2663
|
*/
|
|
2586
2664
|
async getGuildMember(guildId, { signal } = {}) {
|
|
2587
|
-
return this.rest.get(
|
|
2665
|
+
return this.rest.get(import_v1016.Routes.userGuildMember(guildId), { signal });
|
|
2588
2666
|
}
|
|
2589
2667
|
/**
|
|
2590
2668
|
* Edits the guild member for the current user
|
|
@@ -2595,7 +2673,7 @@ var UsersAPI = class {
|
|
|
2595
2673
|
* @param options - The options for editing the guild member
|
|
2596
2674
|
*/
|
|
2597
2675
|
async editCurrentGuildMember(guildId, body = {}, { reason, signal } = {}) {
|
|
2598
|
-
return this.rest.patch(
|
|
2676
|
+
return this.rest.patch(import_v1016.Routes.guildMember(guildId, "@me"), {
|
|
2599
2677
|
reason,
|
|
2600
2678
|
body,
|
|
2601
2679
|
signal
|
|
@@ -2609,7 +2687,7 @@ var UsersAPI = class {
|
|
|
2609
2687
|
* @param options - The options for opening the DM
|
|
2610
2688
|
*/
|
|
2611
2689
|
async createDM(userId, { signal } = {}) {
|
|
2612
|
-
return this.rest.post(
|
|
2690
|
+
return this.rest.post(import_v1016.Routes.userChannels(), {
|
|
2613
2691
|
body: { recipient_id: userId },
|
|
2614
2692
|
signal
|
|
2615
2693
|
});
|
|
@@ -2621,7 +2699,7 @@ var UsersAPI = class {
|
|
|
2621
2699
|
* @param options - The options for fetching the user's connections
|
|
2622
2700
|
*/
|
|
2623
2701
|
async getConnections({ signal } = {}) {
|
|
2624
|
-
return this.rest.get(
|
|
2702
|
+
return this.rest.get(import_v1016.Routes.userConnections(), { signal });
|
|
2625
2703
|
}
|
|
2626
2704
|
/**
|
|
2627
2705
|
* Gets the current user's active application role connection
|
|
@@ -2631,7 +2709,7 @@ var UsersAPI = class {
|
|
|
2631
2709
|
* @param options - The options for fetching the role connections
|
|
2632
2710
|
*/
|
|
2633
2711
|
async getApplicationRoleConnection(applicationId, { signal } = {}) {
|
|
2634
|
-
return this.rest.get(
|
|
2712
|
+
return this.rest.get(import_v1016.Routes.userApplicationRoleConnection(applicationId), {
|
|
2635
2713
|
signal
|
|
2636
2714
|
});
|
|
2637
2715
|
}
|
|
@@ -2644,7 +2722,7 @@ var UsersAPI = class {
|
|
|
2644
2722
|
* @param options - The options for updating the application role connection
|
|
2645
2723
|
*/
|
|
2646
2724
|
async updateApplicationRoleConnection(applicationId, body, { signal } = {}) {
|
|
2647
|
-
return this.rest.put(
|
|
2725
|
+
return this.rest.put(import_v1016.Routes.userApplicationRoleConnection(applicationId), {
|
|
2648
2726
|
body,
|
|
2649
2727
|
signal
|
|
2650
2728
|
});
|
|
@@ -2653,7 +2731,7 @@ var UsersAPI = class {
|
|
|
2653
2731
|
|
|
2654
2732
|
// src/api/webhook.ts
|
|
2655
2733
|
var import_rest9 = require("@discordjs/rest");
|
|
2656
|
-
var
|
|
2734
|
+
var import_v1017 = require("discord-api-types/v10");
|
|
2657
2735
|
var WebhooksAPI = class {
|
|
2658
2736
|
constructor(rest) {
|
|
2659
2737
|
this.rest = rest;
|
|
@@ -2670,7 +2748,7 @@ var WebhooksAPI = class {
|
|
|
2670
2748
|
* @param options - The options for fetching the webhook
|
|
2671
2749
|
*/
|
|
2672
2750
|
async get(id, { token, signal } = {}) {
|
|
2673
|
-
return this.rest.get(
|
|
2751
|
+
return this.rest.get(import_v1017.Routes.webhook(id, token), {
|
|
2674
2752
|
signal,
|
|
2675
2753
|
auth: !token
|
|
2676
2754
|
});
|
|
@@ -2685,7 +2763,7 @@ var WebhooksAPI = class {
|
|
|
2685
2763
|
* @param options - The options for editing the webhook
|
|
2686
2764
|
*/
|
|
2687
2765
|
async edit(id, body, { token, reason, signal } = {}) {
|
|
2688
|
-
return this.rest.patch(
|
|
2766
|
+
return this.rest.patch(import_v1017.Routes.webhook(id, token), {
|
|
2689
2767
|
reason,
|
|
2690
2768
|
body,
|
|
2691
2769
|
signal,
|
|
@@ -2701,7 +2779,7 @@ var WebhooksAPI = class {
|
|
|
2701
2779
|
* @param options - The options for deleting the webhook
|
|
2702
2780
|
*/
|
|
2703
2781
|
async delete(id, { token, reason, signal } = {}) {
|
|
2704
|
-
await this.rest.delete(
|
|
2782
|
+
await this.rest.delete(import_v1017.Routes.webhook(id, token), {
|
|
2705
2783
|
reason,
|
|
2706
2784
|
signal,
|
|
2707
2785
|
auth: !token
|
|
@@ -2723,7 +2801,7 @@ var WebhooksAPI = class {
|
|
|
2723
2801
|
files,
|
|
2724
2802
|
...body
|
|
2725
2803
|
}, { signal } = {}) {
|
|
2726
|
-
return this.rest.post(
|
|
2804
|
+
return this.rest.post(import_v1017.Routes.webhook(id, token), {
|
|
2727
2805
|
query: (0, import_rest9.makeURLSearchParams)({ wait, thread_id, with_components }),
|
|
2728
2806
|
files,
|
|
2729
2807
|
body,
|
|
@@ -2743,7 +2821,7 @@ var WebhooksAPI = class {
|
|
|
2743
2821
|
* @param options - The options for executing the webhook
|
|
2744
2822
|
*/
|
|
2745
2823
|
async executeSlack(id, token, body, query = {}, { signal } = {}) {
|
|
2746
|
-
await this.rest.post(
|
|
2824
|
+
await this.rest.post(import_v1017.Routes.webhookPlatform(id, token, "slack"), {
|
|
2747
2825
|
query: (0, import_rest9.makeURLSearchParams)(query),
|
|
2748
2826
|
body,
|
|
2749
2827
|
auth: false,
|
|
@@ -2761,7 +2839,7 @@ var WebhooksAPI = class {
|
|
|
2761
2839
|
* @param options - The options for executing the webhook
|
|
2762
2840
|
*/
|
|
2763
2841
|
async executeGitHub(id, token, body, query = {}, { signal } = {}) {
|
|
2764
|
-
await this.rest.post(
|
|
2842
|
+
await this.rest.post(import_v1017.Routes.webhookPlatform(id, token, "github"), {
|
|
2765
2843
|
query: (0, import_rest9.makeURLSearchParams)(query),
|
|
2766
2844
|
body,
|
|
2767
2845
|
signal,
|
|
@@ -2779,7 +2857,7 @@ var WebhooksAPI = class {
|
|
|
2779
2857
|
* @param options - The options for fetching the message
|
|
2780
2858
|
*/
|
|
2781
2859
|
async getMessage(id, token, messageId, query = {}, { signal } = {}) {
|
|
2782
|
-
return this.rest.get(
|
|
2860
|
+
return this.rest.get(import_v1017.Routes.webhookMessage(id, token, messageId), {
|
|
2783
2861
|
query: (0, import_rest9.makeURLSearchParams)(query),
|
|
2784
2862
|
auth: false,
|
|
2785
2863
|
signal
|
|
@@ -2801,7 +2879,7 @@ var WebhooksAPI = class {
|
|
|
2801
2879
|
files,
|
|
2802
2880
|
...body
|
|
2803
2881
|
}, { signal } = {}) {
|
|
2804
|
-
return this.rest.patch(
|
|
2882
|
+
return this.rest.patch(import_v1017.Routes.webhookMessage(id, token, messageId), {
|
|
2805
2883
|
query: (0, import_rest9.makeURLSearchParams)({ thread_id, with_components }),
|
|
2806
2884
|
auth: false,
|
|
2807
2885
|
body,
|
|
@@ -2820,7 +2898,7 @@ var WebhooksAPI = class {
|
|
|
2820
2898
|
* @param options - The options for deleting the message
|
|
2821
2899
|
*/
|
|
2822
2900
|
async deleteMessage(id, token, messageId, query = {}, { signal } = {}) {
|
|
2823
|
-
await this.rest.delete(
|
|
2901
|
+
await this.rest.delete(import_v1017.Routes.webhookMessage(id, token, messageId), {
|
|
2824
2902
|
query: (0, import_rest9.makeURLSearchParams)(query),
|
|
2825
2903
|
auth: false,
|
|
2826
2904
|
signal
|
|
@@ -2835,6 +2913,7 @@ var API = class {
|
|
|
2835
2913
|
this.applicationCommands = new ApplicationCommandsAPI(rest);
|
|
2836
2914
|
this.applications = new ApplicationsAPI(rest);
|
|
2837
2915
|
this.channels = new ChannelsAPI(rest);
|
|
2916
|
+
this.gateway = new GatewayAPI(rest);
|
|
2838
2917
|
this.guilds = new GuildsAPI(rest);
|
|
2839
2918
|
this.invites = new InvitesAPI(rest);
|
|
2840
2919
|
this.monetization = new MonetizationAPI(rest);
|
|
@@ -2855,6 +2934,7 @@ var API = class {
|
|
|
2855
2934
|
applicationCommands;
|
|
2856
2935
|
applications;
|
|
2857
2936
|
channels;
|
|
2937
|
+
gateway;
|
|
2858
2938
|
guilds;
|
|
2859
2939
|
interactions;
|
|
2860
2940
|
invites;
|
|
@@ -2876,7 +2956,7 @@ var import_util = require("@discordjs/util");
|
|
|
2876
2956
|
var import_ws = require("@discordjs/ws");
|
|
2877
2957
|
var import_snowflake = require("@sapphire/snowflake");
|
|
2878
2958
|
var import_async_event_emitter = require("@vladfrangu/async_event_emitter");
|
|
2879
|
-
var
|
|
2959
|
+
var import_v1018 = require("discord-api-types/v10");
|
|
2880
2960
|
var Client = class extends import_async_event_emitter.AsyncEventEmitter {
|
|
2881
2961
|
static {
|
|
2882
2962
|
__name(this, "Client");
|
|
@@ -2916,7 +2996,7 @@ var Client = class extends import_async_event_emitter.AsyncEventEmitter {
|
|
|
2916
2996
|
}, timeout), "createTimer");
|
|
2917
2997
|
let timer = createTimer();
|
|
2918
2998
|
await this.gateway.send(shardId, {
|
|
2919
|
-
op:
|
|
2999
|
+
op: import_v1018.GatewayOpcodes.RequestGuildMembers,
|
|
2920
3000
|
// eslint-disable-next-line id-length
|
|
2921
3001
|
d: {
|
|
2922
3002
|
...options,
|
|
@@ -2924,7 +3004,7 @@ var Client = class extends import_async_event_emitter.AsyncEventEmitter {
|
|
|
2924
3004
|
}
|
|
2925
3005
|
});
|
|
2926
3006
|
try {
|
|
2927
|
-
const iterator = import_async_event_emitter.AsyncEventEmitter.on(this,
|
|
3007
|
+
const iterator = import_async_event_emitter.AsyncEventEmitter.on(this, import_v1018.GatewayDispatchEvents.GuildMembersChunk, {
|
|
2928
3008
|
signal: controller.signal
|
|
2929
3009
|
});
|
|
2930
3010
|
for await (const [{ data }] of iterator) {
|
|
@@ -2989,7 +3069,7 @@ var Client = class extends import_async_event_emitter.AsyncEventEmitter {
|
|
|
2989
3069
|
async updateVoiceState(options) {
|
|
2990
3070
|
const shardId = (0, import_util.calculateShardId)(options.guild_id, await this.gateway.getShardCount());
|
|
2991
3071
|
await this.gateway.send(shardId, {
|
|
2992
|
-
op:
|
|
3072
|
+
op: import_v1018.GatewayOpcodes.VoiceStateUpdate,
|
|
2993
3073
|
// eslint-disable-next-line id-length
|
|
2994
3074
|
d: options
|
|
2995
3075
|
});
|
|
@@ -3002,7 +3082,7 @@ var Client = class extends import_async_event_emitter.AsyncEventEmitter {
|
|
|
3002
3082
|
*/
|
|
3003
3083
|
async updatePresence(shardId, options) {
|
|
3004
3084
|
await this.gateway.send(shardId, {
|
|
3005
|
-
op:
|
|
3085
|
+
op: import_v1018.GatewayOpcodes.PresenceUpdate,
|
|
3006
3086
|
// eslint-disable-next-line id-length
|
|
3007
3087
|
d: options
|
|
3008
3088
|
});
|
|
@@ -3035,7 +3115,7 @@ __name(withFiles, "withFiles");
|
|
|
3035
3115
|
|
|
3036
3116
|
// src/index.ts
|
|
3037
3117
|
__reExport(src_exports, require("discord-api-types/v10"), module.exports);
|
|
3038
|
-
var version = "2.
|
|
3118
|
+
var version = "2.3.0";
|
|
3039
3119
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3040
3120
|
0 && (module.exports = {
|
|
3041
3121
|
API,
|
|
@@ -3043,6 +3123,7 @@ var version = "2.2.1";
|
|
|
3043
3123
|
ApplicationsAPI,
|
|
3044
3124
|
ChannelsAPI,
|
|
3045
3125
|
Client,
|
|
3126
|
+
GatewayAPI,
|
|
3046
3127
|
GuildsAPI,
|
|
3047
3128
|
InteractionsAPI,
|
|
3048
3129
|
InvitesAPI,
|