@discordjs/core 2.2.2 → 2.4.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 +379 -44
- package/dist/http-only.d.ts +379 -44
- package/dist/http-only.js +447 -261
- package/dist/http-only.js.map +1 -1
- package/dist/http-only.mjs +438 -254
- package/dist/http-only.mjs.map +1 -1
- package/dist/index.d.mts +424 -44
- package/dist/index.d.ts +424 -44
- package/dist/index.js +562 -282
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +545 -268
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
package/dist/http-only.js
CHANGED
|
@@ -26,6 +26,7 @@ __export(http_only_exports, {
|
|
|
26
26
|
ApplicationCommandsAPI: () => ApplicationCommandsAPI,
|
|
27
27
|
ApplicationsAPI: () => ApplicationsAPI,
|
|
28
28
|
ChannelsAPI: () => ChannelsAPI,
|
|
29
|
+
GatewayAPI: () => GatewayAPI,
|
|
29
30
|
GuildsAPI: () => GuildsAPI,
|
|
30
31
|
InteractionsAPI: () => InteractionsAPI,
|
|
31
32
|
InvitesAPI: () => InvitesAPI,
|
|
@@ -33,6 +34,7 @@ __export(http_only_exports, {
|
|
|
33
34
|
OAuth2API: () => OAuth2API,
|
|
34
35
|
PollAPI: () => PollAPI,
|
|
35
36
|
RoleConnectionsAPI: () => RoleConnectionsAPI,
|
|
37
|
+
SoundboardSoundsAPI: () => SoundboardSoundsAPI,
|
|
36
38
|
StageInstancesAPI: () => StageInstancesAPI,
|
|
37
39
|
StickersAPI: () => StickersAPI,
|
|
38
40
|
ThreadsAPI: () => ThreadsAPI,
|
|
@@ -790,14 +792,88 @@ var ChannelsAPI = class {
|
|
|
790
792
|
signal
|
|
791
793
|
});
|
|
792
794
|
}
|
|
795
|
+
/**
|
|
796
|
+
* Sends a soundboard sound in a channel
|
|
797
|
+
*
|
|
798
|
+
* @see {@link https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound}
|
|
799
|
+
* @param channelId - The id of the channel to send the soundboard sound in
|
|
800
|
+
* @param body - The data for sending the soundboard sound
|
|
801
|
+
* @param options - The options for sending the soundboard sound
|
|
802
|
+
*/
|
|
803
|
+
async sendSoundboardSound(channelId, body, { signal } = {}) {
|
|
804
|
+
return this.rest.post(import_v103.Routes.sendSoundboardSound(channelId), {
|
|
805
|
+
body,
|
|
806
|
+
signal
|
|
807
|
+
});
|
|
808
|
+
}
|
|
809
|
+
/**
|
|
810
|
+
* Adds a recipient to a group DM channel
|
|
811
|
+
*
|
|
812
|
+
* @see {@link https://discord.com/developers/docs/resources/channel#group-dm-add-recipient}
|
|
813
|
+
* @param channelId - The id of the channel to add the recipient to
|
|
814
|
+
* @param userId - The id of the user to add as a recipient
|
|
815
|
+
* @param body - The data for adding the recipient
|
|
816
|
+
* @param options - The options for adding the recipient
|
|
817
|
+
*/
|
|
818
|
+
async addGroupDMRecipient(channelId, userId, body, { signal } = {}) {
|
|
819
|
+
await this.rest.put(import_v103.Routes.channelRecipient(channelId, userId), {
|
|
820
|
+
body,
|
|
821
|
+
signal
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
/**
|
|
825
|
+
* Removes a recipient from a group DM channel
|
|
826
|
+
*
|
|
827
|
+
* @see {@link https://discord.com/developers/docs/resources/channel#group-dm-remove-recipient}
|
|
828
|
+
* @param channelId - The id of the channel to remove the recipient from
|
|
829
|
+
* @param userId - The id of the user to remove as a recipient
|
|
830
|
+
* @param options - The options for removing the recipient
|
|
831
|
+
*/
|
|
832
|
+
async removeGroupDMRecipient(channelId, userId, { signal } = {}) {
|
|
833
|
+
await this.rest.delete(import_v103.Routes.channelRecipient(channelId, userId), {
|
|
834
|
+
signal
|
|
835
|
+
});
|
|
836
|
+
}
|
|
837
|
+
};
|
|
838
|
+
|
|
839
|
+
// src/api/gateway.ts
|
|
840
|
+
var import_v104 = require("discord-api-types/v10");
|
|
841
|
+
var GatewayAPI = class {
|
|
842
|
+
constructor(rest) {
|
|
843
|
+
this.rest = rest;
|
|
844
|
+
}
|
|
845
|
+
static {
|
|
846
|
+
__name(this, "GatewayAPI");
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* Gets gateway information.
|
|
850
|
+
*
|
|
851
|
+
* @see {@link https://discord.com/developers/docs/events/gateway#get-gateway}
|
|
852
|
+
* @param options - The options for fetching the gateway information
|
|
853
|
+
*/
|
|
854
|
+
async get({ signal } = {}) {
|
|
855
|
+
return this.rest.get(import_v104.Routes.gateway(), {
|
|
856
|
+
auth: false,
|
|
857
|
+
signal
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
/**
|
|
861
|
+
* Gets gateway information with additional metadata.
|
|
862
|
+
*
|
|
863
|
+
* @see {@link https://discord.com/developers/docs/events/gateway#get-gateway-bot}
|
|
864
|
+
* @param options - The options for fetching the gateway information
|
|
865
|
+
*/
|
|
866
|
+
async getBot({ signal } = {}) {
|
|
867
|
+
return this.rest.get(import_v104.Routes.gatewayBot(), { signal });
|
|
868
|
+
}
|
|
793
869
|
};
|
|
794
870
|
|
|
795
871
|
// src/api/guild.ts
|
|
796
872
|
var import_rest3 = require("@discordjs/rest");
|
|
797
|
-
var
|
|
873
|
+
var import_v106 = require("discord-api-types/v10");
|
|
798
874
|
|
|
799
875
|
// src/api/voice.ts
|
|
800
|
-
var
|
|
876
|
+
var import_v105 = require("discord-api-types/v10");
|
|
801
877
|
var VoiceAPI = class {
|
|
802
878
|
constructor(rest) {
|
|
803
879
|
this.rest = rest;
|
|
@@ -812,7 +888,7 @@ var VoiceAPI = class {
|
|
|
812
888
|
* @param options - The options for fetching the voice regions
|
|
813
889
|
*/
|
|
814
890
|
async getVoiceRegions({ signal } = {}) {
|
|
815
|
-
return this.rest.get(
|
|
891
|
+
return this.rest.get(import_v105.Routes.voiceRegions(), { signal });
|
|
816
892
|
}
|
|
817
893
|
/**
|
|
818
894
|
* Fetches voice state of a user by their id
|
|
@@ -821,7 +897,7 @@ var VoiceAPI = class {
|
|
|
821
897
|
* @param options - The options for fetching user voice state
|
|
822
898
|
*/
|
|
823
899
|
async getUserVoiceState(guildId, userId, { signal } = {}) {
|
|
824
|
-
return this.rest.get(
|
|
900
|
+
return this.rest.get(import_v105.Routes.guildVoiceState(guildId, userId), {
|
|
825
901
|
signal
|
|
826
902
|
});
|
|
827
903
|
}
|
|
@@ -832,7 +908,7 @@ var VoiceAPI = class {
|
|
|
832
908
|
* @param options - The options for fetching user voice state
|
|
833
909
|
*/
|
|
834
910
|
async getVoiceState(guildId, { signal } = {}) {
|
|
835
|
-
return this.rest.get(
|
|
911
|
+
return this.rest.get(import_v105.Routes.guildVoiceState(guildId, "@me"), {
|
|
836
912
|
signal
|
|
837
913
|
});
|
|
838
914
|
}
|
|
@@ -846,7 +922,7 @@ var VoiceAPI = class {
|
|
|
846
922
|
* @param options - The options for editing the voice state
|
|
847
923
|
*/
|
|
848
924
|
async editUserVoiceState(guildId, userId, body, { reason, signal } = {}) {
|
|
849
|
-
return this.rest.patch(
|
|
925
|
+
return this.rest.patch(import_v105.Routes.guildVoiceState(guildId, userId), {
|
|
850
926
|
reason,
|
|
851
927
|
body,
|
|
852
928
|
signal
|
|
@@ -861,7 +937,7 @@ var VoiceAPI = class {
|
|
|
861
937
|
* @param options - The options for editing the voice state
|
|
862
938
|
*/
|
|
863
939
|
async editVoiceState(guildId, body = {}, { signal } = {}) {
|
|
864
|
-
return this.rest.patch(
|
|
940
|
+
return this.rest.patch(import_v105.Routes.guildVoiceState(guildId, "@me"), {
|
|
865
941
|
body,
|
|
866
942
|
signal
|
|
867
943
|
});
|
|
@@ -883,7 +959,7 @@ var GuildsAPI = class {
|
|
|
883
959
|
if ("with_counts" in queryOrOptions) {
|
|
884
960
|
requestData.query = (0, import_rest3.makeURLSearchParams)(queryOrOptions);
|
|
885
961
|
}
|
|
886
|
-
return this.rest.get(
|
|
962
|
+
return this.rest.get(import_v106.Routes.guild(guildId), requestData);
|
|
887
963
|
}
|
|
888
964
|
/**
|
|
889
965
|
* Fetches a guild preview
|
|
@@ -893,7 +969,7 @@ var GuildsAPI = class {
|
|
|
893
969
|
* @param options - The options for fetching the guild preview
|
|
894
970
|
*/
|
|
895
971
|
async getPreview(guildId, { signal } = {}) {
|
|
896
|
-
return this.rest.get(
|
|
972
|
+
return this.rest.get(import_v106.Routes.guildPreview(guildId), {
|
|
897
973
|
signal
|
|
898
974
|
});
|
|
899
975
|
}
|
|
@@ -906,7 +982,7 @@ var GuildsAPI = class {
|
|
|
906
982
|
* @deprecated API related to guild ownership may no longer be used.
|
|
907
983
|
*/
|
|
908
984
|
async create(body, { signal } = {}) {
|
|
909
|
-
return this.rest.post(
|
|
985
|
+
return this.rest.post(import_v106.Routes.guilds(), { body, signal });
|
|
910
986
|
}
|
|
911
987
|
/**
|
|
912
988
|
* Edits a guild
|
|
@@ -917,7 +993,7 @@ var GuildsAPI = class {
|
|
|
917
993
|
* @param options - The options for editing the guild
|
|
918
994
|
*/
|
|
919
995
|
async edit(guildId, body, { reason, signal } = {}) {
|
|
920
|
-
return this.rest.patch(
|
|
996
|
+
return this.rest.patch(import_v106.Routes.guild(guildId), {
|
|
921
997
|
reason,
|
|
922
998
|
body,
|
|
923
999
|
signal
|
|
@@ -932,7 +1008,7 @@ var GuildsAPI = class {
|
|
|
932
1008
|
* @deprecated API related to guild ownership may no longer be used.
|
|
933
1009
|
*/
|
|
934
1010
|
async delete(guildId, { signal } = {}) {
|
|
935
|
-
await this.rest.delete(
|
|
1011
|
+
await this.rest.delete(import_v106.Routes.guild(guildId), { signal });
|
|
936
1012
|
}
|
|
937
1013
|
/**
|
|
938
1014
|
* Adds user to the guild
|
|
@@ -944,13 +1020,13 @@ var GuildsAPI = class {
|
|
|
944
1020
|
* @param options - The options for adding users to the guild
|
|
945
1021
|
*/
|
|
946
1022
|
async addMember(guildId, userId, body, { signal } = {}) {
|
|
947
|
-
return this.rest.put(
|
|
1023
|
+
return this.rest.put(import_v106.Routes.guildMember(guildId, userId), {
|
|
948
1024
|
body,
|
|
949
1025
|
signal
|
|
950
1026
|
});
|
|
951
1027
|
}
|
|
952
1028
|
/**
|
|
953
|
-
* Fetches
|
|
1029
|
+
* Fetches members of a guild.
|
|
954
1030
|
*
|
|
955
1031
|
* @see {@link https://discord.com/developers/docs/resources/guild#list-guild-members}
|
|
956
1032
|
* @param guildId - The id of the guild
|
|
@@ -958,7 +1034,7 @@ var GuildsAPI = class {
|
|
|
958
1034
|
* @param options - The options for fetching the guild members
|
|
959
1035
|
*/
|
|
960
1036
|
async getMembers(guildId, query = {}, { signal } = {}) {
|
|
961
|
-
return this.rest.get(
|
|
1037
|
+
return this.rest.get(import_v106.Routes.guildMembers(guildId), {
|
|
962
1038
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
963
1039
|
signal
|
|
964
1040
|
});
|
|
@@ -971,7 +1047,7 @@ var GuildsAPI = class {
|
|
|
971
1047
|
* @param options - The options for fetching the guild channels
|
|
972
1048
|
*/
|
|
973
1049
|
async getChannels(guildId, { signal } = {}) {
|
|
974
|
-
return this.rest.get(
|
|
1050
|
+
return this.rest.get(import_v106.Routes.guildChannels(guildId), {
|
|
975
1051
|
signal
|
|
976
1052
|
});
|
|
977
1053
|
}
|
|
@@ -984,7 +1060,7 @@ var GuildsAPI = class {
|
|
|
984
1060
|
* @param options - The options for creating the guild channel
|
|
985
1061
|
*/
|
|
986
1062
|
async createChannel(guildId, body, { reason, signal } = {}) {
|
|
987
|
-
return this.rest.post(
|
|
1063
|
+
return this.rest.post(import_v106.Routes.guildChannels(guildId), {
|
|
988
1064
|
reason,
|
|
989
1065
|
body,
|
|
990
1066
|
signal
|
|
@@ -999,7 +1075,7 @@ var GuildsAPI = class {
|
|
|
999
1075
|
* @param options - The options for editing the guild channel positions
|
|
1000
1076
|
*/
|
|
1001
1077
|
async setChannelPositions(guildId, body, { reason, signal } = {}) {
|
|
1002
|
-
await this.rest.patch(
|
|
1078
|
+
await this.rest.patch(import_v106.Routes.guildChannels(guildId), { reason, body, signal });
|
|
1003
1079
|
}
|
|
1004
1080
|
/**
|
|
1005
1081
|
* Fetches the active threads in a guild
|
|
@@ -1009,7 +1085,7 @@ var GuildsAPI = class {
|
|
|
1009
1085
|
* @param options - The options for fetching the active threads
|
|
1010
1086
|
*/
|
|
1011
1087
|
async getActiveThreads(guildId, { signal } = {}) {
|
|
1012
|
-
return this.rest.get(
|
|
1088
|
+
return this.rest.get(import_v106.Routes.guildActiveThreads(guildId), { signal });
|
|
1013
1089
|
}
|
|
1014
1090
|
/**
|
|
1015
1091
|
* Fetches a guild member ban
|
|
@@ -1020,7 +1096,7 @@ var GuildsAPI = class {
|
|
|
1020
1096
|
* @param options - The options for fetching the ban
|
|
1021
1097
|
*/
|
|
1022
1098
|
async getMemberBan(guildId, userId, { signal } = {}) {
|
|
1023
|
-
return this.rest.get(
|
|
1099
|
+
return this.rest.get(import_v106.Routes.guildBan(guildId, userId), { signal });
|
|
1024
1100
|
}
|
|
1025
1101
|
/**
|
|
1026
1102
|
* Fetches guild member bans
|
|
@@ -1031,7 +1107,7 @@ var GuildsAPI = class {
|
|
|
1031
1107
|
* @param options - The options for fetching the bans
|
|
1032
1108
|
*/
|
|
1033
1109
|
async getMemberBans(guildId, query = {}, { signal } = {}) {
|
|
1034
|
-
return this.rest.get(
|
|
1110
|
+
return this.rest.get(import_v106.Routes.guildBans(guildId), {
|
|
1035
1111
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1036
1112
|
signal
|
|
1037
1113
|
});
|
|
@@ -1046,7 +1122,7 @@ var GuildsAPI = class {
|
|
|
1046
1122
|
* @param options - The options for banning the user
|
|
1047
1123
|
*/
|
|
1048
1124
|
async banUser(guildId, userId, body = {}, { reason, signal } = {}) {
|
|
1049
|
-
await this.rest.put(
|
|
1125
|
+
await this.rest.put(import_v106.Routes.guildBan(guildId, userId), { reason, body, signal });
|
|
1050
1126
|
}
|
|
1051
1127
|
/**
|
|
1052
1128
|
* Unbans a user from a guild
|
|
@@ -1057,7 +1133,7 @@ var GuildsAPI = class {
|
|
|
1057
1133
|
* @param options - The options for unbanning the user
|
|
1058
1134
|
*/
|
|
1059
1135
|
async unbanUser(guildId, userId, { reason, signal } = {}) {
|
|
1060
|
-
await this.rest.delete(
|
|
1136
|
+
await this.rest.delete(import_v106.Routes.guildBan(guildId, userId), { reason, signal });
|
|
1061
1137
|
}
|
|
1062
1138
|
/**
|
|
1063
1139
|
* Bulk ban users from a guild
|
|
@@ -1068,7 +1144,7 @@ var GuildsAPI = class {
|
|
|
1068
1144
|
* @param options - The options for bulk banning users
|
|
1069
1145
|
*/
|
|
1070
1146
|
async bulkBanUsers(guildId, body, { reason, signal } = {}) {
|
|
1071
|
-
return this.rest.post(
|
|
1147
|
+
return this.rest.post(import_v106.Routes.guildBulkBan(guildId), {
|
|
1072
1148
|
reason,
|
|
1073
1149
|
body,
|
|
1074
1150
|
signal
|
|
@@ -1082,7 +1158,7 @@ var GuildsAPI = class {
|
|
|
1082
1158
|
* @param options - The options for fetching the guild roles
|
|
1083
1159
|
*/
|
|
1084
1160
|
async getRoles(guildId, { signal } = {}) {
|
|
1085
|
-
return this.rest.get(
|
|
1161
|
+
return this.rest.get(import_v106.Routes.guildRoles(guildId), { signal });
|
|
1086
1162
|
}
|
|
1087
1163
|
/**
|
|
1088
1164
|
* Get a role in a guild
|
|
@@ -1093,7 +1169,7 @@ var GuildsAPI = class {
|
|
|
1093
1169
|
* @param options - The options for fetching the guild role
|
|
1094
1170
|
*/
|
|
1095
1171
|
async getRole(guildId, roleId, { signal } = {}) {
|
|
1096
|
-
return this.rest.get(
|
|
1172
|
+
return this.rest.get(import_v106.Routes.guildRole(guildId, roleId), { signal });
|
|
1097
1173
|
}
|
|
1098
1174
|
/**
|
|
1099
1175
|
* Creates a guild role
|
|
@@ -1104,7 +1180,7 @@ var GuildsAPI = class {
|
|
|
1104
1180
|
* @param options - The options for creating the guild role
|
|
1105
1181
|
*/
|
|
1106
1182
|
async createRole(guildId, body, { reason, signal } = {}) {
|
|
1107
|
-
return this.rest.post(
|
|
1183
|
+
return this.rest.post(import_v106.Routes.guildRoles(guildId), { reason, body, signal });
|
|
1108
1184
|
}
|
|
1109
1185
|
/**
|
|
1110
1186
|
* Sets role positions in a guild
|
|
@@ -1115,7 +1191,7 @@ var GuildsAPI = class {
|
|
|
1115
1191
|
* @param options - The options for setting role positions
|
|
1116
1192
|
*/
|
|
1117
1193
|
async setRolePositions(guildId, body, { reason, signal } = {}) {
|
|
1118
|
-
return this.rest.patch(
|
|
1194
|
+
return this.rest.patch(import_v106.Routes.guildRoles(guildId), {
|
|
1119
1195
|
reason,
|
|
1120
1196
|
body,
|
|
1121
1197
|
signal
|
|
@@ -1131,7 +1207,7 @@ var GuildsAPI = class {
|
|
|
1131
1207
|
* @param options - The options for editing the guild role
|
|
1132
1208
|
*/
|
|
1133
1209
|
async editRole(guildId, roleId, body, { reason, signal } = {}) {
|
|
1134
|
-
return this.rest.patch(
|
|
1210
|
+
return this.rest.patch(import_v106.Routes.guildRole(guildId, roleId), {
|
|
1135
1211
|
reason,
|
|
1136
1212
|
body,
|
|
1137
1213
|
signal
|
|
@@ -1146,7 +1222,7 @@ var GuildsAPI = class {
|
|
|
1146
1222
|
* @param options - The options for deleting the guild role
|
|
1147
1223
|
*/
|
|
1148
1224
|
async deleteRole(guildId, roleId, { reason, signal } = {}) {
|
|
1149
|
-
await this.rest.delete(
|
|
1225
|
+
await this.rest.delete(import_v106.Routes.guildRole(guildId, roleId), { reason, signal });
|
|
1150
1226
|
}
|
|
1151
1227
|
/**
|
|
1152
1228
|
* Edits the multi-factor-authentication (MFA) level of a guild
|
|
@@ -1158,7 +1234,7 @@ var GuildsAPI = class {
|
|
|
1158
1234
|
* @deprecated API related to guild ownership may no longer be used.
|
|
1159
1235
|
*/
|
|
1160
1236
|
async editMFALevel(guildId, level, { reason, signal } = {}) {
|
|
1161
|
-
return this.rest.post(
|
|
1237
|
+
return this.rest.post(import_v106.Routes.guildMFA(guildId), {
|
|
1162
1238
|
reason,
|
|
1163
1239
|
signal,
|
|
1164
1240
|
body: { level }
|
|
@@ -1173,7 +1249,7 @@ var GuildsAPI = class {
|
|
|
1173
1249
|
* @param options - The options for fetching the number of pruned members
|
|
1174
1250
|
*/
|
|
1175
1251
|
async getPruneCount(guildId, query = {}, { signal } = {}) {
|
|
1176
|
-
return this.rest.get(
|
|
1252
|
+
return this.rest.get(import_v106.Routes.guildPrune(guildId), {
|
|
1177
1253
|
signal,
|
|
1178
1254
|
query: (0, import_rest3.makeURLSearchParams)(query)
|
|
1179
1255
|
});
|
|
@@ -1187,7 +1263,7 @@ var GuildsAPI = class {
|
|
|
1187
1263
|
* @param options - The options for initiating the prune
|
|
1188
1264
|
*/
|
|
1189
1265
|
async beginPrune(guildId, body = {}, { reason, signal } = {}) {
|
|
1190
|
-
return this.rest.post(
|
|
1266
|
+
return this.rest.post(import_v106.Routes.guildPrune(guildId), {
|
|
1191
1267
|
body,
|
|
1192
1268
|
reason,
|
|
1193
1269
|
signal
|
|
@@ -1201,7 +1277,7 @@ var GuildsAPI = class {
|
|
|
1201
1277
|
* @param options - The options for fetching the voice regions
|
|
1202
1278
|
*/
|
|
1203
1279
|
async getVoiceRegions(guildId, { signal } = {}) {
|
|
1204
|
-
return this.rest.get(
|
|
1280
|
+
return this.rest.get(import_v106.Routes.guildVoiceRegions(guildId), { signal });
|
|
1205
1281
|
}
|
|
1206
1282
|
/**
|
|
1207
1283
|
* Fetches the invites for a guild
|
|
@@ -1211,7 +1287,7 @@ var GuildsAPI = class {
|
|
|
1211
1287
|
* @param options - The options for fetching the invites
|
|
1212
1288
|
*/
|
|
1213
1289
|
async getInvites(guildId, { signal } = {}) {
|
|
1214
|
-
return this.rest.get(
|
|
1290
|
+
return this.rest.get(import_v106.Routes.guildInvites(guildId), { signal });
|
|
1215
1291
|
}
|
|
1216
1292
|
/**
|
|
1217
1293
|
* Fetches the integrations for a guild
|
|
@@ -1221,7 +1297,7 @@ var GuildsAPI = class {
|
|
|
1221
1297
|
* @param options - The options for fetching the integrations
|
|
1222
1298
|
*/
|
|
1223
1299
|
async getIntegrations(guildId, { signal } = {}) {
|
|
1224
|
-
return this.rest.get(
|
|
1300
|
+
return this.rest.get(import_v106.Routes.guildIntegrations(guildId), { signal });
|
|
1225
1301
|
}
|
|
1226
1302
|
/**
|
|
1227
1303
|
* Deletes an integration from a guild
|
|
@@ -1232,7 +1308,7 @@ var GuildsAPI = class {
|
|
|
1232
1308
|
* @param options - The options for deleting the integration
|
|
1233
1309
|
*/
|
|
1234
1310
|
async deleteIntegration(guildId, integrationId, { reason, signal } = {}) {
|
|
1235
|
-
await this.rest.delete(
|
|
1311
|
+
await this.rest.delete(import_v106.Routes.guildIntegration(guildId, integrationId), { reason, signal });
|
|
1236
1312
|
}
|
|
1237
1313
|
/**
|
|
1238
1314
|
* Fetches the widget settings for a guild
|
|
@@ -1242,7 +1318,7 @@ var GuildsAPI = class {
|
|
|
1242
1318
|
* @param options - The options for fetching the widget settings
|
|
1243
1319
|
*/
|
|
1244
1320
|
async getWidgetSettings(guildId, { signal } = {}) {
|
|
1245
|
-
return this.rest.get(
|
|
1321
|
+
return this.rest.get(import_v106.Routes.guildWidgetSettings(guildId), {
|
|
1246
1322
|
signal
|
|
1247
1323
|
});
|
|
1248
1324
|
}
|
|
@@ -1255,7 +1331,7 @@ var GuildsAPI = class {
|
|
|
1255
1331
|
* @param options - The options for editing the widget settings
|
|
1256
1332
|
*/
|
|
1257
1333
|
async editWidgetSettings(guildId, body, { reason, signal } = {}) {
|
|
1258
|
-
return this.rest.patch(
|
|
1334
|
+
return this.rest.patch(import_v106.Routes.guildWidgetSettings(guildId), {
|
|
1259
1335
|
reason,
|
|
1260
1336
|
body,
|
|
1261
1337
|
signal
|
|
@@ -1269,7 +1345,7 @@ var GuildsAPI = class {
|
|
|
1269
1345
|
* @param options - The options for fetching the widget
|
|
1270
1346
|
*/
|
|
1271
1347
|
async getWidget(guildId, { signal } = {}) {
|
|
1272
|
-
return this.rest.get(
|
|
1348
|
+
return this.rest.get(import_v106.Routes.guildWidgetJSON(guildId), { signal });
|
|
1273
1349
|
}
|
|
1274
1350
|
/**
|
|
1275
1351
|
* Fetches the vanity url for a guild
|
|
@@ -1279,7 +1355,7 @@ var GuildsAPI = class {
|
|
|
1279
1355
|
* @param options - The options for fetching the vanity url
|
|
1280
1356
|
*/
|
|
1281
1357
|
async getVanityURL(guildId, { signal } = {}) {
|
|
1282
|
-
return this.rest.get(
|
|
1358
|
+
return this.rest.get(import_v106.Routes.guildVanityUrl(guildId), { signal });
|
|
1283
1359
|
}
|
|
1284
1360
|
/**
|
|
1285
1361
|
* Fetches the widget image for a guild
|
|
@@ -1290,7 +1366,7 @@ var GuildsAPI = class {
|
|
|
1290
1366
|
* @param options - The options for fetching the widget image
|
|
1291
1367
|
*/
|
|
1292
1368
|
async getWidgetImage(guildId, style, { signal } = {}) {
|
|
1293
|
-
return this.rest.get(
|
|
1369
|
+
return this.rest.get(import_v106.Routes.guildWidgetImage(guildId), {
|
|
1294
1370
|
query: (0, import_rest3.makeURLSearchParams)({ style }),
|
|
1295
1371
|
signal
|
|
1296
1372
|
});
|
|
@@ -1303,7 +1379,7 @@ var GuildsAPI = class {
|
|
|
1303
1379
|
* @param options - The options for fetching the welcome screen
|
|
1304
1380
|
*/
|
|
1305
1381
|
async getWelcomeScreen(guildId, { signal } = {}) {
|
|
1306
|
-
return this.rest.get(
|
|
1382
|
+
return this.rest.get(import_v106.Routes.guildWelcomeScreen(guildId), { signal });
|
|
1307
1383
|
}
|
|
1308
1384
|
/**
|
|
1309
1385
|
* Edits the welcome screen for a guild
|
|
@@ -1314,7 +1390,7 @@ var GuildsAPI = class {
|
|
|
1314
1390
|
* @param options - The options for editing the welcome screen
|
|
1315
1391
|
*/
|
|
1316
1392
|
async editWelcomeScreen(guildId, body, { reason, signal } = {}) {
|
|
1317
|
-
return this.rest.patch(
|
|
1393
|
+
return this.rest.patch(import_v106.Routes.guildWelcomeScreen(guildId), {
|
|
1318
1394
|
reason,
|
|
1319
1395
|
body,
|
|
1320
1396
|
signal
|
|
@@ -1341,7 +1417,7 @@ var GuildsAPI = class {
|
|
|
1341
1417
|
* @param options - The options for fetching the emojis
|
|
1342
1418
|
*/
|
|
1343
1419
|
async getEmojis(guildId, { signal } = {}) {
|
|
1344
|
-
return this.rest.get(
|
|
1420
|
+
return this.rest.get(import_v106.Routes.guildEmojis(guildId), { signal });
|
|
1345
1421
|
}
|
|
1346
1422
|
/**
|
|
1347
1423
|
* Fetches an emoji for a guild
|
|
@@ -1352,7 +1428,7 @@ var GuildsAPI = class {
|
|
|
1352
1428
|
* @param options - The options for fetching the emoji
|
|
1353
1429
|
*/
|
|
1354
1430
|
async getEmoji(guildId, emojiId, { signal } = {}) {
|
|
1355
|
-
return this.rest.get(
|
|
1431
|
+
return this.rest.get(import_v106.Routes.guildEmoji(guildId, emojiId), { signal });
|
|
1356
1432
|
}
|
|
1357
1433
|
/**
|
|
1358
1434
|
* Creates a new emoji for a guild
|
|
@@ -1363,7 +1439,7 @@ var GuildsAPI = class {
|
|
|
1363
1439
|
* @param options - The options for creating the emoji
|
|
1364
1440
|
*/
|
|
1365
1441
|
async createEmoji(guildId, body, { reason, signal } = {}) {
|
|
1366
|
-
return this.rest.post(
|
|
1442
|
+
return this.rest.post(import_v106.Routes.guildEmojis(guildId), {
|
|
1367
1443
|
reason,
|
|
1368
1444
|
body,
|
|
1369
1445
|
signal
|
|
@@ -1379,7 +1455,7 @@ var GuildsAPI = class {
|
|
|
1379
1455
|
* @param options - The options for editing the emoji
|
|
1380
1456
|
*/
|
|
1381
1457
|
async editEmoji(guildId, emojiId, body, { reason, signal } = {}) {
|
|
1382
|
-
return this.rest.patch(
|
|
1458
|
+
return this.rest.patch(import_v106.Routes.guildEmoji(guildId, emojiId), {
|
|
1383
1459
|
reason,
|
|
1384
1460
|
body,
|
|
1385
1461
|
signal
|
|
@@ -1394,7 +1470,7 @@ var GuildsAPI = class {
|
|
|
1394
1470
|
* @param options - The options for deleting the emoji
|
|
1395
1471
|
*/
|
|
1396
1472
|
async deleteEmoji(guildId, emojiId, { reason, signal } = {}) {
|
|
1397
|
-
await this.rest.delete(
|
|
1473
|
+
await this.rest.delete(import_v106.Routes.guildEmoji(guildId, emojiId), { reason, signal });
|
|
1398
1474
|
}
|
|
1399
1475
|
/**
|
|
1400
1476
|
* Fetches all scheduled events for a guild
|
|
@@ -1405,7 +1481,7 @@ var GuildsAPI = class {
|
|
|
1405
1481
|
* @param options - The options for fetching the scheduled events
|
|
1406
1482
|
*/
|
|
1407
1483
|
async getScheduledEvents(guildId, query = {}, { signal } = {}) {
|
|
1408
|
-
return this.rest.get(
|
|
1484
|
+
return this.rest.get(import_v106.Routes.guildScheduledEvents(guildId), {
|
|
1409
1485
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1410
1486
|
signal
|
|
1411
1487
|
});
|
|
@@ -1419,7 +1495,7 @@ var GuildsAPI = class {
|
|
|
1419
1495
|
* @param options - The options for creating the scheduled event
|
|
1420
1496
|
*/
|
|
1421
1497
|
async createScheduledEvent(guildId, body, { reason, signal } = {}) {
|
|
1422
|
-
return this.rest.post(
|
|
1498
|
+
return this.rest.post(import_v106.Routes.guildScheduledEvents(guildId), {
|
|
1423
1499
|
reason,
|
|
1424
1500
|
body,
|
|
1425
1501
|
signal
|
|
@@ -1435,7 +1511,7 @@ var GuildsAPI = class {
|
|
|
1435
1511
|
* @param options - The options for fetching the scheduled event
|
|
1436
1512
|
*/
|
|
1437
1513
|
async getScheduledEvent(guildId, eventId, query = {}, { signal } = {}) {
|
|
1438
|
-
return this.rest.get(
|
|
1514
|
+
return this.rest.get(import_v106.Routes.guildScheduledEvent(guildId, eventId), {
|
|
1439
1515
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1440
1516
|
signal
|
|
1441
1517
|
});
|
|
@@ -1450,7 +1526,7 @@ var GuildsAPI = class {
|
|
|
1450
1526
|
* @param options - The options for editing the scheduled event
|
|
1451
1527
|
*/
|
|
1452
1528
|
async editScheduledEvent(guildId, eventId, body, { reason, signal } = {}) {
|
|
1453
|
-
return this.rest.patch(
|
|
1529
|
+
return this.rest.patch(import_v106.Routes.guildScheduledEvent(guildId, eventId), {
|
|
1454
1530
|
reason,
|
|
1455
1531
|
body,
|
|
1456
1532
|
signal
|
|
@@ -1465,7 +1541,7 @@ var GuildsAPI = class {
|
|
|
1465
1541
|
* @param options - The options for deleting the scheduled event
|
|
1466
1542
|
*/
|
|
1467
1543
|
async deleteScheduledEvent(guildId, eventId, { reason, signal } = {}) {
|
|
1468
|
-
await this.rest.delete(
|
|
1544
|
+
await this.rest.delete(import_v106.Routes.guildScheduledEvent(guildId, eventId), { reason, signal });
|
|
1469
1545
|
}
|
|
1470
1546
|
/**
|
|
1471
1547
|
* Gets all users that are interested in a scheduled event
|
|
@@ -1477,7 +1553,7 @@ var GuildsAPI = class {
|
|
|
1477
1553
|
* @param options - The options for fetching the scheduled event users
|
|
1478
1554
|
*/
|
|
1479
1555
|
async getScheduledEventUsers(guildId, eventId, query = {}, { signal } = {}) {
|
|
1480
|
-
return this.rest.get(
|
|
1556
|
+
return this.rest.get(import_v106.Routes.guildScheduledEventUsers(guildId, eventId), {
|
|
1481
1557
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1482
1558
|
signal
|
|
1483
1559
|
});
|
|
@@ -1490,7 +1566,7 @@ var GuildsAPI = class {
|
|
|
1490
1566
|
* @param options - The options for fetching the templates
|
|
1491
1567
|
*/
|
|
1492
1568
|
async getTemplates(guildId, { signal } = {}) {
|
|
1493
|
-
return this.rest.get(
|
|
1569
|
+
return this.rest.get(import_v106.Routes.guildTemplates(guildId), { signal });
|
|
1494
1570
|
}
|
|
1495
1571
|
/**
|
|
1496
1572
|
* Syncs a template for a guild
|
|
@@ -1501,7 +1577,7 @@ var GuildsAPI = class {
|
|
|
1501
1577
|
* @param options - The options for syncing the template
|
|
1502
1578
|
*/
|
|
1503
1579
|
async syncTemplate(guildId, templateCode, { signal } = {}) {
|
|
1504
|
-
return this.rest.put(
|
|
1580
|
+
return this.rest.put(import_v106.Routes.guildTemplate(guildId, templateCode), {
|
|
1505
1581
|
signal
|
|
1506
1582
|
});
|
|
1507
1583
|
}
|
|
@@ -1515,7 +1591,7 @@ var GuildsAPI = class {
|
|
|
1515
1591
|
* @param options - The options for editing the template
|
|
1516
1592
|
*/
|
|
1517
1593
|
async editTemplate(guildId, templateCode, body, { signal } = {}) {
|
|
1518
|
-
return this.rest.patch(
|
|
1594
|
+
return this.rest.patch(import_v106.Routes.guildTemplate(guildId, templateCode), {
|
|
1519
1595
|
body,
|
|
1520
1596
|
signal
|
|
1521
1597
|
});
|
|
@@ -1529,7 +1605,7 @@ var GuildsAPI = class {
|
|
|
1529
1605
|
* @param options - The options for deleting the template
|
|
1530
1606
|
*/
|
|
1531
1607
|
async deleteTemplate(guildId, templateCode, { signal } = {}) {
|
|
1532
|
-
await this.rest.delete(
|
|
1608
|
+
await this.rest.delete(import_v106.Routes.guildTemplate(guildId, templateCode), { signal });
|
|
1533
1609
|
}
|
|
1534
1610
|
/**
|
|
1535
1611
|
* Fetches all the stickers for a guild
|
|
@@ -1539,7 +1615,7 @@ var GuildsAPI = class {
|
|
|
1539
1615
|
* @param options - The options for fetching the stickers
|
|
1540
1616
|
*/
|
|
1541
1617
|
async getStickers(guildId, { signal } = {}) {
|
|
1542
|
-
return this.rest.get(
|
|
1618
|
+
return this.rest.get(import_v106.Routes.guildStickers(guildId), { signal });
|
|
1543
1619
|
}
|
|
1544
1620
|
/**
|
|
1545
1621
|
* Fetches a sticker for a guild
|
|
@@ -1550,7 +1626,7 @@ var GuildsAPI = class {
|
|
|
1550
1626
|
* @param options - The options for fetching the sticker
|
|
1551
1627
|
*/
|
|
1552
1628
|
async getSticker(guildId, stickerId, { signal } = {}) {
|
|
1553
|
-
return this.rest.get(
|
|
1629
|
+
return this.rest.get(import_v106.Routes.guildSticker(guildId, stickerId), { signal });
|
|
1554
1630
|
}
|
|
1555
1631
|
/**
|
|
1556
1632
|
* Creates a sticker for a guild
|
|
@@ -1562,7 +1638,7 @@ var GuildsAPI = class {
|
|
|
1562
1638
|
*/
|
|
1563
1639
|
async createSticker(guildId, { file, ...body }, { reason, signal } = {}) {
|
|
1564
1640
|
const fileData = { ...file, key: "file" };
|
|
1565
|
-
return this.rest.post(
|
|
1641
|
+
return this.rest.post(import_v106.Routes.guildStickers(guildId), {
|
|
1566
1642
|
appendToFormData: true,
|
|
1567
1643
|
body,
|
|
1568
1644
|
files: [fileData],
|
|
@@ -1580,7 +1656,7 @@ var GuildsAPI = class {
|
|
|
1580
1656
|
* @param options - The options for editing the sticker
|
|
1581
1657
|
*/
|
|
1582
1658
|
async editSticker(guildId, stickerId, body, { reason, signal } = {}) {
|
|
1583
|
-
return this.rest.patch(
|
|
1659
|
+
return this.rest.patch(import_v106.Routes.guildSticker(guildId, stickerId), {
|
|
1584
1660
|
reason,
|
|
1585
1661
|
body,
|
|
1586
1662
|
signal
|
|
@@ -1595,7 +1671,7 @@ var GuildsAPI = class {
|
|
|
1595
1671
|
* @param options - The options for deleting the sticker
|
|
1596
1672
|
*/
|
|
1597
1673
|
async deleteSticker(guildId, stickerId, { reason, signal } = {}) {
|
|
1598
|
-
await this.rest.delete(
|
|
1674
|
+
await this.rest.delete(import_v106.Routes.guildSticker(guildId, stickerId), { reason, signal });
|
|
1599
1675
|
}
|
|
1600
1676
|
/**
|
|
1601
1677
|
* Fetches the audit logs for a guild
|
|
@@ -1606,7 +1682,7 @@ var GuildsAPI = class {
|
|
|
1606
1682
|
* @param options - The options for fetching the audit logs
|
|
1607
1683
|
*/
|
|
1608
1684
|
async getAuditLogs(guildId, query = {}, { signal } = {}) {
|
|
1609
|
-
return this.rest.get(
|
|
1685
|
+
return this.rest.get(import_v106.Routes.guildAuditLog(guildId), {
|
|
1610
1686
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1611
1687
|
signal
|
|
1612
1688
|
});
|
|
@@ -1619,7 +1695,7 @@ var GuildsAPI = class {
|
|
|
1619
1695
|
* @param options - The options for fetching the auto moderation rules
|
|
1620
1696
|
*/
|
|
1621
1697
|
async getAutoModerationRules(guildId, { signal } = {}) {
|
|
1622
|
-
return this.rest.get(
|
|
1698
|
+
return this.rest.get(import_v106.Routes.guildAutoModerationRules(guildId), {
|
|
1623
1699
|
signal
|
|
1624
1700
|
});
|
|
1625
1701
|
}
|
|
@@ -1632,7 +1708,7 @@ var GuildsAPI = class {
|
|
|
1632
1708
|
* @param options - The options for fetching the auto moderation rule
|
|
1633
1709
|
*/
|
|
1634
1710
|
async getAutoModerationRule(guildId, ruleId, { signal } = {}) {
|
|
1635
|
-
return this.rest.get(
|
|
1711
|
+
return this.rest.get(import_v106.Routes.guildAutoModerationRule(guildId, ruleId), {
|
|
1636
1712
|
signal
|
|
1637
1713
|
});
|
|
1638
1714
|
}
|
|
@@ -1645,7 +1721,7 @@ var GuildsAPI = class {
|
|
|
1645
1721
|
* @param options - The options for creating the auto moderation rule
|
|
1646
1722
|
*/
|
|
1647
1723
|
async createAutoModerationRule(guildId, body, { reason, signal } = {}) {
|
|
1648
|
-
return this.rest.post(
|
|
1724
|
+
return this.rest.post(import_v106.Routes.guildAutoModerationRules(guildId), {
|
|
1649
1725
|
reason,
|
|
1650
1726
|
body,
|
|
1651
1727
|
signal
|
|
@@ -1661,7 +1737,7 @@ var GuildsAPI = class {
|
|
|
1661
1737
|
* @param options - The options for editing the auto moderation rule
|
|
1662
1738
|
*/
|
|
1663
1739
|
async editAutoModerationRule(guildId, ruleId, body, { reason, signal } = {}) {
|
|
1664
|
-
return this.rest.patch(
|
|
1740
|
+
return this.rest.patch(import_v106.Routes.guildAutoModerationRule(guildId, ruleId), {
|
|
1665
1741
|
reason,
|
|
1666
1742
|
body,
|
|
1667
1743
|
signal
|
|
@@ -1676,7 +1752,7 @@ var GuildsAPI = class {
|
|
|
1676
1752
|
* @param options - The options for deleting the auto moderation rule
|
|
1677
1753
|
*/
|
|
1678
1754
|
async deleteAutoModerationRule(guildId, ruleId, { reason, signal } = {}) {
|
|
1679
|
-
await this.rest.delete(
|
|
1755
|
+
await this.rest.delete(import_v106.Routes.guildAutoModerationRule(guildId, ruleId), { reason, signal });
|
|
1680
1756
|
}
|
|
1681
1757
|
/**
|
|
1682
1758
|
* Fetches a guild member
|
|
@@ -1687,7 +1763,7 @@ var GuildsAPI = class {
|
|
|
1687
1763
|
* @param options - The options for fetching the guild member
|
|
1688
1764
|
*/
|
|
1689
1765
|
async getMember(guildId, userId, { signal } = {}) {
|
|
1690
|
-
return this.rest.get(
|
|
1766
|
+
return this.rest.get(import_v106.Routes.guildMember(guildId, userId), { signal });
|
|
1691
1767
|
}
|
|
1692
1768
|
/**
|
|
1693
1769
|
* Searches for guild members
|
|
@@ -1698,7 +1774,7 @@ var GuildsAPI = class {
|
|
|
1698
1774
|
* @param options - The options for searching for guild members
|
|
1699
1775
|
*/
|
|
1700
1776
|
async searchForMembers(guildId, query, { signal } = {}) {
|
|
1701
|
-
return this.rest.get(
|
|
1777
|
+
return this.rest.get(import_v106.Routes.guildMembersSearch(guildId), {
|
|
1702
1778
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1703
1779
|
signal
|
|
1704
1780
|
});
|
|
@@ -1713,7 +1789,7 @@ var GuildsAPI = class {
|
|
|
1713
1789
|
* @param options - The options for editing the guild member
|
|
1714
1790
|
*/
|
|
1715
1791
|
async editMember(guildId, userId, body = {}, { reason, signal } = {}) {
|
|
1716
|
-
return this.rest.patch(
|
|
1792
|
+
return this.rest.patch(import_v106.Routes.guildMember(guildId, userId), {
|
|
1717
1793
|
reason,
|
|
1718
1794
|
body,
|
|
1719
1795
|
signal
|
|
@@ -1728,7 +1804,7 @@ var GuildsAPI = class {
|
|
|
1728
1804
|
* @param options - The options for removing the guild member
|
|
1729
1805
|
*/
|
|
1730
1806
|
async removeMember(guildId, userId, { reason, signal } = {}) {
|
|
1731
|
-
return this.rest.delete(
|
|
1807
|
+
return this.rest.delete(import_v106.Routes.guildMember(guildId, userId), { reason, signal });
|
|
1732
1808
|
}
|
|
1733
1809
|
/**
|
|
1734
1810
|
* Adds a role to a guild member
|
|
@@ -1740,7 +1816,7 @@ var GuildsAPI = class {
|
|
|
1740
1816
|
* @param options - The options for adding a role to a guild member
|
|
1741
1817
|
*/
|
|
1742
1818
|
async addRoleToMember(guildId, userId, roleId, { reason, signal } = {}) {
|
|
1743
|
-
await this.rest.put(
|
|
1819
|
+
await this.rest.put(import_v106.Routes.guildMemberRole(guildId, userId, roleId), { reason, signal });
|
|
1744
1820
|
}
|
|
1745
1821
|
/**
|
|
1746
1822
|
* Removes a role from a guild member
|
|
@@ -1752,7 +1828,7 @@ var GuildsAPI = class {
|
|
|
1752
1828
|
* @param options - The options for removing a role from a guild member
|
|
1753
1829
|
*/
|
|
1754
1830
|
async removeRoleFromMember(guildId, userId, roleId, { reason, signal } = {}) {
|
|
1755
|
-
await this.rest.delete(
|
|
1831
|
+
await this.rest.delete(import_v106.Routes.guildMemberRole(guildId, userId, roleId), { reason, signal });
|
|
1756
1832
|
}
|
|
1757
1833
|
/**
|
|
1758
1834
|
* Fetches a guild template
|
|
@@ -1762,7 +1838,7 @@ var GuildsAPI = class {
|
|
|
1762
1838
|
* @param options - The options for fetching the guild template
|
|
1763
1839
|
*/
|
|
1764
1840
|
async getTemplate(templateCode, { signal } = {}) {
|
|
1765
|
-
return this.rest.get(
|
|
1841
|
+
return this.rest.get(import_v106.Routes.template(templateCode), { signal });
|
|
1766
1842
|
}
|
|
1767
1843
|
/**
|
|
1768
1844
|
* Creates a new template
|
|
@@ -1773,7 +1849,7 @@ var GuildsAPI = class {
|
|
|
1773
1849
|
* @param options - The options for creating the template
|
|
1774
1850
|
*/
|
|
1775
1851
|
async createTemplate(guildId, body, { signal } = {}) {
|
|
1776
|
-
return this.rest.post(
|
|
1852
|
+
return this.rest.post(import_v106.Routes.guildTemplates(guildId), { body, signal });
|
|
1777
1853
|
}
|
|
1778
1854
|
/**
|
|
1779
1855
|
* Fetches webhooks for a guild
|
|
@@ -1782,7 +1858,7 @@ var GuildsAPI = class {
|
|
|
1782
1858
|
* @param id - The id of the guild
|
|
1783
1859
|
*/
|
|
1784
1860
|
async getWebhooks(id) {
|
|
1785
|
-
return this.rest.get(
|
|
1861
|
+
return this.rest.get(import_v106.Routes.guildWebhooks(id));
|
|
1786
1862
|
}
|
|
1787
1863
|
/**
|
|
1788
1864
|
* Sets the voice state for the current user
|
|
@@ -1804,7 +1880,7 @@ var GuildsAPI = class {
|
|
|
1804
1880
|
* @param options - The options for fetching the guild onboarding
|
|
1805
1881
|
*/
|
|
1806
1882
|
async getOnboarding(guildId, { signal } = {}) {
|
|
1807
|
-
return this.rest.get(
|
|
1883
|
+
return this.rest.get(import_v106.Routes.guildOnboarding(guildId), { signal });
|
|
1808
1884
|
}
|
|
1809
1885
|
/**
|
|
1810
1886
|
* Edits a guild onboarding
|
|
@@ -1815,16 +1891,98 @@ var GuildsAPI = class {
|
|
|
1815
1891
|
* @param options - The options for editing the guild onboarding
|
|
1816
1892
|
*/
|
|
1817
1893
|
async editOnboarding(guildId, body, { reason, signal } = {}) {
|
|
1818
|
-
return this.rest.put(
|
|
1894
|
+
return this.rest.put(import_v106.Routes.guildOnboarding(guildId), {
|
|
1819
1895
|
reason,
|
|
1820
1896
|
body,
|
|
1821
1897
|
signal
|
|
1822
1898
|
});
|
|
1823
1899
|
}
|
|
1900
|
+
/**
|
|
1901
|
+
* Fetches all the soundboard sounds for a guild
|
|
1902
|
+
*
|
|
1903
|
+
* @see {@link https://discord.com/developers/docs/resources/soundboard#list-guild-soundboard-sounds}
|
|
1904
|
+
* @param guildId - The id of the guild to fetch the soundboard sounds for
|
|
1905
|
+
* @param options - The options for fetching the soundboard sounds
|
|
1906
|
+
*/
|
|
1907
|
+
async getSoundboardSounds(guildId, { signal } = {}) {
|
|
1908
|
+
return this.rest.get(import_v106.Routes.guildSoundboardSounds(guildId), {
|
|
1909
|
+
signal
|
|
1910
|
+
});
|
|
1911
|
+
}
|
|
1912
|
+
/**
|
|
1913
|
+
* Fetches a soundboard sound for a guild
|
|
1914
|
+
*
|
|
1915
|
+
* @see {@link https://discord.com/developers/docs/resources/soundboard#get-guild-soundboard-sound}
|
|
1916
|
+
* @param guildId - The id of the guild to fetch the soundboard sound for
|
|
1917
|
+
* @param soundId - The id of the soundboard sound to fetch
|
|
1918
|
+
* @param options - The options for fetching the soundboard sound
|
|
1919
|
+
*/
|
|
1920
|
+
async getSoundboardSound(guildId, soundId, { signal } = {}) {
|
|
1921
|
+
return this.rest.get(import_v106.Routes.guildSoundboardSound(guildId, soundId), {
|
|
1922
|
+
signal
|
|
1923
|
+
});
|
|
1924
|
+
}
|
|
1925
|
+
/**
|
|
1926
|
+
* Creates a new soundboard sound for a guild
|
|
1927
|
+
*
|
|
1928
|
+
* @see {@link https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound}
|
|
1929
|
+
* @param guildId - The id of the guild to create the soundboard sound for
|
|
1930
|
+
* @param body - The data for creating the soundboard sound
|
|
1931
|
+
* @param options - The options for creating the soundboard sound
|
|
1932
|
+
*/
|
|
1933
|
+
async createSoundboardSound(guildId, body, { reason, signal } = {}) {
|
|
1934
|
+
return this.rest.post(import_v106.Routes.guildSoundboardSounds(guildId), {
|
|
1935
|
+
body,
|
|
1936
|
+
reason,
|
|
1937
|
+
signal
|
|
1938
|
+
});
|
|
1939
|
+
}
|
|
1940
|
+
/**
|
|
1941
|
+
* Edits a soundboard sound for a guild
|
|
1942
|
+
*
|
|
1943
|
+
* @see {@link https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound}
|
|
1944
|
+
* @param guildId - The id of the guild to edit the soundboard sound for
|
|
1945
|
+
* @param soundId - The id of the soundboard sound to edit
|
|
1946
|
+
* @param body - The data for editing the soundboard sound
|
|
1947
|
+
* @param options - The options for editing the soundboard sound
|
|
1948
|
+
*/
|
|
1949
|
+
async editSoundboardSound(guildId, soundId, body, { reason, signal } = {}) {
|
|
1950
|
+
return this.rest.patch(import_v106.Routes.guildSoundboardSound(guildId, soundId), {
|
|
1951
|
+
body,
|
|
1952
|
+
reason,
|
|
1953
|
+
signal
|
|
1954
|
+
});
|
|
1955
|
+
}
|
|
1956
|
+
/**
|
|
1957
|
+
* Deletes a soundboard sound for a guild
|
|
1958
|
+
*
|
|
1959
|
+
* @see {@link https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound}
|
|
1960
|
+
* @param guildId - The id of the guild to delete the soundboard sound for
|
|
1961
|
+
* @param soundId - The id of the soundboard sound to delete
|
|
1962
|
+
* @param options - The options for deleting the soundboard sound
|
|
1963
|
+
*/
|
|
1964
|
+
async deleteSoundboardSound(guildId, soundId, { reason, signal } = {}) {
|
|
1965
|
+
await this.rest.delete(import_v106.Routes.guildSoundboardSound(guildId, soundId), { reason, signal });
|
|
1966
|
+
}
|
|
1967
|
+
/**
|
|
1968
|
+
* Modifies incident actions for a guild.
|
|
1969
|
+
*
|
|
1970
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-incident-actions}
|
|
1971
|
+
* @param guildId - The id of the guild
|
|
1972
|
+
* @param body - The data for modifying guild incident actions
|
|
1973
|
+
* @param options - The options for modifying guild incident actions
|
|
1974
|
+
*/
|
|
1975
|
+
async editIncidentActions(guildId, body, { signal } = {}) {
|
|
1976
|
+
return this.rest.put(import_v106.Routes.guildIncidentActions(guildId), {
|
|
1977
|
+
body,
|
|
1978
|
+
signal
|
|
1979
|
+
});
|
|
1980
|
+
}
|
|
1824
1981
|
};
|
|
1825
1982
|
|
|
1826
1983
|
// src/api/interactions.ts
|
|
1827
|
-
var
|
|
1984
|
+
var import_rest4 = require("@discordjs/rest");
|
|
1985
|
+
var import_v107 = require("discord-api-types/v10");
|
|
1828
1986
|
var InteractionsAPI = class {
|
|
1829
1987
|
constructor(rest, webhooks) {
|
|
1830
1988
|
this.rest = rest;
|
|
@@ -1833,61 +1991,41 @@ var InteractionsAPI = class {
|
|
|
1833
1991
|
static {
|
|
1834
1992
|
__name(this, "InteractionsAPI");
|
|
1835
1993
|
}
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1840
|
-
* @param interactionId - The id of the interaction
|
|
1841
|
-
* @param interactionToken - The token of the interaction
|
|
1842
|
-
* @param body - The callback data for replying
|
|
1843
|
-
* @param options - The options for replying
|
|
1844
|
-
*/
|
|
1845
|
-
async reply(interactionId, interactionToken, { files, ...data }, { signal } = {}) {
|
|
1846
|
-
await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1994
|
+
async reply(interactionId, interactionToken, { files, with_response, ...data }, { signal } = {}) {
|
|
1995
|
+
const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1996
|
+
query: (0, import_rest4.makeURLSearchParams)({ with_response }),
|
|
1847
1997
|
files,
|
|
1848
1998
|
auth: false,
|
|
1849
1999
|
body: {
|
|
1850
|
-
type:
|
|
2000
|
+
type: import_v107.InteractionResponseType.ChannelMessageWithSource,
|
|
1851
2001
|
data
|
|
1852
2002
|
},
|
|
1853
2003
|
signal
|
|
1854
2004
|
});
|
|
2005
|
+
return with_response ? response : void 0;
|
|
1855
2006
|
}
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1860
|
-
* @param interactionId - The id of the interaction
|
|
1861
|
-
* @param interactionToken - The token of the interaction
|
|
1862
|
-
* @param data - The data for deferring the reply
|
|
1863
|
-
* @param options - The options for deferring
|
|
1864
|
-
*/
|
|
1865
|
-
async defer(interactionId, interactionToken, data, { signal } = {}) {
|
|
1866
|
-
await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
|
|
2007
|
+
async defer(interactionId, interactionToken, { with_response, ...data } = {}, { signal } = {}) {
|
|
2008
|
+
const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
|
|
2009
|
+
query: (0, import_rest4.makeURLSearchParams)({ with_response }),
|
|
1867
2010
|
auth: false,
|
|
1868
2011
|
body: {
|
|
1869
|
-
type:
|
|
2012
|
+
type: import_v107.InteractionResponseType.DeferredChannelMessageWithSource,
|
|
1870
2013
|
data
|
|
1871
2014
|
},
|
|
1872
2015
|
signal
|
|
1873
2016
|
});
|
|
2017
|
+
return with_response ? response : void 0;
|
|
1874
2018
|
}
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1879
|
-
* @param interactionId - The id of the interaction
|
|
1880
|
-
* @param interactionToken - The token of the interaction
|
|
1881
|
-
* @param options - The options for deferring
|
|
1882
|
-
*/
|
|
1883
|
-
async deferMessageUpdate(interactionId, interactionToken, { signal } = {}) {
|
|
1884
|
-
await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
|
|
2019
|
+
async deferMessageUpdate(interactionId, interactionToken, { with_response } = {}, { signal } = {}) {
|
|
2020
|
+
const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
|
|
2021
|
+
query: (0, import_rest4.makeURLSearchParams)({ with_response }),
|
|
1885
2022
|
auth: false,
|
|
1886
2023
|
body: {
|
|
1887
|
-
type:
|
|
2024
|
+
type: import_v107.InteractionResponseType.DeferredMessageUpdate
|
|
1888
2025
|
},
|
|
1889
2026
|
signal
|
|
1890
2027
|
});
|
|
2028
|
+
return with_response ? response : void 0;
|
|
1891
2029
|
}
|
|
1892
2030
|
/**
|
|
1893
2031
|
* Reply to a deferred interaction
|
|
@@ -1947,66 +2085,45 @@ var InteractionsAPI = class {
|
|
|
1947
2085
|
async deleteReply(applicationId, interactionToken, messageId, { signal } = {}) {
|
|
1948
2086
|
await this.webhooks.deleteMessage(applicationId, interactionToken, messageId ?? "@original", {}, { signal });
|
|
1949
2087
|
}
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1954
|
-
* @param interactionId - The id of the interaction
|
|
1955
|
-
* @param interactionToken - The token of the interaction
|
|
1956
|
-
* @param callbackData - The callback data for updating the interaction
|
|
1957
|
-
* @param options - The options for updating the interaction
|
|
1958
|
-
*/
|
|
1959
|
-
async updateMessage(interactionId, interactionToken, { files, ...data }, { signal } = {}) {
|
|
1960
|
-
await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
|
|
2088
|
+
async updateMessage(interactionId, interactionToken, { files, with_response, ...data }, { signal } = {}) {
|
|
2089
|
+
const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
|
|
2090
|
+
query: (0, import_rest4.makeURLSearchParams)({ with_response }),
|
|
1961
2091
|
files,
|
|
1962
2092
|
auth: false,
|
|
1963
2093
|
body: {
|
|
1964
|
-
type:
|
|
2094
|
+
type: import_v107.InteractionResponseType.UpdateMessage,
|
|
1965
2095
|
data
|
|
1966
2096
|
},
|
|
1967
2097
|
signal
|
|
1968
2098
|
});
|
|
2099
|
+
return with_response ? response : void 0;
|
|
1969
2100
|
}
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1974
|
-
* @param interactionId - The id of the interaction
|
|
1975
|
-
* @param interactionToken - The token of the interaction
|
|
1976
|
-
* @param callbackData - The callback data for the autocomplete response
|
|
1977
|
-
* @param options - The options for sending the autocomplete response
|
|
1978
|
-
*/
|
|
1979
|
-
async createAutocompleteResponse(interactionId, interactionToken, callbackData, { signal } = {}) {
|
|
1980
|
-
await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
|
|
2101
|
+
async createAutocompleteResponse(interactionId, interactionToken, { with_response, ...data }, { signal } = {}) {
|
|
2102
|
+
const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
|
|
2103
|
+
query: (0, import_rest4.makeURLSearchParams)({ with_response }),
|
|
1981
2104
|
auth: false,
|
|
1982
2105
|
body: {
|
|
1983
|
-
type:
|
|
1984
|
-
data
|
|
2106
|
+
type: import_v107.InteractionResponseType.ApplicationCommandAutocompleteResult,
|
|
2107
|
+
data
|
|
1985
2108
|
},
|
|
1986
2109
|
signal
|
|
1987
2110
|
});
|
|
2111
|
+
return with_response ? response : void 0;
|
|
1988
2112
|
}
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1993
|
-
* @param interactionId - The id of the interaction
|
|
1994
|
-
* @param interactionToken - The token of the interaction
|
|
1995
|
-
* @param callbackData - The modal callback data to send
|
|
1996
|
-
* @param options - The options for sending the modal
|
|
1997
|
-
*/
|
|
1998
|
-
async createModal(interactionId, interactionToken, callbackData, { signal } = {}) {
|
|
1999
|
-
await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
|
|
2113
|
+
async createModal(interactionId, interactionToken, { with_response, ...data }, { signal } = {}) {
|
|
2114
|
+
const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
|
|
2115
|
+
query: (0, import_rest4.makeURLSearchParams)({ with_response }),
|
|
2000
2116
|
auth: false,
|
|
2001
2117
|
body: {
|
|
2002
|
-
type:
|
|
2003
|
-
data
|
|
2118
|
+
type: import_v107.InteractionResponseType.Modal,
|
|
2119
|
+
data
|
|
2004
2120
|
},
|
|
2005
2121
|
signal
|
|
2006
2122
|
});
|
|
2123
|
+
return with_response ? response : void 0;
|
|
2007
2124
|
}
|
|
2008
2125
|
/**
|
|
2009
|
-
*
|
|
2126
|
+
* Launches an activity and returns an interaction callback object
|
|
2010
2127
|
*
|
|
2011
2128
|
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
2012
2129
|
* @param interactionId - The id of the interaction
|
|
@@ -2015,19 +2132,30 @@ var InteractionsAPI = class {
|
|
|
2015
2132
|
* @deprecated Sending a premium-style button is the new Discord behavior.
|
|
2016
2133
|
*/
|
|
2017
2134
|
async sendPremiumRequired(interactionId, interactionToken, { signal } = {}) {
|
|
2018
|
-
await this.rest.post(
|
|
2135
|
+
await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
|
|
2019
2136
|
auth: false,
|
|
2020
2137
|
body: {
|
|
2021
|
-
type:
|
|
2138
|
+
type: import_v107.InteractionResponseType.PremiumRequired
|
|
2022
2139
|
},
|
|
2023
2140
|
signal
|
|
2024
2141
|
});
|
|
2025
2142
|
}
|
|
2143
|
+
async launchActivity(interactionId, interactionToken, { with_response } = {}, { signal } = {}) {
|
|
2144
|
+
const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
|
|
2145
|
+
query: (0, import_rest4.makeURLSearchParams)({ with_response }),
|
|
2146
|
+
auth: false,
|
|
2147
|
+
body: {
|
|
2148
|
+
type: import_v107.InteractionResponseType.LaunchActivity
|
|
2149
|
+
},
|
|
2150
|
+
signal
|
|
2151
|
+
});
|
|
2152
|
+
return with_response ? response : void 0;
|
|
2153
|
+
}
|
|
2026
2154
|
};
|
|
2027
2155
|
|
|
2028
2156
|
// src/api/invite.ts
|
|
2029
|
-
var
|
|
2030
|
-
var
|
|
2157
|
+
var import_rest5 = require("@discordjs/rest");
|
|
2158
|
+
var import_v108 = require("discord-api-types/v10");
|
|
2031
2159
|
var InvitesAPI = class {
|
|
2032
2160
|
constructor(rest) {
|
|
2033
2161
|
this.rest = rest;
|
|
@@ -2044,8 +2172,8 @@ var InvitesAPI = class {
|
|
|
2044
2172
|
* @param options - The options for fetching the invite
|
|
2045
2173
|
*/
|
|
2046
2174
|
async get(code, query = {}, { signal } = {}) {
|
|
2047
|
-
return this.rest.get(
|
|
2048
|
-
query: (0,
|
|
2175
|
+
return this.rest.get(import_v108.Routes.invite(code), {
|
|
2176
|
+
query: (0, import_rest5.makeURLSearchParams)(query),
|
|
2049
2177
|
signal
|
|
2050
2178
|
});
|
|
2051
2179
|
}
|
|
@@ -2057,13 +2185,13 @@ var InvitesAPI = class {
|
|
|
2057
2185
|
* @param options - The options for deleting the invite
|
|
2058
2186
|
*/
|
|
2059
2187
|
async delete(code, { reason, signal } = {}) {
|
|
2060
|
-
await this.rest.delete(
|
|
2188
|
+
await this.rest.delete(import_v108.Routes.invite(code), { reason, signal });
|
|
2061
2189
|
}
|
|
2062
2190
|
};
|
|
2063
2191
|
|
|
2064
2192
|
// src/api/monetization.ts
|
|
2065
|
-
var
|
|
2066
|
-
var
|
|
2193
|
+
var import_rest6 = require("@discordjs/rest");
|
|
2194
|
+
var import_v109 = require("discord-api-types/v10");
|
|
2067
2195
|
var MonetizationAPI = class {
|
|
2068
2196
|
constructor(rest) {
|
|
2069
2197
|
this.rest = rest;
|
|
@@ -2074,36 +2202,77 @@ var MonetizationAPI = class {
|
|
|
2074
2202
|
/**
|
|
2075
2203
|
* Fetches the SKUs for an application.
|
|
2076
2204
|
*
|
|
2077
|
-
* @see {@link https://discord.com/developers/docs/
|
|
2205
|
+
* @see {@link https://discord.com/developers/docs/resources/sku#list-skus}
|
|
2206
|
+
* @param applicationId - The application id to fetch SKUs for
|
|
2078
2207
|
* @param options - The options for fetching the SKUs.
|
|
2079
2208
|
*/
|
|
2080
2209
|
async getSKUs(applicationId, { signal } = {}) {
|
|
2081
|
-
return this.rest.get(
|
|
2210
|
+
return this.rest.get(import_v109.Routes.skus(applicationId), { signal });
|
|
2211
|
+
}
|
|
2212
|
+
/**
|
|
2213
|
+
* Fetches subscriptions for an SKU.
|
|
2214
|
+
*
|
|
2215
|
+
* @see {@link https://discord.com/developers/docs/resources/subscription#list-sku-subscriptions}
|
|
2216
|
+
* @param skuId - The SKU id to fetch subscriptions for
|
|
2217
|
+
* @param query - The query options for fetching subscriptions
|
|
2218
|
+
* @param options - The options for fetching subscriptions
|
|
2219
|
+
*/
|
|
2220
|
+
async getSKUSubscriptions(skuId, query = {}, { signal } = {}) {
|
|
2221
|
+
return this.rest.get(import_v109.Routes.skuSubscriptions(skuId), {
|
|
2222
|
+
signal,
|
|
2223
|
+
query: (0, import_rest6.makeURLSearchParams)(query)
|
|
2224
|
+
});
|
|
2225
|
+
}
|
|
2226
|
+
/**
|
|
2227
|
+
* Fetches a subscription for an SKU.
|
|
2228
|
+
*
|
|
2229
|
+
* @see {@link https://discord.com/developers/docs/resources/subscription#get-sku-subscription}
|
|
2230
|
+
* @param skuId - The SKU id to fetch subscription for
|
|
2231
|
+
* @param subscriptionId - The subscription id to fetch
|
|
2232
|
+
* @param options - The options for fetching the subscription
|
|
2233
|
+
*/
|
|
2234
|
+
async getSKUSubscription(skuId, subscriptionId, { signal } = {}) {
|
|
2235
|
+
return this.rest.get(import_v109.Routes.skuSubscription(skuId, subscriptionId), {
|
|
2236
|
+
signal
|
|
2237
|
+
});
|
|
2082
2238
|
}
|
|
2083
2239
|
/**
|
|
2084
2240
|
* Fetches the entitlements for an application.
|
|
2085
2241
|
*
|
|
2086
|
-
* @see {@link https://discord.com/developers/docs/
|
|
2242
|
+
* @see {@link https://discord.com/developers/docs/resources/entitlement#list-entitlements}
|
|
2087
2243
|
* @param applicationId - The application id to fetch entitlements for
|
|
2088
2244
|
* @param query - The query options for fetching entitlements
|
|
2089
2245
|
* @param options - The options for fetching entitlements
|
|
2090
2246
|
*/
|
|
2091
|
-
async getEntitlements(applicationId, query, { signal } = {}) {
|
|
2092
|
-
return this.rest.get(
|
|
2247
|
+
async getEntitlements(applicationId, query = {}, { signal } = {}) {
|
|
2248
|
+
return this.rest.get(import_v109.Routes.entitlements(applicationId), {
|
|
2093
2249
|
signal,
|
|
2094
|
-
query: (0,
|
|
2250
|
+
query: (0, import_rest6.makeURLSearchParams)(query)
|
|
2251
|
+
});
|
|
2252
|
+
}
|
|
2253
|
+
/**
|
|
2254
|
+
* Fetches an entitlement for an application.
|
|
2255
|
+
*
|
|
2256
|
+
* @see {@link https://discord.com/developers/docs/resources/entitlement#get-entitlement}
|
|
2257
|
+
* @param applicationId - The application id to fetch the entitlement for
|
|
2258
|
+
* @param entitlementId - The entitlement id to fetch
|
|
2259
|
+
* @param options - The options for fetching the entitlement
|
|
2260
|
+
*/
|
|
2261
|
+
async getEntitlement(applicationId, entitlementId, { signal } = {}) {
|
|
2262
|
+
return this.rest.get(import_v109.Routes.entitlement(applicationId, entitlementId), {
|
|
2263
|
+
signal
|
|
2095
2264
|
});
|
|
2096
2265
|
}
|
|
2097
2266
|
/**
|
|
2098
2267
|
* Creates a test entitlement for an application's SKU.
|
|
2099
2268
|
*
|
|
2100
|
-
* @see {@link https://discord.com/developers/docs/
|
|
2269
|
+
* @see {@link https://discord.com/developers/docs/resources/entitlement#create-test-entitlement}
|
|
2101
2270
|
* @param applicationId - The application id to create the entitlement for
|
|
2102
2271
|
* @param body - The data for creating the entitlement
|
|
2103
2272
|
* @param options - The options for creating the entitlement
|
|
2104
2273
|
*/
|
|
2105
2274
|
async createTestEntitlement(applicationId, body, { signal } = {}) {
|
|
2106
|
-
return this.rest.post(
|
|
2275
|
+
return this.rest.post(import_v109.Routes.entitlements(applicationId), {
|
|
2107
2276
|
body,
|
|
2108
2277
|
signal
|
|
2109
2278
|
});
|
|
@@ -2111,30 +2280,30 @@ var MonetizationAPI = class {
|
|
|
2111
2280
|
/**
|
|
2112
2281
|
* Deletes a test entitlement for an application's SKU.
|
|
2113
2282
|
*
|
|
2114
|
-
* @see {@link https://discord.com/developers/docs/
|
|
2283
|
+
* @see {@link https://discord.com/developers/docs/resources/entitlement#delete-test-entitlement}
|
|
2115
2284
|
* @param applicationId - The application id to delete the entitlement for
|
|
2116
2285
|
* @param entitlementId - The entitlement id to delete
|
|
2117
2286
|
* @param options - The options for deleting the entitlement
|
|
2118
2287
|
*/
|
|
2119
2288
|
async deleteTestEntitlement(applicationId, entitlementId, { signal } = {}) {
|
|
2120
|
-
await this.rest.delete(
|
|
2289
|
+
await this.rest.delete(import_v109.Routes.entitlement(applicationId, entitlementId), { signal });
|
|
2121
2290
|
}
|
|
2122
2291
|
/**
|
|
2123
2292
|
* Marks a given entitlement for the user as consumed. Only available for One-Time Purchase consumable SKUs.
|
|
2124
2293
|
*
|
|
2125
|
-
* @see {@link https://discord.com/developers/docs/
|
|
2294
|
+
* @see {@link https://discord.com/developers/docs/resources/entitlement#consume-an-entitlement}
|
|
2126
2295
|
* @param applicationId - The application id to consume the entitlement for
|
|
2127
2296
|
* @param entitlementId - The entitlement id to consume
|
|
2128
2297
|
* @param options - The options for consuming the entitlement
|
|
2129
2298
|
*/
|
|
2130
2299
|
async consumeEntitlement(applicationId, entitlementId, { signal } = {}) {
|
|
2131
|
-
await this.rest.post(
|
|
2300
|
+
await this.rest.post(import_v109.Routes.consumeEntitlement(applicationId, entitlementId), { signal });
|
|
2132
2301
|
}
|
|
2133
2302
|
};
|
|
2134
2303
|
|
|
2135
2304
|
// src/api/oauth2.ts
|
|
2136
|
-
var
|
|
2137
|
-
var
|
|
2305
|
+
var import_rest7 = require("@discordjs/rest");
|
|
2306
|
+
var import_v1010 = require("discord-api-types/v10");
|
|
2138
2307
|
var OAuth2API = class {
|
|
2139
2308
|
constructor(rest) {
|
|
2140
2309
|
this.rest = rest;
|
|
@@ -2149,8 +2318,8 @@ var OAuth2API = class {
|
|
|
2149
2318
|
* @param options - The options for creating the authorization URL
|
|
2150
2319
|
*/
|
|
2151
2320
|
generateAuthorizationURL(options) {
|
|
2152
|
-
const url = new URL(`${
|
|
2153
|
-
url.search = (0,
|
|
2321
|
+
const url = new URL(`${import_v1010.RouteBases.api}${import_v1010.Routes.oauth2Authorization()}`);
|
|
2322
|
+
url.search = (0, import_rest7.makeURLSearchParams)(options).toString();
|
|
2154
2323
|
return url.toString();
|
|
2155
2324
|
}
|
|
2156
2325
|
/**
|
|
@@ -2161,8 +2330,8 @@ var OAuth2API = class {
|
|
|
2161
2330
|
* @param options - The options for the token exchange request
|
|
2162
2331
|
*/
|
|
2163
2332
|
async tokenExchange(body, { signal } = {}) {
|
|
2164
|
-
return this.rest.post(
|
|
2165
|
-
body: (0,
|
|
2333
|
+
return this.rest.post(import_v1010.Routes.oauth2TokenExchange(), {
|
|
2334
|
+
body: (0, import_rest7.makeURLSearchParams)(body),
|
|
2166
2335
|
passThroughBody: true,
|
|
2167
2336
|
headers: {
|
|
2168
2337
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
@@ -2179,8 +2348,8 @@ var OAuth2API = class {
|
|
|
2179
2348
|
* @param options - The options for the refresh token request
|
|
2180
2349
|
*/
|
|
2181
2350
|
async refreshToken(body, { signal } = {}) {
|
|
2182
|
-
return this.rest.post(
|
|
2183
|
-
body: (0,
|
|
2351
|
+
return this.rest.post(import_v1010.Routes.oauth2TokenExchange(), {
|
|
2352
|
+
body: (0, import_rest7.makeURLSearchParams)(body),
|
|
2184
2353
|
passThroughBody: true,
|
|
2185
2354
|
headers: {
|
|
2186
2355
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
@@ -2199,8 +2368,8 @@ var OAuth2API = class {
|
|
|
2199
2368
|
* @param options - The options for the client credentials grant request
|
|
2200
2369
|
*/
|
|
2201
2370
|
async getToken(body, { signal } = {}) {
|
|
2202
|
-
return this.rest.post(
|
|
2203
|
-
body: (0,
|
|
2371
|
+
return this.rest.post(import_v1010.Routes.oauth2TokenExchange(), {
|
|
2372
|
+
body: (0, import_rest7.makeURLSearchParams)(body),
|
|
2204
2373
|
passThroughBody: true,
|
|
2205
2374
|
headers: {
|
|
2206
2375
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
@@ -2216,7 +2385,7 @@ var OAuth2API = class {
|
|
|
2216
2385
|
* @param options - The options for the current bot application information request
|
|
2217
2386
|
*/
|
|
2218
2387
|
async getCurrentBotApplicationInformation({ signal } = {}) {
|
|
2219
|
-
return this.rest.get(
|
|
2388
|
+
return this.rest.get(import_v1010.Routes.oauth2CurrentApplication(), {
|
|
2220
2389
|
signal
|
|
2221
2390
|
});
|
|
2222
2391
|
}
|
|
@@ -2227,7 +2396,7 @@ var OAuth2API = class {
|
|
|
2227
2396
|
* @param options - The options for the current authorization information request
|
|
2228
2397
|
*/
|
|
2229
2398
|
async getCurrentAuthorizationInformation({ signal } = {}) {
|
|
2230
|
-
return this.rest.get(
|
|
2399
|
+
return this.rest.get(import_v1010.Routes.oauth2CurrentAuthorization(), {
|
|
2231
2400
|
signal
|
|
2232
2401
|
});
|
|
2233
2402
|
}
|
|
@@ -2241,8 +2410,8 @@ var OAuth2API = class {
|
|
|
2241
2410
|
* @param options - The options for the token revocation request
|
|
2242
2411
|
*/
|
|
2243
2412
|
async revokeToken(applicationId, applicationSecret, body, { signal } = {}) {
|
|
2244
|
-
await this.rest.post(
|
|
2245
|
-
body: (0,
|
|
2413
|
+
await this.rest.post(import_v1010.Routes.oauth2TokenRevocation(), {
|
|
2414
|
+
body: (0, import_rest7.makeURLSearchParams)(body),
|
|
2246
2415
|
passThroughBody: true,
|
|
2247
2416
|
headers: {
|
|
2248
2417
|
Authorization: `Basic ${btoa(`${applicationId}:${applicationSecret}`)}`,
|
|
@@ -2255,8 +2424,8 @@ var OAuth2API = class {
|
|
|
2255
2424
|
};
|
|
2256
2425
|
|
|
2257
2426
|
// src/api/poll.ts
|
|
2258
|
-
var
|
|
2259
|
-
var
|
|
2427
|
+
var import_rest8 = require("@discordjs/rest");
|
|
2428
|
+
var import_v1011 = require("discord-api-types/v10");
|
|
2260
2429
|
var PollAPI = class {
|
|
2261
2430
|
constructor(rest) {
|
|
2262
2431
|
this.rest = rest;
|
|
@@ -2274,10 +2443,10 @@ var PollAPI = class {
|
|
|
2274
2443
|
* @param query - The query for getting the list of voters
|
|
2275
2444
|
* @param options - The options for getting the list of voters
|
|
2276
2445
|
*/
|
|
2277
|
-
async getAnswerVoters(channelId, messageId, answerId, query, { signal } = {}) {
|
|
2278
|
-
return this.rest.get(
|
|
2446
|
+
async getAnswerVoters(channelId, messageId, answerId, query = {}, { signal } = {}) {
|
|
2447
|
+
return this.rest.get(import_v1011.Routes.pollAnswerVoters(channelId, messageId, answerId), {
|
|
2279
2448
|
signal,
|
|
2280
|
-
query: (0,
|
|
2449
|
+
query: (0, import_rest8.makeURLSearchParams)(query)
|
|
2281
2450
|
});
|
|
2282
2451
|
}
|
|
2283
2452
|
/**
|
|
@@ -2289,14 +2458,14 @@ var PollAPI = class {
|
|
|
2289
2458
|
* @param options - The options for expiring the poll
|
|
2290
2459
|
*/
|
|
2291
2460
|
async expirePoll(channelId, messageId, { signal } = {}) {
|
|
2292
|
-
return this.rest.post(
|
|
2461
|
+
return this.rest.post(import_v1011.Routes.expirePoll(channelId, messageId), {
|
|
2293
2462
|
signal
|
|
2294
2463
|
});
|
|
2295
2464
|
}
|
|
2296
2465
|
};
|
|
2297
2466
|
|
|
2298
2467
|
// src/api/roleConnections.ts
|
|
2299
|
-
var
|
|
2468
|
+
var import_v1012 = require("discord-api-types/v10");
|
|
2300
2469
|
var RoleConnectionsAPI = class {
|
|
2301
2470
|
constructor(rest) {
|
|
2302
2471
|
this.rest = rest;
|
|
@@ -2312,7 +2481,7 @@ var RoleConnectionsAPI = class {
|
|
|
2312
2481
|
* @param options - The options for fetching the role connection metadata records
|
|
2313
2482
|
*/
|
|
2314
2483
|
async getMetadataRecords(applicationId, { signal } = {}) {
|
|
2315
|
-
return this.rest.get(
|
|
2484
|
+
return this.rest.get(import_v1012.Routes.applicationRoleConnectionMetadata(applicationId), {
|
|
2316
2485
|
signal
|
|
2317
2486
|
});
|
|
2318
2487
|
}
|
|
@@ -2325,15 +2494,37 @@ var RoleConnectionsAPI = class {
|
|
|
2325
2494
|
* @param options - The options for updating the role connection metadata records
|
|
2326
2495
|
*/
|
|
2327
2496
|
async updateMetadataRecords(applicationId, body, { signal } = {}) {
|
|
2328
|
-
return this.rest.put(
|
|
2497
|
+
return this.rest.put(import_v1012.Routes.applicationRoleConnectionMetadata(applicationId), {
|
|
2329
2498
|
body,
|
|
2330
2499
|
signal
|
|
2331
2500
|
});
|
|
2332
2501
|
}
|
|
2333
2502
|
};
|
|
2334
2503
|
|
|
2504
|
+
// src/api/soundboardSounds.ts
|
|
2505
|
+
var import_v1013 = require("discord-api-types/v10");
|
|
2506
|
+
var SoundboardSoundsAPI = class {
|
|
2507
|
+
constructor(rest) {
|
|
2508
|
+
this.rest = rest;
|
|
2509
|
+
}
|
|
2510
|
+
static {
|
|
2511
|
+
__name(this, "SoundboardSoundsAPI");
|
|
2512
|
+
}
|
|
2513
|
+
/**
|
|
2514
|
+
* Fetches all the soundboard default sounds.
|
|
2515
|
+
*
|
|
2516
|
+
* @see {@link https://discord.com/developers/docs/resources/soundboard#list-default-soundboard-sounds}
|
|
2517
|
+
* @param options - The options for fetching the soundboard default sounds.
|
|
2518
|
+
*/
|
|
2519
|
+
async getSoundboardDefaultSounds({ signal } = {}) {
|
|
2520
|
+
return this.rest.get(import_v1013.Routes.soundboardDefaultSounds(), {
|
|
2521
|
+
signal
|
|
2522
|
+
});
|
|
2523
|
+
}
|
|
2524
|
+
};
|
|
2525
|
+
|
|
2335
2526
|
// src/api/stageInstances.ts
|
|
2336
|
-
var
|
|
2527
|
+
var import_v1014 = require("discord-api-types/v10");
|
|
2337
2528
|
var StageInstancesAPI = class {
|
|
2338
2529
|
constructor(rest) {
|
|
2339
2530
|
this.rest = rest;
|
|
@@ -2349,7 +2540,7 @@ var StageInstancesAPI = class {
|
|
|
2349
2540
|
* @param options - The options for creating the new stage instance
|
|
2350
2541
|
*/
|
|
2351
2542
|
async create(body, { reason, signal } = {}) {
|
|
2352
|
-
return this.rest.post(
|
|
2543
|
+
return this.rest.post(import_v1014.Routes.stageInstances(), {
|
|
2353
2544
|
body,
|
|
2354
2545
|
reason,
|
|
2355
2546
|
signal
|
|
@@ -2363,7 +2554,7 @@ var StageInstancesAPI = class {
|
|
|
2363
2554
|
* @param options - The options for fetching the stage instance
|
|
2364
2555
|
*/
|
|
2365
2556
|
async get(channelId, { signal } = {}) {
|
|
2366
|
-
return this.rest.get(
|
|
2557
|
+
return this.rest.get(import_v1014.Routes.stageInstance(channelId), { signal });
|
|
2367
2558
|
}
|
|
2368
2559
|
/**
|
|
2369
2560
|
* Edits a stage instance
|
|
@@ -2374,7 +2565,7 @@ var StageInstancesAPI = class {
|
|
|
2374
2565
|
* @param options - The options for editing the stage instance
|
|
2375
2566
|
*/
|
|
2376
2567
|
async edit(channelId, body, { reason, signal } = {}) {
|
|
2377
|
-
return this.rest.patch(
|
|
2568
|
+
return this.rest.patch(import_v1014.Routes.stageInstance(channelId), {
|
|
2378
2569
|
body,
|
|
2379
2570
|
reason,
|
|
2380
2571
|
signal
|
|
@@ -2388,12 +2579,12 @@ var StageInstancesAPI = class {
|
|
|
2388
2579
|
* @param options - The options for deleting the stage instance
|
|
2389
2580
|
*/
|
|
2390
2581
|
async delete(channelId, { reason, signal } = {}) {
|
|
2391
|
-
await this.rest.delete(
|
|
2582
|
+
await this.rest.delete(import_v1014.Routes.stageInstance(channelId), { reason, signal });
|
|
2392
2583
|
}
|
|
2393
2584
|
};
|
|
2394
2585
|
|
|
2395
2586
|
// src/api/sticker.ts
|
|
2396
|
-
var
|
|
2587
|
+
var import_v1015 = require("discord-api-types/v10");
|
|
2397
2588
|
var StickersAPI = class {
|
|
2398
2589
|
constructor(rest) {
|
|
2399
2590
|
this.rest = rest;
|
|
@@ -2409,7 +2600,7 @@ var StickersAPI = class {
|
|
|
2409
2600
|
* @param options - The options for fetching the sticker pack
|
|
2410
2601
|
*/
|
|
2411
2602
|
async getStickerPack(packId, { signal } = {}) {
|
|
2412
|
-
return this.rest.get(
|
|
2603
|
+
return this.rest.get(import_v1015.Routes.stickerPack(packId), { signal });
|
|
2413
2604
|
}
|
|
2414
2605
|
/**
|
|
2415
2606
|
* Fetches all of the sticker packs
|
|
@@ -2418,7 +2609,7 @@ var StickersAPI = class {
|
|
|
2418
2609
|
* @param options - The options for fetching the sticker packs
|
|
2419
2610
|
*/
|
|
2420
2611
|
async getStickers({ signal } = {}) {
|
|
2421
|
-
return this.rest.get(
|
|
2612
|
+
return this.rest.get(import_v1015.Routes.stickerPacks(), { signal });
|
|
2422
2613
|
}
|
|
2423
2614
|
/**
|
|
2424
2615
|
* Fetches all of the sticker packs
|
|
@@ -2438,12 +2629,12 @@ var StickersAPI = class {
|
|
|
2438
2629
|
* @param options - The options for fetching the sticker
|
|
2439
2630
|
*/
|
|
2440
2631
|
async get(stickerId, { signal } = {}) {
|
|
2441
|
-
return this.rest.get(
|
|
2632
|
+
return this.rest.get(import_v1015.Routes.sticker(stickerId), { signal });
|
|
2442
2633
|
}
|
|
2443
2634
|
};
|
|
2444
2635
|
|
|
2445
2636
|
// src/api/thread.ts
|
|
2446
|
-
var
|
|
2637
|
+
var import_v1016 = require("discord-api-types/v10");
|
|
2447
2638
|
var ThreadsAPI = class {
|
|
2448
2639
|
constructor(rest) {
|
|
2449
2640
|
this.rest = rest;
|
|
@@ -2459,7 +2650,7 @@ var ThreadsAPI = class {
|
|
|
2459
2650
|
* @param options - The options for joining the thread
|
|
2460
2651
|
*/
|
|
2461
2652
|
async join(threadId, { signal } = {}) {
|
|
2462
|
-
await this.rest.put(
|
|
2653
|
+
await this.rest.put(import_v1016.Routes.threadMembers(threadId, "@me"), { signal });
|
|
2463
2654
|
}
|
|
2464
2655
|
/**
|
|
2465
2656
|
* Adds a member to a thread
|
|
@@ -2470,7 +2661,7 @@ var ThreadsAPI = class {
|
|
|
2470
2661
|
* @param options - The options for adding the member to the thread
|
|
2471
2662
|
*/
|
|
2472
2663
|
async addMember(threadId, userId, { signal } = {}) {
|
|
2473
|
-
await this.rest.put(
|
|
2664
|
+
await this.rest.put(import_v1016.Routes.threadMembers(threadId, userId), { signal });
|
|
2474
2665
|
}
|
|
2475
2666
|
/**
|
|
2476
2667
|
* Removes the current user from a thread
|
|
@@ -2480,7 +2671,7 @@ var ThreadsAPI = class {
|
|
|
2480
2671
|
* @param options - The options for leaving the thread
|
|
2481
2672
|
*/
|
|
2482
2673
|
async leave(threadId, { signal } = {}) {
|
|
2483
|
-
await this.rest.delete(
|
|
2674
|
+
await this.rest.delete(import_v1016.Routes.threadMembers(threadId, "@me"), { signal });
|
|
2484
2675
|
}
|
|
2485
2676
|
/**
|
|
2486
2677
|
* Removes a member from a thread
|
|
@@ -2491,7 +2682,7 @@ var ThreadsAPI = class {
|
|
|
2491
2682
|
* @param options - The options for removing the member from the thread
|
|
2492
2683
|
*/
|
|
2493
2684
|
async removeMember(threadId, userId, { signal } = {}) {
|
|
2494
|
-
await this.rest.delete(
|
|
2685
|
+
await this.rest.delete(import_v1016.Routes.threadMembers(threadId, userId), { signal });
|
|
2495
2686
|
}
|
|
2496
2687
|
/**
|
|
2497
2688
|
* Fetches a member of a thread
|
|
@@ -2502,7 +2693,7 @@ var ThreadsAPI = class {
|
|
|
2502
2693
|
* @param options - The options for fetching the member
|
|
2503
2694
|
*/
|
|
2504
2695
|
async getMember(threadId, userId, { signal } = {}) {
|
|
2505
|
-
return this.rest.get(
|
|
2696
|
+
return this.rest.get(import_v1016.Routes.threadMembers(threadId, userId), { signal });
|
|
2506
2697
|
}
|
|
2507
2698
|
/**
|
|
2508
2699
|
* Fetches all members of a thread
|
|
@@ -2512,13 +2703,13 @@ var ThreadsAPI = class {
|
|
|
2512
2703
|
* @param options - The options for fetching the members
|
|
2513
2704
|
*/
|
|
2514
2705
|
async getAllMembers(threadId, { signal } = {}) {
|
|
2515
|
-
return this.rest.get(
|
|
2706
|
+
return this.rest.get(import_v1016.Routes.threadMembers(threadId), { signal });
|
|
2516
2707
|
}
|
|
2517
2708
|
};
|
|
2518
2709
|
|
|
2519
2710
|
// src/api/user.ts
|
|
2520
|
-
var
|
|
2521
|
-
var
|
|
2711
|
+
var import_rest9 = require("@discordjs/rest");
|
|
2712
|
+
var import_v1017 = require("discord-api-types/v10");
|
|
2522
2713
|
var UsersAPI = class {
|
|
2523
2714
|
constructor(rest) {
|
|
2524
2715
|
this.rest = rest;
|
|
@@ -2534,7 +2725,7 @@ var UsersAPI = class {
|
|
|
2534
2725
|
* @param options - The options for fetching the user
|
|
2535
2726
|
*/
|
|
2536
2727
|
async get(userId, { signal } = {}) {
|
|
2537
|
-
return this.rest.get(
|
|
2728
|
+
return this.rest.get(import_v1017.Routes.user(userId), { signal });
|
|
2538
2729
|
}
|
|
2539
2730
|
/**
|
|
2540
2731
|
* Returns the user object of the requester's account
|
|
@@ -2543,7 +2734,7 @@ var UsersAPI = class {
|
|
|
2543
2734
|
* @param options - The options for fetching the current user
|
|
2544
2735
|
*/
|
|
2545
2736
|
async getCurrent({ signal } = {}) {
|
|
2546
|
-
return this.rest.get(
|
|
2737
|
+
return this.rest.get(import_v1017.Routes.user("@me"), { signal });
|
|
2547
2738
|
}
|
|
2548
2739
|
/**
|
|
2549
2740
|
* Returns a list of partial guild objects the current user is a member of
|
|
@@ -2553,8 +2744,8 @@ var UsersAPI = class {
|
|
|
2553
2744
|
* @param options - The options for fetching the guilds
|
|
2554
2745
|
*/
|
|
2555
2746
|
async getGuilds(query = {}, { signal } = {}) {
|
|
2556
|
-
return this.rest.get(
|
|
2557
|
-
query: (0,
|
|
2747
|
+
return this.rest.get(import_v1017.Routes.userGuilds(), {
|
|
2748
|
+
query: (0, import_rest9.makeURLSearchParams)(query),
|
|
2558
2749
|
signal
|
|
2559
2750
|
});
|
|
2560
2751
|
}
|
|
@@ -2566,7 +2757,7 @@ var UsersAPI = class {
|
|
|
2566
2757
|
* @param options - The options for leaving the guild
|
|
2567
2758
|
*/
|
|
2568
2759
|
async leaveGuild(guildId, { signal } = {}) {
|
|
2569
|
-
await this.rest.delete(
|
|
2760
|
+
await this.rest.delete(import_v1017.Routes.userGuild(guildId), { signal });
|
|
2570
2761
|
}
|
|
2571
2762
|
/**
|
|
2572
2763
|
* Edits the current user
|
|
@@ -2576,7 +2767,7 @@ var UsersAPI = class {
|
|
|
2576
2767
|
* @param options - The options for editing the user
|
|
2577
2768
|
*/
|
|
2578
2769
|
async edit(body, { signal } = {}) {
|
|
2579
|
-
return this.rest.patch(
|
|
2770
|
+
return this.rest.patch(import_v1017.Routes.user("@me"), { body, signal });
|
|
2580
2771
|
}
|
|
2581
2772
|
/**
|
|
2582
2773
|
* Fetches the guild member for the current user
|
|
@@ -2586,7 +2777,7 @@ var UsersAPI = class {
|
|
|
2586
2777
|
* @param options - The options for fetching the guild member
|
|
2587
2778
|
*/
|
|
2588
2779
|
async getGuildMember(guildId, { signal } = {}) {
|
|
2589
|
-
return this.rest.get(
|
|
2780
|
+
return this.rest.get(import_v1017.Routes.userGuildMember(guildId), { signal });
|
|
2590
2781
|
}
|
|
2591
2782
|
/**
|
|
2592
2783
|
* Edits the guild member for the current user
|
|
@@ -2597,7 +2788,7 @@ var UsersAPI = class {
|
|
|
2597
2788
|
* @param options - The options for editing the guild member
|
|
2598
2789
|
*/
|
|
2599
2790
|
async editCurrentGuildMember(guildId, body = {}, { reason, signal } = {}) {
|
|
2600
|
-
return this.rest.patch(
|
|
2791
|
+
return this.rest.patch(import_v1017.Routes.guildMember(guildId, "@me"), {
|
|
2601
2792
|
reason,
|
|
2602
2793
|
body,
|
|
2603
2794
|
signal
|
|
@@ -2611,7 +2802,7 @@ var UsersAPI = class {
|
|
|
2611
2802
|
* @param options - The options for opening the DM
|
|
2612
2803
|
*/
|
|
2613
2804
|
async createDM(userId, { signal } = {}) {
|
|
2614
|
-
return this.rest.post(
|
|
2805
|
+
return this.rest.post(import_v1017.Routes.userChannels(), {
|
|
2615
2806
|
body: { recipient_id: userId },
|
|
2616
2807
|
signal
|
|
2617
2808
|
});
|
|
@@ -2623,7 +2814,7 @@ var UsersAPI = class {
|
|
|
2623
2814
|
* @param options - The options for fetching the user's connections
|
|
2624
2815
|
*/
|
|
2625
2816
|
async getConnections({ signal } = {}) {
|
|
2626
|
-
return this.rest.get(
|
|
2817
|
+
return this.rest.get(import_v1017.Routes.userConnections(), { signal });
|
|
2627
2818
|
}
|
|
2628
2819
|
/**
|
|
2629
2820
|
* Gets the current user's active application role connection
|
|
@@ -2633,7 +2824,7 @@ var UsersAPI = class {
|
|
|
2633
2824
|
* @param options - The options for fetching the role connections
|
|
2634
2825
|
*/
|
|
2635
2826
|
async getApplicationRoleConnection(applicationId, { signal } = {}) {
|
|
2636
|
-
return this.rest.get(
|
|
2827
|
+
return this.rest.get(import_v1017.Routes.userApplicationRoleConnection(applicationId), {
|
|
2637
2828
|
signal
|
|
2638
2829
|
});
|
|
2639
2830
|
}
|
|
@@ -2646,7 +2837,7 @@ var UsersAPI = class {
|
|
|
2646
2837
|
* @param options - The options for updating the application role connection
|
|
2647
2838
|
*/
|
|
2648
2839
|
async updateApplicationRoleConnection(applicationId, body, { signal } = {}) {
|
|
2649
|
-
return this.rest.put(
|
|
2840
|
+
return this.rest.put(import_v1017.Routes.userApplicationRoleConnection(applicationId), {
|
|
2650
2841
|
body,
|
|
2651
2842
|
signal
|
|
2652
2843
|
});
|
|
@@ -2654,8 +2845,8 @@ var UsersAPI = class {
|
|
|
2654
2845
|
};
|
|
2655
2846
|
|
|
2656
2847
|
// src/api/webhook.ts
|
|
2657
|
-
var
|
|
2658
|
-
var
|
|
2848
|
+
var import_rest10 = require("@discordjs/rest");
|
|
2849
|
+
var import_v1018 = require("discord-api-types/v10");
|
|
2659
2850
|
var WebhooksAPI = class {
|
|
2660
2851
|
constructor(rest) {
|
|
2661
2852
|
this.rest = rest;
|
|
@@ -2672,7 +2863,7 @@ var WebhooksAPI = class {
|
|
|
2672
2863
|
* @param options - The options for fetching the webhook
|
|
2673
2864
|
*/
|
|
2674
2865
|
async get(id, { token, signal } = {}) {
|
|
2675
|
-
return this.rest.get(
|
|
2866
|
+
return this.rest.get(import_v1018.Routes.webhook(id, token), {
|
|
2676
2867
|
signal,
|
|
2677
2868
|
auth: !token
|
|
2678
2869
|
});
|
|
@@ -2687,7 +2878,7 @@ var WebhooksAPI = class {
|
|
|
2687
2878
|
* @param options - The options for editing the webhook
|
|
2688
2879
|
*/
|
|
2689
2880
|
async edit(id, body, { token, reason, signal } = {}) {
|
|
2690
|
-
return this.rest.patch(
|
|
2881
|
+
return this.rest.patch(import_v1018.Routes.webhook(id, token), {
|
|
2691
2882
|
reason,
|
|
2692
2883
|
body,
|
|
2693
2884
|
signal,
|
|
@@ -2703,7 +2894,7 @@ var WebhooksAPI = class {
|
|
|
2703
2894
|
* @param options - The options for deleting the webhook
|
|
2704
2895
|
*/
|
|
2705
2896
|
async delete(id, { token, reason, signal } = {}) {
|
|
2706
|
-
await this.rest.delete(
|
|
2897
|
+
await this.rest.delete(import_v1018.Routes.webhook(id, token), {
|
|
2707
2898
|
reason,
|
|
2708
2899
|
signal,
|
|
2709
2900
|
auth: !token
|
|
@@ -2718,15 +2909,9 @@ var WebhooksAPI = class {
|
|
|
2718
2909
|
* @param body - The data for executing the webhook
|
|
2719
2910
|
* @param options - The options for executing the webhook
|
|
2720
2911
|
*/
|
|
2721
|
-
async execute(id, token, {
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
with_components,
|
|
2725
|
-
files,
|
|
2726
|
-
...body
|
|
2727
|
-
}, { signal } = {}) {
|
|
2728
|
-
return this.rest.post(import_v1016.Routes.webhook(id, token), {
|
|
2729
|
-
query: (0, import_rest9.makeURLSearchParams)({ wait, thread_id, with_components }),
|
|
2912
|
+
async execute(id, token, { wait, thread_id, with_components, files, ...body }, { signal } = {}) {
|
|
2913
|
+
return this.rest.post(import_v1018.Routes.webhook(id, token), {
|
|
2914
|
+
query: (0, import_rest10.makeURLSearchParams)({ wait, thread_id, with_components }),
|
|
2730
2915
|
files,
|
|
2731
2916
|
body,
|
|
2732
2917
|
auth: false,
|
|
@@ -2745,8 +2930,8 @@ var WebhooksAPI = class {
|
|
|
2745
2930
|
* @param options - The options for executing the webhook
|
|
2746
2931
|
*/
|
|
2747
2932
|
async executeSlack(id, token, body, query = {}, { signal } = {}) {
|
|
2748
|
-
await this.rest.post(
|
|
2749
|
-
query: (0,
|
|
2933
|
+
await this.rest.post(import_v1018.Routes.webhookPlatform(id, token, "slack"), {
|
|
2934
|
+
query: (0, import_rest10.makeURLSearchParams)(query),
|
|
2750
2935
|
body,
|
|
2751
2936
|
auth: false,
|
|
2752
2937
|
signal
|
|
@@ -2763,8 +2948,8 @@ var WebhooksAPI = class {
|
|
|
2763
2948
|
* @param options - The options for executing the webhook
|
|
2764
2949
|
*/
|
|
2765
2950
|
async executeGitHub(id, token, body, query = {}, { signal } = {}) {
|
|
2766
|
-
await this.rest.post(
|
|
2767
|
-
query: (0,
|
|
2951
|
+
await this.rest.post(import_v1018.Routes.webhookPlatform(id, token, "github"), {
|
|
2952
|
+
query: (0, import_rest10.makeURLSearchParams)(query),
|
|
2768
2953
|
body,
|
|
2769
2954
|
signal,
|
|
2770
2955
|
auth: false
|
|
@@ -2781,8 +2966,8 @@ var WebhooksAPI = class {
|
|
|
2781
2966
|
* @param options - The options for fetching the message
|
|
2782
2967
|
*/
|
|
2783
2968
|
async getMessage(id, token, messageId, query = {}, { signal } = {}) {
|
|
2784
|
-
return this.rest.get(
|
|
2785
|
-
query: (0,
|
|
2969
|
+
return this.rest.get(import_v1018.Routes.webhookMessage(id, token, messageId), {
|
|
2970
|
+
query: (0, import_rest10.makeURLSearchParams)(query),
|
|
2786
2971
|
auth: false,
|
|
2787
2972
|
signal
|
|
2788
2973
|
});
|
|
@@ -2797,14 +2982,9 @@ var WebhooksAPI = class {
|
|
|
2797
2982
|
* @param body - The data for editing the message
|
|
2798
2983
|
* @param options - The options for editing the message
|
|
2799
2984
|
*/
|
|
2800
|
-
async editMessage(id, token, messageId, {
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
files,
|
|
2804
|
-
...body
|
|
2805
|
-
}, { signal } = {}) {
|
|
2806
|
-
return this.rest.patch(import_v1016.Routes.webhookMessage(id, token, messageId), {
|
|
2807
|
-
query: (0, import_rest9.makeURLSearchParams)({ thread_id, with_components }),
|
|
2985
|
+
async editMessage(id, token, messageId, { thread_id, with_components, files, ...body }, { signal } = {}) {
|
|
2986
|
+
return this.rest.patch(import_v1018.Routes.webhookMessage(id, token, messageId), {
|
|
2987
|
+
query: (0, import_rest10.makeURLSearchParams)({ thread_id, with_components }),
|
|
2808
2988
|
auth: false,
|
|
2809
2989
|
body,
|
|
2810
2990
|
signal,
|
|
@@ -2822,8 +3002,8 @@ var WebhooksAPI = class {
|
|
|
2822
3002
|
* @param options - The options for deleting the message
|
|
2823
3003
|
*/
|
|
2824
3004
|
async deleteMessage(id, token, messageId, query = {}, { signal } = {}) {
|
|
2825
|
-
await this.rest.delete(
|
|
2826
|
-
query: (0,
|
|
3005
|
+
await this.rest.delete(import_v1018.Routes.webhookMessage(id, token, messageId), {
|
|
3006
|
+
query: (0, import_rest10.makeURLSearchParams)(query),
|
|
2827
3007
|
auth: false,
|
|
2828
3008
|
signal
|
|
2829
3009
|
});
|
|
@@ -2837,12 +3017,14 @@ var API = class {
|
|
|
2837
3017
|
this.applicationCommands = new ApplicationCommandsAPI(rest);
|
|
2838
3018
|
this.applications = new ApplicationsAPI(rest);
|
|
2839
3019
|
this.channels = new ChannelsAPI(rest);
|
|
3020
|
+
this.gateway = new GatewayAPI(rest);
|
|
2840
3021
|
this.guilds = new GuildsAPI(rest);
|
|
2841
3022
|
this.invites = new InvitesAPI(rest);
|
|
2842
3023
|
this.monetization = new MonetizationAPI(rest);
|
|
2843
3024
|
this.oauth2 = new OAuth2API(rest);
|
|
2844
3025
|
this.poll = new PollAPI(rest);
|
|
2845
3026
|
this.roleConnections = new RoleConnectionsAPI(rest);
|
|
3027
|
+
this.soundboardSounds = new SoundboardSoundsAPI(rest);
|
|
2846
3028
|
this.stageInstances = new StageInstancesAPI(rest);
|
|
2847
3029
|
this.stickers = new StickersAPI(rest);
|
|
2848
3030
|
this.threads = new ThreadsAPI(rest);
|
|
@@ -2857,6 +3039,7 @@ var API = class {
|
|
|
2857
3039
|
applicationCommands;
|
|
2858
3040
|
applications;
|
|
2859
3041
|
channels;
|
|
3042
|
+
gateway;
|
|
2860
3043
|
guilds;
|
|
2861
3044
|
interactions;
|
|
2862
3045
|
invites;
|
|
@@ -2864,6 +3047,7 @@ var API = class {
|
|
|
2864
3047
|
oauth2;
|
|
2865
3048
|
poll;
|
|
2866
3049
|
roleConnections;
|
|
3050
|
+
soundboardSounds;
|
|
2867
3051
|
stageInstances;
|
|
2868
3052
|
stickers;
|
|
2869
3053
|
threads;
|
|
@@ -2891,13 +3075,14 @@ __name(withFiles, "withFiles");
|
|
|
2891
3075
|
|
|
2892
3076
|
// src/http-only/index.ts
|
|
2893
3077
|
__reExport(http_only_exports, require("discord-api-types/v10"), module.exports);
|
|
2894
|
-
var version = "2.
|
|
3078
|
+
var version = "2.4.0";
|
|
2895
3079
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2896
3080
|
0 && (module.exports = {
|
|
2897
3081
|
API,
|
|
2898
3082
|
ApplicationCommandsAPI,
|
|
2899
3083
|
ApplicationsAPI,
|
|
2900
3084
|
ChannelsAPI,
|
|
3085
|
+
GatewayAPI,
|
|
2901
3086
|
GuildsAPI,
|
|
2902
3087
|
InteractionsAPI,
|
|
2903
3088
|
InvitesAPI,
|
|
@@ -2905,6 +3090,7 @@ var version = "2.2.2";
|
|
|
2905
3090
|
OAuth2API,
|
|
2906
3091
|
PollAPI,
|
|
2907
3092
|
RoleConnectionsAPI,
|
|
3093
|
+
SoundboardSoundsAPI,
|
|
2908
3094
|
StageInstancesAPI,
|
|
2909
3095
|
StickersAPI,
|
|
2910
3096
|
ThreadsAPI,
|