@discordjs/core 2.0.0-dev.1724112651-87776bb0e → 2.0.0-dev.1724155493-bf83db948
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 +105 -6
- package/dist/http-only.d.ts +105 -6
- package/dist/http-only.js +316 -165
- package/dist/http-only.js.map +1 -1
- package/dist/http-only.mjs +311 -158
- package/dist/http-only.mjs.map +1 -1
- package/dist/index.d.mts +105 -6
- package/dist/index.d.ts +105 -6
- package/dist/index.js +316 -165
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +311 -158
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/http-only.js
CHANGED
|
@@ -301,6 +301,71 @@ var ApplicationsAPI = class {
|
|
|
301
301
|
signal
|
|
302
302
|
});
|
|
303
303
|
}
|
|
304
|
+
/**
|
|
305
|
+
* Fetches all emojis of an application
|
|
306
|
+
*
|
|
307
|
+
* @see {@link https://discord.com/developers/docs/resources/emoji#list-application-emojis}
|
|
308
|
+
* @param applicationId - The id of the application to fetch the emojis of
|
|
309
|
+
* @param options - The options for fetching the emojis
|
|
310
|
+
*/
|
|
311
|
+
async getEmojis(applicationId, { signal } = {}) {
|
|
312
|
+
return this.rest.get(import_v102.Routes.applicationEmojis(applicationId), {
|
|
313
|
+
signal
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Fetches an emoji of an application
|
|
318
|
+
*
|
|
319
|
+
* @see {@link https://discord.com/developers/docs/resources/emoji#get-application-emoji}
|
|
320
|
+
* @param applicationId - The id of the application to fetch the emoji of
|
|
321
|
+
* @param emojiId - The id of the emoji to fetch
|
|
322
|
+
* @param options - The options for fetching the emoji
|
|
323
|
+
*/
|
|
324
|
+
async getEmoji(applicationId, emojiId, { signal } = {}) {
|
|
325
|
+
return this.rest.get(import_v102.Routes.applicationEmoji(applicationId, emojiId), {
|
|
326
|
+
signal
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Creates a new emoji of an application
|
|
331
|
+
*
|
|
332
|
+
* @see {@link https://discord.com/developers/docs/resources/emoji#create-application-emoji}
|
|
333
|
+
* @param applicationId - The id of the application to create the emoji of
|
|
334
|
+
* @param body - The data for creating the emoji
|
|
335
|
+
* @param options - The options for creating the emoji
|
|
336
|
+
*/
|
|
337
|
+
async createEmoji(applicationId, body, { signal } = {}) {
|
|
338
|
+
return this.rest.post(import_v102.Routes.applicationEmojis(applicationId), {
|
|
339
|
+
body,
|
|
340
|
+
signal
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Edits an emoji of an application
|
|
345
|
+
*
|
|
346
|
+
* @see {@link https://discord.com/developers/docs/resources/emoji#modify-application-emoji}
|
|
347
|
+
* @param applicationId - The id of the application to edit the emoji of
|
|
348
|
+
* @param emojiId - The id of the emoji to edit
|
|
349
|
+
* @param body - The data for editing the emoji
|
|
350
|
+
* @param options - The options for editing the emoji
|
|
351
|
+
*/
|
|
352
|
+
async editEmoji(applicationId, emojiId, body, { signal } = {}) {
|
|
353
|
+
return this.rest.patch(import_v102.Routes.applicationEmoji(applicationId, emojiId), {
|
|
354
|
+
body,
|
|
355
|
+
signal
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Deletes an emoji of an application
|
|
360
|
+
*
|
|
361
|
+
* @see {@link https://discord.com/developers/docs/resources/emoji#delete-application-emoji}
|
|
362
|
+
* @param applicationId - The id of the application to delete the emoji of
|
|
363
|
+
* @param emojiId - The id of the emoji to delete
|
|
364
|
+
* @param options - The options for deleting the emoji
|
|
365
|
+
*/
|
|
366
|
+
async deleteEmoji(applicationId, emojiId, { signal } = {}) {
|
|
367
|
+
await this.rest.delete(import_v102.Routes.applicationEmoji(applicationId, emojiId), { signal });
|
|
368
|
+
}
|
|
304
369
|
};
|
|
305
370
|
|
|
306
371
|
// src/api/channel.ts
|
|
@@ -719,7 +784,81 @@ var ChannelsAPI = class {
|
|
|
719
784
|
|
|
720
785
|
// src/api/guild.ts
|
|
721
786
|
var import_rest3 = require("@discordjs/rest");
|
|
787
|
+
var import_v105 = require("discord-api-types/v10");
|
|
788
|
+
|
|
789
|
+
// src/api/voice.ts
|
|
722
790
|
var import_v104 = require("discord-api-types/v10");
|
|
791
|
+
var VoiceAPI = class {
|
|
792
|
+
constructor(rest) {
|
|
793
|
+
this.rest = rest;
|
|
794
|
+
}
|
|
795
|
+
static {
|
|
796
|
+
__name(this, "VoiceAPI");
|
|
797
|
+
}
|
|
798
|
+
/**
|
|
799
|
+
* Fetches all voice regions
|
|
800
|
+
*
|
|
801
|
+
* @see {@link https://discord.com/developers/docs/resources/voice#list-voice-regions}
|
|
802
|
+
* @param options - The options for fetching the voice regions
|
|
803
|
+
*/
|
|
804
|
+
async getVoiceRegions({ signal } = {}) {
|
|
805
|
+
return this.rest.get(import_v104.Routes.voiceRegions(), { signal });
|
|
806
|
+
}
|
|
807
|
+
/**
|
|
808
|
+
* Fetches voice state of a user by their id
|
|
809
|
+
*
|
|
810
|
+
* @see {@link https://discord.com/developers/docs/resources/voice#get-user-voice-state}
|
|
811
|
+
* @param options - The options for fetching user voice state
|
|
812
|
+
*/
|
|
813
|
+
async getUserVoiceState(guildId, userId, { signal } = {}) {
|
|
814
|
+
return this.rest.get(import_v104.Routes.guildVoiceState(guildId, userId), {
|
|
815
|
+
signal
|
|
816
|
+
});
|
|
817
|
+
}
|
|
818
|
+
/**
|
|
819
|
+
* Fetches the current user's voice state
|
|
820
|
+
*
|
|
821
|
+
* @see {@link https://discord.com/developers/docs/resources/voice#get-current-user-voice-state}
|
|
822
|
+
* @param options - The options for fetching user voice state
|
|
823
|
+
*/
|
|
824
|
+
async getVoiceState(guildId, { signal } = {}) {
|
|
825
|
+
return this.rest.get(import_v104.Routes.guildVoiceState(guildId, "@me"), {
|
|
826
|
+
signal
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
/**
|
|
830
|
+
* Edits a user's voice state in a guild
|
|
831
|
+
*
|
|
832
|
+
* @see {@link https://discord.com/developers/docs/resources/voice#modify-user-voice-state}
|
|
833
|
+
* @param guildId - The id of the guild to edit the current user's voice state in
|
|
834
|
+
* @param userId - The id of the user to edit the voice state for
|
|
835
|
+
* @param body - The data for editing the voice state
|
|
836
|
+
* @param options - The options for editing the voice state
|
|
837
|
+
*/
|
|
838
|
+
async editUserVoiceState(guildId, userId, body, { reason, signal } = {}) {
|
|
839
|
+
return this.rest.patch(import_v104.Routes.guildVoiceState(guildId, userId), {
|
|
840
|
+
reason,
|
|
841
|
+
body,
|
|
842
|
+
signal
|
|
843
|
+
});
|
|
844
|
+
}
|
|
845
|
+
/**
|
|
846
|
+
* Edits the voice state for the current user
|
|
847
|
+
*
|
|
848
|
+
* @see {@link https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state}
|
|
849
|
+
* @param guildId - The id of the guild
|
|
850
|
+
* @param body - The data for editing the voice state
|
|
851
|
+
* @param options - The options for editing the voice state
|
|
852
|
+
*/
|
|
853
|
+
async editVoiceState(guildId, body = {}, { signal } = {}) {
|
|
854
|
+
return this.rest.patch(import_v104.Routes.guildVoiceState(guildId, "@me"), {
|
|
855
|
+
body,
|
|
856
|
+
signal
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
};
|
|
860
|
+
|
|
861
|
+
// src/api/guild.ts
|
|
723
862
|
var GuildsAPI = class {
|
|
724
863
|
constructor(rest) {
|
|
725
864
|
this.rest = rest;
|
|
@@ -734,7 +873,7 @@ var GuildsAPI = class {
|
|
|
734
873
|
if ("with_counts" in queryOrOptions) {
|
|
735
874
|
requestData.query = (0, import_rest3.makeURLSearchParams)(queryOrOptions);
|
|
736
875
|
}
|
|
737
|
-
return this.rest.get(
|
|
876
|
+
return this.rest.get(import_v105.Routes.guild(guildId), requestData);
|
|
738
877
|
}
|
|
739
878
|
/**
|
|
740
879
|
* Fetches a guild preview
|
|
@@ -744,7 +883,7 @@ var GuildsAPI = class {
|
|
|
744
883
|
* @param options - The options for fetching the guild preview
|
|
745
884
|
*/
|
|
746
885
|
async getPreview(guildId, { signal } = {}) {
|
|
747
|
-
return this.rest.get(
|
|
886
|
+
return this.rest.get(import_v105.Routes.guildPreview(guildId), {
|
|
748
887
|
signal
|
|
749
888
|
});
|
|
750
889
|
}
|
|
@@ -756,7 +895,7 @@ var GuildsAPI = class {
|
|
|
756
895
|
* @param options - The options for creating the guild
|
|
757
896
|
*/
|
|
758
897
|
async create(body, { signal } = {}) {
|
|
759
|
-
return this.rest.post(
|
|
898
|
+
return this.rest.post(import_v105.Routes.guilds(), { body, signal });
|
|
760
899
|
}
|
|
761
900
|
/**
|
|
762
901
|
* Edits a guild
|
|
@@ -767,7 +906,7 @@ var GuildsAPI = class {
|
|
|
767
906
|
* @param options - The options for editing the guild
|
|
768
907
|
*/
|
|
769
908
|
async edit(guildId, body, { reason, signal } = {}) {
|
|
770
|
-
return this.rest.patch(
|
|
909
|
+
return this.rest.patch(import_v105.Routes.guild(guildId), {
|
|
771
910
|
reason,
|
|
772
911
|
body,
|
|
773
912
|
signal
|
|
@@ -781,7 +920,7 @@ var GuildsAPI = class {
|
|
|
781
920
|
* @param options - The options for deleting this guild
|
|
782
921
|
*/
|
|
783
922
|
async delete(guildId, { signal, reason } = {}) {
|
|
784
|
-
await this.rest.delete(
|
|
923
|
+
await this.rest.delete(import_v105.Routes.guild(guildId), { reason, signal });
|
|
785
924
|
}
|
|
786
925
|
/**
|
|
787
926
|
* Adds user to the guild
|
|
@@ -793,7 +932,7 @@ var GuildsAPI = class {
|
|
|
793
932
|
* @param options - The options for adding users to the guild
|
|
794
933
|
*/
|
|
795
934
|
async addMember(guildId, userId, body, { signal } = {}) {
|
|
796
|
-
return this.rest.put(
|
|
935
|
+
return this.rest.put(import_v105.Routes.guildMember(guildId, userId), {
|
|
797
936
|
body,
|
|
798
937
|
signal
|
|
799
938
|
});
|
|
@@ -807,7 +946,7 @@ var GuildsAPI = class {
|
|
|
807
946
|
* @param options - The options for fetching the guild members
|
|
808
947
|
*/
|
|
809
948
|
async getMembers(guildId, query = {}, { signal } = {}) {
|
|
810
|
-
return this.rest.get(
|
|
949
|
+
return this.rest.get(import_v105.Routes.guildMembers(guildId), {
|
|
811
950
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
812
951
|
signal
|
|
813
952
|
});
|
|
@@ -820,7 +959,7 @@ var GuildsAPI = class {
|
|
|
820
959
|
* @param options - The options for fetching the guild channels
|
|
821
960
|
*/
|
|
822
961
|
async getChannels(guildId, { signal } = {}) {
|
|
823
|
-
return this.rest.get(
|
|
962
|
+
return this.rest.get(import_v105.Routes.guildChannels(guildId), {
|
|
824
963
|
signal
|
|
825
964
|
});
|
|
826
965
|
}
|
|
@@ -833,7 +972,7 @@ var GuildsAPI = class {
|
|
|
833
972
|
* @param options - The options for creating the guild channel
|
|
834
973
|
*/
|
|
835
974
|
async createChannel(guildId, body, { reason, signal } = {}) {
|
|
836
|
-
return this.rest.post(
|
|
975
|
+
return this.rest.post(import_v105.Routes.guildChannels(guildId), {
|
|
837
976
|
reason,
|
|
838
977
|
body,
|
|
839
978
|
signal
|
|
@@ -848,7 +987,7 @@ var GuildsAPI = class {
|
|
|
848
987
|
* @param options - The options for editing the guild channel positions
|
|
849
988
|
*/
|
|
850
989
|
async setChannelPositions(guildId, body, { reason, signal } = {}) {
|
|
851
|
-
await this.rest.patch(
|
|
990
|
+
await this.rest.patch(import_v105.Routes.guildChannels(guildId), { reason, body, signal });
|
|
852
991
|
}
|
|
853
992
|
/**
|
|
854
993
|
* Fetches the active threads in a guild
|
|
@@ -858,7 +997,7 @@ var GuildsAPI = class {
|
|
|
858
997
|
* @param options - The options for fetching the active threads
|
|
859
998
|
*/
|
|
860
999
|
async getActiveThreads(guildId, { signal } = {}) {
|
|
861
|
-
return this.rest.get(
|
|
1000
|
+
return this.rest.get(import_v105.Routes.guildActiveThreads(guildId), { signal });
|
|
862
1001
|
}
|
|
863
1002
|
/**
|
|
864
1003
|
* Fetches a guild member ban
|
|
@@ -869,7 +1008,7 @@ var GuildsAPI = class {
|
|
|
869
1008
|
* @param options - The options for fetching the ban
|
|
870
1009
|
*/
|
|
871
1010
|
async getMemberBan(guildId, userId, { signal } = {}) {
|
|
872
|
-
return this.rest.get(
|
|
1011
|
+
return this.rest.get(import_v105.Routes.guildBan(guildId, userId), { signal });
|
|
873
1012
|
}
|
|
874
1013
|
/**
|
|
875
1014
|
* Fetches guild member bans
|
|
@@ -880,7 +1019,7 @@ var GuildsAPI = class {
|
|
|
880
1019
|
* @param options - The options for fetching the bans
|
|
881
1020
|
*/
|
|
882
1021
|
async getMemberBans(guildId, query = {}, { signal } = {}) {
|
|
883
|
-
return this.rest.get(
|
|
1022
|
+
return this.rest.get(import_v105.Routes.guildBans(guildId), {
|
|
884
1023
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
885
1024
|
signal
|
|
886
1025
|
});
|
|
@@ -895,7 +1034,7 @@ var GuildsAPI = class {
|
|
|
895
1034
|
* @param options - The options for banning the user
|
|
896
1035
|
*/
|
|
897
1036
|
async banUser(guildId, userId, body = {}, { reason, signal } = {}) {
|
|
898
|
-
await this.rest.put(
|
|
1037
|
+
await this.rest.put(import_v105.Routes.guildBan(guildId, userId), { reason, body, signal });
|
|
899
1038
|
}
|
|
900
1039
|
/**
|
|
901
1040
|
* Unbans a user from a guild
|
|
@@ -906,7 +1045,7 @@ var GuildsAPI = class {
|
|
|
906
1045
|
* @param options - The options for unbanning the user
|
|
907
1046
|
*/
|
|
908
1047
|
async unbanUser(guildId, userId, { reason, signal } = {}) {
|
|
909
|
-
await this.rest.delete(
|
|
1048
|
+
await this.rest.delete(import_v105.Routes.guildBan(guildId, userId), { reason, signal });
|
|
910
1049
|
}
|
|
911
1050
|
/**
|
|
912
1051
|
* Bulk ban users from a guild
|
|
@@ -917,7 +1056,7 @@ var GuildsAPI = class {
|
|
|
917
1056
|
* @param options - The options for bulk banning users
|
|
918
1057
|
*/
|
|
919
1058
|
async bulkBanUsers(guildId, body, { reason, signal } = {}) {
|
|
920
|
-
return this.rest.post(
|
|
1059
|
+
return this.rest.post(import_v105.Routes.guildBulkBan(guildId), {
|
|
921
1060
|
reason,
|
|
922
1061
|
body,
|
|
923
1062
|
signal
|
|
@@ -931,7 +1070,7 @@ var GuildsAPI = class {
|
|
|
931
1070
|
* @param options - The options for fetching the guild roles
|
|
932
1071
|
*/
|
|
933
1072
|
async getRoles(guildId, { signal } = {}) {
|
|
934
|
-
return this.rest.get(
|
|
1073
|
+
return this.rest.get(import_v105.Routes.guildRoles(guildId), { signal });
|
|
935
1074
|
}
|
|
936
1075
|
/**
|
|
937
1076
|
* Creates a guild role
|
|
@@ -942,7 +1081,7 @@ var GuildsAPI = class {
|
|
|
942
1081
|
* @param options - The options for creating the guild role
|
|
943
1082
|
*/
|
|
944
1083
|
async createRole(guildId, body, { reason, signal } = {}) {
|
|
945
|
-
return this.rest.post(
|
|
1084
|
+
return this.rest.post(import_v105.Routes.guildRoles(guildId), { reason, body, signal });
|
|
946
1085
|
}
|
|
947
1086
|
/**
|
|
948
1087
|
* Sets role positions in a guild
|
|
@@ -953,7 +1092,7 @@ var GuildsAPI = class {
|
|
|
953
1092
|
* @param options - The options for setting role positions
|
|
954
1093
|
*/
|
|
955
1094
|
async setRolePositions(guildId, body, { reason, signal } = {}) {
|
|
956
|
-
return this.rest.patch(
|
|
1095
|
+
return this.rest.patch(import_v105.Routes.guildRoles(guildId), {
|
|
957
1096
|
reason,
|
|
958
1097
|
body,
|
|
959
1098
|
signal
|
|
@@ -969,7 +1108,7 @@ var GuildsAPI = class {
|
|
|
969
1108
|
* @param options - The options for editing the guild role
|
|
970
1109
|
*/
|
|
971
1110
|
async editRole(guildId, roleId, body, { reason, signal } = {}) {
|
|
972
|
-
return this.rest.patch(
|
|
1111
|
+
return this.rest.patch(import_v105.Routes.guildRole(guildId, roleId), {
|
|
973
1112
|
reason,
|
|
974
1113
|
body,
|
|
975
1114
|
signal
|
|
@@ -984,7 +1123,7 @@ var GuildsAPI = class {
|
|
|
984
1123
|
* @param options - The options for deleting the guild role
|
|
985
1124
|
*/
|
|
986
1125
|
async deleteRole(guildId, roleId, { reason, signal } = {}) {
|
|
987
|
-
await this.rest.delete(
|
|
1126
|
+
await this.rest.delete(import_v105.Routes.guildRole(guildId, roleId), { reason, signal });
|
|
988
1127
|
}
|
|
989
1128
|
/**
|
|
990
1129
|
* Edits the multi-factor-authentication (MFA) level of a guild
|
|
@@ -995,7 +1134,7 @@ var GuildsAPI = class {
|
|
|
995
1134
|
* @param options - The options for editing the MFA level
|
|
996
1135
|
*/
|
|
997
1136
|
async editMFALevel(guildId, level, { reason, signal } = {}) {
|
|
998
|
-
return this.rest.post(
|
|
1137
|
+
return this.rest.post(import_v105.Routes.guildMFA(guildId), {
|
|
999
1138
|
reason,
|
|
1000
1139
|
signal,
|
|
1001
1140
|
body: { level }
|
|
@@ -1010,7 +1149,7 @@ var GuildsAPI = class {
|
|
|
1010
1149
|
* @param options - The options for fetching the number of pruned members
|
|
1011
1150
|
*/
|
|
1012
1151
|
async getPruneCount(guildId, query = {}, { signal } = {}) {
|
|
1013
|
-
return this.rest.get(
|
|
1152
|
+
return this.rest.get(import_v105.Routes.guildPrune(guildId), {
|
|
1014
1153
|
signal,
|
|
1015
1154
|
query: (0, import_rest3.makeURLSearchParams)(query)
|
|
1016
1155
|
});
|
|
@@ -1024,7 +1163,7 @@ var GuildsAPI = class {
|
|
|
1024
1163
|
* @param options - The options for initiating the prune
|
|
1025
1164
|
*/
|
|
1026
1165
|
async beginPrune(guildId, body = {}, { reason, signal } = {}) {
|
|
1027
|
-
return this.rest.post(
|
|
1166
|
+
return this.rest.post(import_v105.Routes.guildPrune(guildId), {
|
|
1028
1167
|
body,
|
|
1029
1168
|
reason,
|
|
1030
1169
|
signal
|
|
@@ -1038,7 +1177,7 @@ var GuildsAPI = class {
|
|
|
1038
1177
|
* @param options - The options for fetching the voice regions
|
|
1039
1178
|
*/
|
|
1040
1179
|
async getVoiceRegions(guildId, { signal } = {}) {
|
|
1041
|
-
return this.rest.get(
|
|
1180
|
+
return this.rest.get(import_v105.Routes.guildVoiceRegions(guildId), { signal });
|
|
1042
1181
|
}
|
|
1043
1182
|
/**
|
|
1044
1183
|
* Fetches the invites for a guild
|
|
@@ -1048,7 +1187,7 @@ var GuildsAPI = class {
|
|
|
1048
1187
|
* @param options - The options for fetching the invites
|
|
1049
1188
|
*/
|
|
1050
1189
|
async getInvites(guildId, { signal } = {}) {
|
|
1051
|
-
return this.rest.get(
|
|
1190
|
+
return this.rest.get(import_v105.Routes.guildInvites(guildId), { signal });
|
|
1052
1191
|
}
|
|
1053
1192
|
/**
|
|
1054
1193
|
* Fetches the integrations for a guild
|
|
@@ -1058,7 +1197,7 @@ var GuildsAPI = class {
|
|
|
1058
1197
|
* @param options - The options for fetching the integrations
|
|
1059
1198
|
*/
|
|
1060
1199
|
async getIntegrations(guildId, { signal } = {}) {
|
|
1061
|
-
return this.rest.get(
|
|
1200
|
+
return this.rest.get(import_v105.Routes.guildIntegrations(guildId), { signal });
|
|
1062
1201
|
}
|
|
1063
1202
|
/**
|
|
1064
1203
|
* Deletes an integration from a guild
|
|
@@ -1069,7 +1208,7 @@ var GuildsAPI = class {
|
|
|
1069
1208
|
* @param options - The options for deleting the integration
|
|
1070
1209
|
*/
|
|
1071
1210
|
async deleteIntegration(guildId, integrationId, { reason, signal } = {}) {
|
|
1072
|
-
await this.rest.delete(
|
|
1211
|
+
await this.rest.delete(import_v105.Routes.guildIntegration(guildId, integrationId), { reason, signal });
|
|
1073
1212
|
}
|
|
1074
1213
|
/**
|
|
1075
1214
|
* Fetches the widget settings for a guild
|
|
@@ -1079,7 +1218,7 @@ var GuildsAPI = class {
|
|
|
1079
1218
|
* @param options - The options for fetching the widget settings
|
|
1080
1219
|
*/
|
|
1081
1220
|
async getWidgetSettings(guildId, { signal } = {}) {
|
|
1082
|
-
return this.rest.get(
|
|
1221
|
+
return this.rest.get(import_v105.Routes.guildWidgetSettings(guildId), {
|
|
1083
1222
|
signal
|
|
1084
1223
|
});
|
|
1085
1224
|
}
|
|
@@ -1092,7 +1231,7 @@ var GuildsAPI = class {
|
|
|
1092
1231
|
* @param options - The options for editing the widget settings
|
|
1093
1232
|
*/
|
|
1094
1233
|
async editWidgetSettings(guildId, body, { reason, signal } = {}) {
|
|
1095
|
-
return this.rest.patch(
|
|
1234
|
+
return this.rest.patch(import_v105.Routes.guildWidgetSettings(guildId), {
|
|
1096
1235
|
reason,
|
|
1097
1236
|
body,
|
|
1098
1237
|
signal
|
|
@@ -1106,7 +1245,7 @@ var GuildsAPI = class {
|
|
|
1106
1245
|
* @param options - The options for fetching the widget
|
|
1107
1246
|
*/
|
|
1108
1247
|
async getWidget(guildId, { signal } = {}) {
|
|
1109
|
-
return this.rest.get(
|
|
1248
|
+
return this.rest.get(import_v105.Routes.guildWidgetJSON(guildId), { signal });
|
|
1110
1249
|
}
|
|
1111
1250
|
/**
|
|
1112
1251
|
* Fetches the vanity url for a guild
|
|
@@ -1116,7 +1255,7 @@ var GuildsAPI = class {
|
|
|
1116
1255
|
* @param options - The options for fetching the vanity url
|
|
1117
1256
|
*/
|
|
1118
1257
|
async getVanityURL(guildId, { signal } = {}) {
|
|
1119
|
-
return this.rest.get(
|
|
1258
|
+
return this.rest.get(import_v105.Routes.guildVanityUrl(guildId), { signal });
|
|
1120
1259
|
}
|
|
1121
1260
|
/**
|
|
1122
1261
|
* Fetches the widget image for a guild
|
|
@@ -1127,7 +1266,7 @@ var GuildsAPI = class {
|
|
|
1127
1266
|
* @param options - The options for fetching the widget image
|
|
1128
1267
|
*/
|
|
1129
1268
|
async getWidgetImage(guildId, style, { signal } = {}) {
|
|
1130
|
-
return this.rest.get(
|
|
1269
|
+
return this.rest.get(import_v105.Routes.guildWidgetImage(guildId), {
|
|
1131
1270
|
query: (0, import_rest3.makeURLSearchParams)({ style }),
|
|
1132
1271
|
signal
|
|
1133
1272
|
});
|
|
@@ -1140,7 +1279,7 @@ var GuildsAPI = class {
|
|
|
1140
1279
|
* @param options - The options for fetching the welcome screen
|
|
1141
1280
|
*/
|
|
1142
1281
|
async getWelcomeScreen(guildId, { signal } = {}) {
|
|
1143
|
-
return this.rest.get(
|
|
1282
|
+
return this.rest.get(import_v105.Routes.guildWelcomeScreen(guildId), { signal });
|
|
1144
1283
|
}
|
|
1145
1284
|
/**
|
|
1146
1285
|
* Edits the welcome screen for a guild
|
|
@@ -1151,7 +1290,7 @@ var GuildsAPI = class {
|
|
|
1151
1290
|
* @param options - The options for editing the welcome screen
|
|
1152
1291
|
*/
|
|
1153
1292
|
async editWelcomeScreen(guildId, body, { reason, signal } = {}) {
|
|
1154
|
-
return this.rest.patch(
|
|
1293
|
+
return this.rest.patch(import_v105.Routes.guildWelcomeScreen(guildId), {
|
|
1155
1294
|
reason,
|
|
1156
1295
|
body,
|
|
1157
1296
|
signal
|
|
@@ -1160,14 +1299,15 @@ var GuildsAPI = class {
|
|
|
1160
1299
|
/**
|
|
1161
1300
|
* Edits a user's voice state in a guild
|
|
1162
1301
|
*
|
|
1163
|
-
* @see {@link https://discord.com/developers/docs/resources/
|
|
1302
|
+
* @see {@link https://discord.com/developers/docs/resources/voice#modify-user-voice-state}
|
|
1164
1303
|
* @param guildId - The id of the guild to edit the current user's voice state in
|
|
1165
1304
|
* @param userId - The id of the user to edit the voice state for
|
|
1166
1305
|
* @param body - The data for editing the voice state
|
|
1167
1306
|
* @param options - The options for editing the voice state
|
|
1307
|
+
* @deprecated Use {@link VoiceAPI.editUserVoiceState} instead
|
|
1168
1308
|
*/
|
|
1169
1309
|
async editUserVoiceState(guildId, userId, body, { reason, signal } = {}) {
|
|
1170
|
-
|
|
1310
|
+
return new VoiceAPI(this.rest).editUserVoiceState(guildId, userId, body, { reason, signal });
|
|
1171
1311
|
}
|
|
1172
1312
|
/**
|
|
1173
1313
|
* Fetches all emojis for a guild
|
|
@@ -1177,7 +1317,7 @@ var GuildsAPI = class {
|
|
|
1177
1317
|
* @param options - The options for fetching the emojis
|
|
1178
1318
|
*/
|
|
1179
1319
|
async getEmojis(guildId, { signal } = {}) {
|
|
1180
|
-
return this.rest.get(
|
|
1320
|
+
return this.rest.get(import_v105.Routes.guildEmojis(guildId), { signal });
|
|
1181
1321
|
}
|
|
1182
1322
|
/**
|
|
1183
1323
|
* Fetches an emoji for a guild
|
|
@@ -1188,7 +1328,7 @@ var GuildsAPI = class {
|
|
|
1188
1328
|
* @param options - The options for fetching the emoji
|
|
1189
1329
|
*/
|
|
1190
1330
|
async getEmoji(guildId, emojiId, { signal } = {}) {
|
|
1191
|
-
return this.rest.get(
|
|
1331
|
+
return this.rest.get(import_v105.Routes.guildEmoji(guildId, emojiId), { signal });
|
|
1192
1332
|
}
|
|
1193
1333
|
/**
|
|
1194
1334
|
* Creates a new emoji for a guild
|
|
@@ -1199,7 +1339,7 @@ var GuildsAPI = class {
|
|
|
1199
1339
|
* @param options - The options for creating the emoji
|
|
1200
1340
|
*/
|
|
1201
1341
|
async createEmoji(guildId, body, { reason, signal } = {}) {
|
|
1202
|
-
return this.rest.post(
|
|
1342
|
+
return this.rest.post(import_v105.Routes.guildEmojis(guildId), {
|
|
1203
1343
|
reason,
|
|
1204
1344
|
body,
|
|
1205
1345
|
signal
|
|
@@ -1215,7 +1355,7 @@ var GuildsAPI = class {
|
|
|
1215
1355
|
* @param options - The options for editing the emoji
|
|
1216
1356
|
*/
|
|
1217
1357
|
async editEmoji(guildId, emojiId, body, { reason, signal } = {}) {
|
|
1218
|
-
return this.rest.patch(
|
|
1358
|
+
return this.rest.patch(import_v105.Routes.guildEmoji(guildId, emojiId), {
|
|
1219
1359
|
reason,
|
|
1220
1360
|
body,
|
|
1221
1361
|
signal
|
|
@@ -1230,7 +1370,7 @@ var GuildsAPI = class {
|
|
|
1230
1370
|
* @param options - The options for deleting the emoji
|
|
1231
1371
|
*/
|
|
1232
1372
|
async deleteEmoji(guildId, emojiId, { reason, signal } = {}) {
|
|
1233
|
-
await this.rest.delete(
|
|
1373
|
+
await this.rest.delete(import_v105.Routes.guildEmoji(guildId, emojiId), { reason, signal });
|
|
1234
1374
|
}
|
|
1235
1375
|
/**
|
|
1236
1376
|
* Fetches all scheduled events for a guild
|
|
@@ -1241,7 +1381,7 @@ var GuildsAPI = class {
|
|
|
1241
1381
|
* @param options - The options for fetching the scheduled events
|
|
1242
1382
|
*/
|
|
1243
1383
|
async getScheduledEvents(guildId, query = {}, { signal } = {}) {
|
|
1244
|
-
return this.rest.get(
|
|
1384
|
+
return this.rest.get(import_v105.Routes.guildScheduledEvents(guildId), {
|
|
1245
1385
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1246
1386
|
signal
|
|
1247
1387
|
});
|
|
@@ -1255,7 +1395,7 @@ var GuildsAPI = class {
|
|
|
1255
1395
|
* @param options - The options for creating the scheduled event
|
|
1256
1396
|
*/
|
|
1257
1397
|
async createScheduledEvent(guildId, body, { reason, signal } = {}) {
|
|
1258
|
-
return this.rest.post(
|
|
1398
|
+
return this.rest.post(import_v105.Routes.guildScheduledEvents(guildId), {
|
|
1259
1399
|
reason,
|
|
1260
1400
|
body,
|
|
1261
1401
|
signal
|
|
@@ -1271,7 +1411,7 @@ var GuildsAPI = class {
|
|
|
1271
1411
|
* @param options - The options for fetching the scheduled event
|
|
1272
1412
|
*/
|
|
1273
1413
|
async getScheduledEvent(guildId, eventId, query = {}, { signal } = {}) {
|
|
1274
|
-
return this.rest.get(
|
|
1414
|
+
return this.rest.get(import_v105.Routes.guildScheduledEvent(guildId, eventId), {
|
|
1275
1415
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1276
1416
|
signal
|
|
1277
1417
|
});
|
|
@@ -1286,7 +1426,7 @@ var GuildsAPI = class {
|
|
|
1286
1426
|
* @param options - The options for editing the scheduled event
|
|
1287
1427
|
*/
|
|
1288
1428
|
async editScheduledEvent(guildId, eventId, body, { reason, signal } = {}) {
|
|
1289
|
-
return this.rest.patch(
|
|
1429
|
+
return this.rest.patch(import_v105.Routes.guildScheduledEvent(guildId, eventId), {
|
|
1290
1430
|
reason,
|
|
1291
1431
|
body,
|
|
1292
1432
|
signal
|
|
@@ -1301,7 +1441,7 @@ var GuildsAPI = class {
|
|
|
1301
1441
|
* @param options - The options for deleting the scheduled event
|
|
1302
1442
|
*/
|
|
1303
1443
|
async deleteScheduledEvent(guildId, eventId, { reason, signal } = {}) {
|
|
1304
|
-
await this.rest.delete(
|
|
1444
|
+
await this.rest.delete(import_v105.Routes.guildScheduledEvent(guildId, eventId), { reason, signal });
|
|
1305
1445
|
}
|
|
1306
1446
|
/**
|
|
1307
1447
|
* Gets all users that are interested in a scheduled event
|
|
@@ -1313,7 +1453,7 @@ var GuildsAPI = class {
|
|
|
1313
1453
|
* @param options - The options for fetching the scheduled event users
|
|
1314
1454
|
*/
|
|
1315
1455
|
async getScheduledEventUsers(guildId, eventId, query = {}, { signal } = {}) {
|
|
1316
|
-
return this.rest.get(
|
|
1456
|
+
return this.rest.get(import_v105.Routes.guildScheduledEventUsers(guildId, eventId), {
|
|
1317
1457
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1318
1458
|
signal
|
|
1319
1459
|
});
|
|
@@ -1326,7 +1466,7 @@ var GuildsAPI = class {
|
|
|
1326
1466
|
* @param options - The options for fetching the templates
|
|
1327
1467
|
*/
|
|
1328
1468
|
async getTemplates(guildId, { signal } = {}) {
|
|
1329
|
-
return this.rest.get(
|
|
1469
|
+
return this.rest.get(import_v105.Routes.guildTemplates(guildId), { signal });
|
|
1330
1470
|
}
|
|
1331
1471
|
/**
|
|
1332
1472
|
* Syncs a template for a guild
|
|
@@ -1337,7 +1477,7 @@ var GuildsAPI = class {
|
|
|
1337
1477
|
* @param options - The options for syncing the template
|
|
1338
1478
|
*/
|
|
1339
1479
|
async syncTemplate(guildId, templateCode, { signal } = {}) {
|
|
1340
|
-
return this.rest.put(
|
|
1480
|
+
return this.rest.put(import_v105.Routes.guildTemplate(guildId, templateCode), {
|
|
1341
1481
|
signal
|
|
1342
1482
|
});
|
|
1343
1483
|
}
|
|
@@ -1351,7 +1491,7 @@ var GuildsAPI = class {
|
|
|
1351
1491
|
* @param options - The options for editing the template
|
|
1352
1492
|
*/
|
|
1353
1493
|
async editTemplate(guildId, templateCode, body, { signal } = {}) {
|
|
1354
|
-
return this.rest.patch(
|
|
1494
|
+
return this.rest.patch(import_v105.Routes.guildTemplate(guildId, templateCode), {
|
|
1355
1495
|
body,
|
|
1356
1496
|
signal
|
|
1357
1497
|
});
|
|
@@ -1365,7 +1505,7 @@ var GuildsAPI = class {
|
|
|
1365
1505
|
* @param options - The options for deleting the template
|
|
1366
1506
|
*/
|
|
1367
1507
|
async deleteTemplate(guildId, templateCode, { signal } = {}) {
|
|
1368
|
-
await this.rest.delete(
|
|
1508
|
+
await this.rest.delete(import_v105.Routes.guildTemplate(guildId, templateCode), { signal });
|
|
1369
1509
|
}
|
|
1370
1510
|
/**
|
|
1371
1511
|
* Fetches all the stickers for a guild
|
|
@@ -1375,7 +1515,7 @@ var GuildsAPI = class {
|
|
|
1375
1515
|
* @param options - The options for fetching the stickers
|
|
1376
1516
|
*/
|
|
1377
1517
|
async getStickers(guildId, { signal } = {}) {
|
|
1378
|
-
return this.rest.get(
|
|
1518
|
+
return this.rest.get(import_v105.Routes.guildStickers(guildId), { signal });
|
|
1379
1519
|
}
|
|
1380
1520
|
/**
|
|
1381
1521
|
* Fetches a sticker for a guild
|
|
@@ -1386,7 +1526,7 @@ var GuildsAPI = class {
|
|
|
1386
1526
|
* @param options - The options for fetching the sticker
|
|
1387
1527
|
*/
|
|
1388
1528
|
async getSticker(guildId, stickerId, { signal } = {}) {
|
|
1389
|
-
return this.rest.get(
|
|
1529
|
+
return this.rest.get(import_v105.Routes.guildSticker(guildId, stickerId), { signal });
|
|
1390
1530
|
}
|
|
1391
1531
|
/**
|
|
1392
1532
|
* Creates a sticker for a guild
|
|
@@ -1398,7 +1538,7 @@ var GuildsAPI = class {
|
|
|
1398
1538
|
*/
|
|
1399
1539
|
async createSticker(guildId, { file, ...body }, { reason, signal } = {}) {
|
|
1400
1540
|
const fileData = { ...file, key: "file" };
|
|
1401
|
-
return this.rest.post(
|
|
1541
|
+
return this.rest.post(import_v105.Routes.guildStickers(guildId), {
|
|
1402
1542
|
appendToFormData: true,
|
|
1403
1543
|
body,
|
|
1404
1544
|
files: [fileData],
|
|
@@ -1416,7 +1556,7 @@ var GuildsAPI = class {
|
|
|
1416
1556
|
* @param options - The options for editing the sticker
|
|
1417
1557
|
*/
|
|
1418
1558
|
async editSticker(guildId, stickerId, body, { reason, signal } = {}) {
|
|
1419
|
-
return this.rest.patch(
|
|
1559
|
+
return this.rest.patch(import_v105.Routes.guildSticker(guildId, stickerId), {
|
|
1420
1560
|
reason,
|
|
1421
1561
|
body,
|
|
1422
1562
|
signal
|
|
@@ -1431,7 +1571,7 @@ var GuildsAPI = class {
|
|
|
1431
1571
|
* @param options - The options for deleting the sticker
|
|
1432
1572
|
*/
|
|
1433
1573
|
async deleteSticker(guildId, stickerId, { reason, signal } = {}) {
|
|
1434
|
-
await this.rest.delete(
|
|
1574
|
+
await this.rest.delete(import_v105.Routes.guildSticker(guildId, stickerId), { reason, signal });
|
|
1435
1575
|
}
|
|
1436
1576
|
/**
|
|
1437
1577
|
* Fetches the audit logs for a guild
|
|
@@ -1442,7 +1582,7 @@ var GuildsAPI = class {
|
|
|
1442
1582
|
* @param options - The options for fetching the audit logs
|
|
1443
1583
|
*/
|
|
1444
1584
|
async getAuditLogs(guildId, query = {}, { signal } = {}) {
|
|
1445
|
-
return this.rest.get(
|
|
1585
|
+
return this.rest.get(import_v105.Routes.guildAuditLog(guildId), {
|
|
1446
1586
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1447
1587
|
signal
|
|
1448
1588
|
});
|
|
@@ -1455,7 +1595,7 @@ var GuildsAPI = class {
|
|
|
1455
1595
|
* @param options - The options for fetching the auto moderation rules
|
|
1456
1596
|
*/
|
|
1457
1597
|
async getAutoModerationRules(guildId, { signal } = {}) {
|
|
1458
|
-
return this.rest.get(
|
|
1598
|
+
return this.rest.get(import_v105.Routes.guildAutoModerationRules(guildId), {
|
|
1459
1599
|
signal
|
|
1460
1600
|
});
|
|
1461
1601
|
}
|
|
@@ -1468,7 +1608,7 @@ var GuildsAPI = class {
|
|
|
1468
1608
|
* @param options - The options for fetching the auto moderation rule
|
|
1469
1609
|
*/
|
|
1470
1610
|
async getAutoModerationRule(guildId, ruleId, { signal } = {}) {
|
|
1471
|
-
return this.rest.get(
|
|
1611
|
+
return this.rest.get(import_v105.Routes.guildAutoModerationRule(guildId, ruleId), {
|
|
1472
1612
|
signal
|
|
1473
1613
|
});
|
|
1474
1614
|
}
|
|
@@ -1481,7 +1621,7 @@ var GuildsAPI = class {
|
|
|
1481
1621
|
* @param options - The options for creating the auto moderation rule
|
|
1482
1622
|
*/
|
|
1483
1623
|
async createAutoModerationRule(guildId, body, { reason, signal } = {}) {
|
|
1484
|
-
return this.rest.post(
|
|
1624
|
+
return this.rest.post(import_v105.Routes.guildAutoModerationRules(guildId), {
|
|
1485
1625
|
reason,
|
|
1486
1626
|
body,
|
|
1487
1627
|
signal
|
|
@@ -1497,7 +1637,7 @@ var GuildsAPI = class {
|
|
|
1497
1637
|
* @param options - The options for editing the auto moderation rule
|
|
1498
1638
|
*/
|
|
1499
1639
|
async editAutoModerationRule(guildId, ruleId, body, { reason, signal } = {}) {
|
|
1500
|
-
return this.rest.patch(
|
|
1640
|
+
return this.rest.patch(import_v105.Routes.guildAutoModerationRule(guildId, ruleId), {
|
|
1501
1641
|
reason,
|
|
1502
1642
|
body,
|
|
1503
1643
|
signal
|
|
@@ -1512,7 +1652,7 @@ var GuildsAPI = class {
|
|
|
1512
1652
|
* @param options - The options for deleting the auto moderation rule
|
|
1513
1653
|
*/
|
|
1514
1654
|
async deleteAutoModerationRule(guildId, ruleId, { reason, signal } = {}) {
|
|
1515
|
-
await this.rest.delete(
|
|
1655
|
+
await this.rest.delete(import_v105.Routes.guildAutoModerationRule(guildId, ruleId), { reason, signal });
|
|
1516
1656
|
}
|
|
1517
1657
|
/**
|
|
1518
1658
|
* Fetches a guild member
|
|
@@ -1523,7 +1663,7 @@ var GuildsAPI = class {
|
|
|
1523
1663
|
* @param options - The options for fetching the guild member
|
|
1524
1664
|
*/
|
|
1525
1665
|
async getMember(guildId, userId, { signal } = {}) {
|
|
1526
|
-
return this.rest.get(
|
|
1666
|
+
return this.rest.get(import_v105.Routes.guildMember(guildId, userId), { signal });
|
|
1527
1667
|
}
|
|
1528
1668
|
/**
|
|
1529
1669
|
* Searches for guild members
|
|
@@ -1534,7 +1674,7 @@ var GuildsAPI = class {
|
|
|
1534
1674
|
* @param options - The options for searching for guild members
|
|
1535
1675
|
*/
|
|
1536
1676
|
async searchForMembers(guildId, query, { signal } = {}) {
|
|
1537
|
-
return this.rest.get(
|
|
1677
|
+
return this.rest.get(import_v105.Routes.guildMembersSearch(guildId), {
|
|
1538
1678
|
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1539
1679
|
signal
|
|
1540
1680
|
});
|
|
@@ -1549,7 +1689,7 @@ var GuildsAPI = class {
|
|
|
1549
1689
|
* @param options - The options for editing the guild member
|
|
1550
1690
|
*/
|
|
1551
1691
|
async editMember(guildId, userId, body = {}, { reason, signal } = {}) {
|
|
1552
|
-
return this.rest.patch(
|
|
1692
|
+
return this.rest.patch(import_v105.Routes.guildMember(guildId, userId), {
|
|
1553
1693
|
reason,
|
|
1554
1694
|
body,
|
|
1555
1695
|
signal
|
|
@@ -1564,7 +1704,7 @@ var GuildsAPI = class {
|
|
|
1564
1704
|
* @param options - The options for removing the guild member
|
|
1565
1705
|
*/
|
|
1566
1706
|
async removeMember(guildId, userId, { reason, signal } = {}) {
|
|
1567
|
-
return this.rest.delete(
|
|
1707
|
+
return this.rest.delete(import_v105.Routes.guildMember(guildId, userId), { reason, signal });
|
|
1568
1708
|
}
|
|
1569
1709
|
/**
|
|
1570
1710
|
* Adds a role to a guild member
|
|
@@ -1576,7 +1716,7 @@ var GuildsAPI = class {
|
|
|
1576
1716
|
* @param options - The options for adding a role to a guild member
|
|
1577
1717
|
*/
|
|
1578
1718
|
async addRoleToMember(guildId, userId, roleId, { reason, signal } = {}) {
|
|
1579
|
-
await this.rest.put(
|
|
1719
|
+
await this.rest.put(import_v105.Routes.guildMemberRole(guildId, userId, roleId), { reason, signal });
|
|
1580
1720
|
}
|
|
1581
1721
|
/**
|
|
1582
1722
|
* Removes a role from a guild member
|
|
@@ -1588,7 +1728,7 @@ var GuildsAPI = class {
|
|
|
1588
1728
|
* @param options - The options for removing a role from a guild member
|
|
1589
1729
|
*/
|
|
1590
1730
|
async removeRoleFromMember(guildId, userId, roleId, { reason, signal } = {}) {
|
|
1591
|
-
await this.rest.delete(
|
|
1731
|
+
await this.rest.delete(import_v105.Routes.guildMemberRole(guildId, userId, roleId), { reason, signal });
|
|
1592
1732
|
}
|
|
1593
1733
|
/**
|
|
1594
1734
|
* Fetches a guild template
|
|
@@ -1598,7 +1738,7 @@ var GuildsAPI = class {
|
|
|
1598
1738
|
* @param options - The options for fetching the guild template
|
|
1599
1739
|
*/
|
|
1600
1740
|
async getTemplate(templateCode, { signal } = {}) {
|
|
1601
|
-
return this.rest.get(
|
|
1741
|
+
return this.rest.get(import_v105.Routes.template(templateCode), { signal });
|
|
1602
1742
|
}
|
|
1603
1743
|
/**
|
|
1604
1744
|
* Creates a new template
|
|
@@ -1609,7 +1749,7 @@ var GuildsAPI = class {
|
|
|
1609
1749
|
* @param options - The options for creating the template
|
|
1610
1750
|
*/
|
|
1611
1751
|
async createTemplate(templateCode, body, { signal } = {}) {
|
|
1612
|
-
return this.rest.post(
|
|
1752
|
+
return this.rest.post(import_v105.Routes.template(templateCode), { body, signal });
|
|
1613
1753
|
}
|
|
1614
1754
|
/**
|
|
1615
1755
|
* Fetches webhooks for a guild
|
|
@@ -1618,19 +1758,19 @@ var GuildsAPI = class {
|
|
|
1618
1758
|
* @param id - The id of the guild
|
|
1619
1759
|
*/
|
|
1620
1760
|
async getWebhooks(id) {
|
|
1621
|
-
return this.rest.get(
|
|
1761
|
+
return this.rest.get(import_v105.Routes.guildWebhooks(id));
|
|
1622
1762
|
}
|
|
1623
1763
|
/**
|
|
1624
1764
|
* Sets the voice state for the current user
|
|
1625
1765
|
*
|
|
1626
|
-
* @see {@link https://discord.com/developers/docs/resources/
|
|
1766
|
+
* @see {@link https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state}
|
|
1627
1767
|
* @param guildId - The id of the guild
|
|
1628
|
-
* @param body - The
|
|
1768
|
+
* @param body - The data for setting the voice state
|
|
1769
|
+
* @param options - The options for setting the voice state
|
|
1770
|
+
* @deprecated Use {@link VoiceAPI.editVoiceState} instead
|
|
1629
1771
|
*/
|
|
1630
|
-
async setVoiceState(guildId, body = {}) {
|
|
1631
|
-
return this.rest.
|
|
1632
|
-
body
|
|
1633
|
-
});
|
|
1772
|
+
async setVoiceState(guildId, body = {}, { signal } = {}) {
|
|
1773
|
+
return new VoiceAPI(this.rest).editVoiceState(guildId, body, { signal });
|
|
1634
1774
|
}
|
|
1635
1775
|
/**
|
|
1636
1776
|
* Fetches a guild onboarding
|
|
@@ -1640,7 +1780,7 @@ var GuildsAPI = class {
|
|
|
1640
1780
|
* @param options - The options for fetching the guild onboarding
|
|
1641
1781
|
*/
|
|
1642
1782
|
async getOnboarding(guildId, { signal } = {}) {
|
|
1643
|
-
return this.rest.get(
|
|
1783
|
+
return this.rest.get(import_v105.Routes.guildOnboarding(guildId), { signal });
|
|
1644
1784
|
}
|
|
1645
1785
|
/**
|
|
1646
1786
|
* Edits a guild onboarding
|
|
@@ -1651,7 +1791,7 @@ var GuildsAPI = class {
|
|
|
1651
1791
|
* @param options - The options for editing the guild onboarding
|
|
1652
1792
|
*/
|
|
1653
1793
|
async editOnboarding(guildId, body, { reason, signal } = {}) {
|
|
1654
|
-
return this.rest.put(
|
|
1794
|
+
return this.rest.put(import_v105.Routes.guildOnboarding(guildId), {
|
|
1655
1795
|
reason,
|
|
1656
1796
|
body,
|
|
1657
1797
|
signal
|
|
@@ -1660,7 +1800,7 @@ var GuildsAPI = class {
|
|
|
1660
1800
|
};
|
|
1661
1801
|
|
|
1662
1802
|
// src/api/interactions.ts
|
|
1663
|
-
var
|
|
1803
|
+
var import_v106 = require("discord-api-types/v10");
|
|
1664
1804
|
var InteractionsAPI = class {
|
|
1665
1805
|
constructor(rest, webhooks) {
|
|
1666
1806
|
this.rest = rest;
|
|
@@ -1679,11 +1819,11 @@ var InteractionsAPI = class {
|
|
|
1679
1819
|
* @param options - The options for replying
|
|
1680
1820
|
*/
|
|
1681
1821
|
async reply(interactionId, interactionToken, { files, ...data }, { signal } = {}) {
|
|
1682
|
-
await this.rest.post(
|
|
1822
|
+
await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1683
1823
|
files,
|
|
1684
1824
|
auth: false,
|
|
1685
1825
|
body: {
|
|
1686
|
-
type:
|
|
1826
|
+
type: import_v106.InteractionResponseType.ChannelMessageWithSource,
|
|
1687
1827
|
data
|
|
1688
1828
|
},
|
|
1689
1829
|
signal
|
|
@@ -1699,10 +1839,10 @@ var InteractionsAPI = class {
|
|
|
1699
1839
|
* @param options - The options for deferring
|
|
1700
1840
|
*/
|
|
1701
1841
|
async defer(interactionId, interactionToken, data, { signal } = {}) {
|
|
1702
|
-
await this.rest.post(
|
|
1842
|
+
await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1703
1843
|
auth: false,
|
|
1704
1844
|
body: {
|
|
1705
|
-
type:
|
|
1845
|
+
type: import_v106.InteractionResponseType.DeferredChannelMessageWithSource,
|
|
1706
1846
|
data
|
|
1707
1847
|
},
|
|
1708
1848
|
signal
|
|
@@ -1717,10 +1857,10 @@ var InteractionsAPI = class {
|
|
|
1717
1857
|
* @param options - The options for deferring
|
|
1718
1858
|
*/
|
|
1719
1859
|
async deferMessageUpdate(interactionId, interactionToken, { signal } = {}) {
|
|
1720
|
-
await this.rest.post(
|
|
1860
|
+
await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1721
1861
|
auth: false,
|
|
1722
1862
|
body: {
|
|
1723
|
-
type:
|
|
1863
|
+
type: import_v106.InteractionResponseType.DeferredMessageUpdate
|
|
1724
1864
|
},
|
|
1725
1865
|
signal
|
|
1726
1866
|
});
|
|
@@ -1793,11 +1933,11 @@ var InteractionsAPI = class {
|
|
|
1793
1933
|
* @param options - The options for updating the interaction
|
|
1794
1934
|
*/
|
|
1795
1935
|
async updateMessage(interactionId, interactionToken, { files, ...data }, { signal } = {}) {
|
|
1796
|
-
await this.rest.post(
|
|
1936
|
+
await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1797
1937
|
files,
|
|
1798
1938
|
auth: false,
|
|
1799
1939
|
body: {
|
|
1800
|
-
type:
|
|
1940
|
+
type: import_v106.InteractionResponseType.UpdateMessage,
|
|
1801
1941
|
data
|
|
1802
1942
|
},
|
|
1803
1943
|
signal
|
|
@@ -1813,10 +1953,10 @@ var InteractionsAPI = class {
|
|
|
1813
1953
|
* @param options - The options for sending the autocomplete response
|
|
1814
1954
|
*/
|
|
1815
1955
|
async createAutocompleteResponse(interactionId, interactionToken, callbackData, { signal } = {}) {
|
|
1816
|
-
await this.rest.post(
|
|
1956
|
+
await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1817
1957
|
auth: false,
|
|
1818
1958
|
body: {
|
|
1819
|
-
type:
|
|
1959
|
+
type: import_v106.InteractionResponseType.ApplicationCommandAutocompleteResult,
|
|
1820
1960
|
data: callbackData
|
|
1821
1961
|
},
|
|
1822
1962
|
signal
|
|
@@ -1832,10 +1972,10 @@ var InteractionsAPI = class {
|
|
|
1832
1972
|
* @param options - The options for sending the modal
|
|
1833
1973
|
*/
|
|
1834
1974
|
async createModal(interactionId, interactionToken, callbackData, { signal } = {}) {
|
|
1835
|
-
await this.rest.post(
|
|
1975
|
+
await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1836
1976
|
auth: false,
|
|
1837
1977
|
body: {
|
|
1838
|
-
type:
|
|
1978
|
+
type: import_v106.InteractionResponseType.Modal,
|
|
1839
1979
|
data: callbackData
|
|
1840
1980
|
},
|
|
1841
1981
|
signal
|
|
@@ -1851,10 +1991,10 @@ var InteractionsAPI = class {
|
|
|
1851
1991
|
* @deprecated Sending a premium-style button is the new Discord behaviour.
|
|
1852
1992
|
*/
|
|
1853
1993
|
async sendPremiumRequired(interactionId, interactionToken, { signal } = {}) {
|
|
1854
|
-
await this.rest.post(
|
|
1994
|
+
await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1855
1995
|
auth: false,
|
|
1856
1996
|
body: {
|
|
1857
|
-
type:
|
|
1997
|
+
type: import_v106.InteractionResponseType.PremiumRequired
|
|
1858
1998
|
},
|
|
1859
1999
|
signal
|
|
1860
2000
|
});
|
|
@@ -1863,7 +2003,7 @@ var InteractionsAPI = class {
|
|
|
1863
2003
|
|
|
1864
2004
|
// src/api/invite.ts
|
|
1865
2005
|
var import_rest4 = require("@discordjs/rest");
|
|
1866
|
-
var
|
|
2006
|
+
var import_v107 = require("discord-api-types/v10");
|
|
1867
2007
|
var InvitesAPI = class {
|
|
1868
2008
|
constructor(rest) {
|
|
1869
2009
|
this.rest = rest;
|
|
@@ -1880,7 +2020,7 @@ var InvitesAPI = class {
|
|
|
1880
2020
|
* @param options - The options for fetching the invite
|
|
1881
2021
|
*/
|
|
1882
2022
|
async get(code, query = {}, { signal } = {}) {
|
|
1883
|
-
return this.rest.get(
|
|
2023
|
+
return this.rest.get(import_v107.Routes.invite(code), {
|
|
1884
2024
|
query: (0, import_rest4.makeURLSearchParams)(query),
|
|
1885
2025
|
signal
|
|
1886
2026
|
});
|
|
@@ -1893,13 +2033,13 @@ var InvitesAPI = class {
|
|
|
1893
2033
|
* @param options - The options for deleting the invite
|
|
1894
2034
|
*/
|
|
1895
2035
|
async delete(code, { reason, signal } = {}) {
|
|
1896
|
-
await this.rest.delete(
|
|
2036
|
+
await this.rest.delete(import_v107.Routes.invite(code), { reason, signal });
|
|
1897
2037
|
}
|
|
1898
2038
|
};
|
|
1899
2039
|
|
|
1900
2040
|
// src/api/monetization.ts
|
|
1901
2041
|
var import_rest5 = require("@discordjs/rest");
|
|
1902
|
-
var
|
|
2042
|
+
var import_v108 = require("discord-api-types/v10");
|
|
1903
2043
|
var MonetizationAPI = class {
|
|
1904
2044
|
constructor(rest) {
|
|
1905
2045
|
this.rest = rest;
|
|
@@ -1914,7 +2054,7 @@ var MonetizationAPI = class {
|
|
|
1914
2054
|
* @param options - The options for fetching the SKUs.
|
|
1915
2055
|
*/
|
|
1916
2056
|
async getSKUs(applicationId, { signal } = {}) {
|
|
1917
|
-
return this.rest.get(
|
|
2057
|
+
return this.rest.get(import_v108.Routes.skus(applicationId), { signal });
|
|
1918
2058
|
}
|
|
1919
2059
|
/**
|
|
1920
2060
|
* Fetches the entitlements for an application.
|
|
@@ -1925,7 +2065,7 @@ var MonetizationAPI = class {
|
|
|
1925
2065
|
* @param options - The options for fetching entitlements
|
|
1926
2066
|
*/
|
|
1927
2067
|
async getEntitlements(applicationId, query, { signal } = {}) {
|
|
1928
|
-
return this.rest.get(
|
|
2068
|
+
return this.rest.get(import_v108.Routes.entitlements(applicationId), {
|
|
1929
2069
|
signal,
|
|
1930
2070
|
query: (0, import_rest5.makeURLSearchParams)(query)
|
|
1931
2071
|
});
|
|
@@ -1939,7 +2079,7 @@ var MonetizationAPI = class {
|
|
|
1939
2079
|
* @param options - The options for creating the entitlement
|
|
1940
2080
|
*/
|
|
1941
2081
|
async createTestEntitlement(applicationId, body, { signal } = {}) {
|
|
1942
|
-
return this.rest.post(
|
|
2082
|
+
return this.rest.post(import_v108.Routes.entitlements(applicationId), {
|
|
1943
2083
|
body,
|
|
1944
2084
|
signal
|
|
1945
2085
|
});
|
|
@@ -1953,7 +2093,7 @@ var MonetizationAPI = class {
|
|
|
1953
2093
|
* @param options - The options for deleting the entitlement
|
|
1954
2094
|
*/
|
|
1955
2095
|
async deleteTestEntitlement(applicationId, entitlementId, { signal } = {}) {
|
|
1956
|
-
await this.rest.delete(
|
|
2096
|
+
await this.rest.delete(import_v108.Routes.entitlement(applicationId, entitlementId), { signal });
|
|
1957
2097
|
}
|
|
1958
2098
|
/**
|
|
1959
2099
|
* Marks a given entitlement for the user as consumed. Only available for One-Time Purchase consumable SKUs.
|
|
@@ -1964,13 +2104,13 @@ var MonetizationAPI = class {
|
|
|
1964
2104
|
* @param options - The options for consuming the entitlement
|
|
1965
2105
|
*/
|
|
1966
2106
|
async consumeEntitlement(applicationId, entitlementId, { signal } = {}) {
|
|
1967
|
-
await this.rest.post(
|
|
2107
|
+
await this.rest.post(import_v108.Routes.consumeEntitlement(applicationId, entitlementId), { signal });
|
|
1968
2108
|
}
|
|
1969
2109
|
};
|
|
1970
2110
|
|
|
1971
2111
|
// src/api/oauth2.ts
|
|
1972
2112
|
var import_rest6 = require("@discordjs/rest");
|
|
1973
|
-
var
|
|
2113
|
+
var import_v109 = require("discord-api-types/v10");
|
|
1974
2114
|
var OAuth2API = class {
|
|
1975
2115
|
constructor(rest) {
|
|
1976
2116
|
this.rest = rest;
|
|
@@ -1985,7 +2125,7 @@ var OAuth2API = class {
|
|
|
1985
2125
|
* @param options - The options for creating the authorization URL
|
|
1986
2126
|
*/
|
|
1987
2127
|
generateAuthorizationURL(options) {
|
|
1988
|
-
const url = new URL(`${
|
|
2128
|
+
const url = new URL(`${import_v109.RouteBases.api}${import_v109.Routes.oauth2Authorization()}`);
|
|
1989
2129
|
url.search = (0, import_rest6.makeURLSearchParams)(options).toString();
|
|
1990
2130
|
return url.toString();
|
|
1991
2131
|
}
|
|
@@ -1997,7 +2137,7 @@ var OAuth2API = class {
|
|
|
1997
2137
|
* @param options - The options for the token exchange request
|
|
1998
2138
|
*/
|
|
1999
2139
|
async tokenExchange(body, { signal } = {}) {
|
|
2000
|
-
return this.rest.post(
|
|
2140
|
+
return this.rest.post(import_v109.Routes.oauth2TokenExchange(), {
|
|
2001
2141
|
body: (0, import_rest6.makeURLSearchParams)(body),
|
|
2002
2142
|
passThroughBody: true,
|
|
2003
2143
|
headers: {
|
|
@@ -2015,7 +2155,7 @@ var OAuth2API = class {
|
|
|
2015
2155
|
* @param options - The options for the refresh token request
|
|
2016
2156
|
*/
|
|
2017
2157
|
async refreshToken(body, { signal } = {}) {
|
|
2018
|
-
return this.rest.post(
|
|
2158
|
+
return this.rest.post(import_v109.Routes.oauth2TokenExchange(), {
|
|
2019
2159
|
body: (0, import_rest6.makeURLSearchParams)(body),
|
|
2020
2160
|
passThroughBody: true,
|
|
2021
2161
|
headers: {
|
|
@@ -2035,7 +2175,7 @@ var OAuth2API = class {
|
|
|
2035
2175
|
* @param options - The options for the client credentials grant request
|
|
2036
2176
|
*/
|
|
2037
2177
|
async getToken(body, { signal } = {}) {
|
|
2038
|
-
return this.rest.post(
|
|
2178
|
+
return this.rest.post(import_v109.Routes.oauth2TokenExchange(), {
|
|
2039
2179
|
body: (0, import_rest6.makeURLSearchParams)(body),
|
|
2040
2180
|
passThroughBody: true,
|
|
2041
2181
|
headers: {
|
|
@@ -2052,7 +2192,7 @@ var OAuth2API = class {
|
|
|
2052
2192
|
* @param options - The options for the current bot application information request
|
|
2053
2193
|
*/
|
|
2054
2194
|
async getCurrentBotApplicationInformation({ signal } = {}) {
|
|
2055
|
-
return this.rest.get(
|
|
2195
|
+
return this.rest.get(import_v109.Routes.oauth2CurrentApplication(), {
|
|
2056
2196
|
signal
|
|
2057
2197
|
});
|
|
2058
2198
|
}
|
|
@@ -2063,7 +2203,28 @@ var OAuth2API = class {
|
|
|
2063
2203
|
* @param options - The options for the current authorization information request
|
|
2064
2204
|
*/
|
|
2065
2205
|
async getCurrentAuthorizationInformation({ signal } = {}) {
|
|
2066
|
-
return this.rest.get(
|
|
2206
|
+
return this.rest.get(import_v109.Routes.oauth2CurrentAuthorization(), {
|
|
2207
|
+
signal
|
|
2208
|
+
});
|
|
2209
|
+
}
|
|
2210
|
+
/**
|
|
2211
|
+
* Revokes an OAuth2 token
|
|
2212
|
+
*
|
|
2213
|
+
* @see {@link https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-token-revocation-example}
|
|
2214
|
+
* @param applicationId - The application id
|
|
2215
|
+
* @param applicationSecret - The application secret
|
|
2216
|
+
* @param body - The body of the token revocation request
|
|
2217
|
+
* @param options - The options for the token revocation request
|
|
2218
|
+
*/
|
|
2219
|
+
async revokeToken(applicationId, applicationSecret, body, { signal } = {}) {
|
|
2220
|
+
await this.rest.post(import_v109.Routes.oauth2TokenRevocation(), {
|
|
2221
|
+
body: (0, import_rest6.makeURLSearchParams)(body),
|
|
2222
|
+
passThroughBody: true,
|
|
2223
|
+
headers: {
|
|
2224
|
+
Authorization: `Basic ${btoa(`${applicationId}:${applicationSecret}`)}`,
|
|
2225
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
2226
|
+
},
|
|
2227
|
+
auth: false,
|
|
2067
2228
|
signal
|
|
2068
2229
|
});
|
|
2069
2230
|
}
|
|
@@ -2071,7 +2232,7 @@ var OAuth2API = class {
|
|
|
2071
2232
|
|
|
2072
2233
|
// src/api/poll.ts
|
|
2073
2234
|
var import_rest7 = require("@discordjs/rest");
|
|
2074
|
-
var
|
|
2235
|
+
var import_v1010 = require("discord-api-types/v10");
|
|
2075
2236
|
var PollAPI = class {
|
|
2076
2237
|
constructor(rest) {
|
|
2077
2238
|
this.rest = rest;
|
|
@@ -2090,7 +2251,7 @@ var PollAPI = class {
|
|
|
2090
2251
|
* @param options - The options for getting the list of voters
|
|
2091
2252
|
*/
|
|
2092
2253
|
async getAnswerVoters(channelId, messageId, answerId, query, { signal } = {}) {
|
|
2093
|
-
return this.rest.get(
|
|
2254
|
+
return this.rest.get(import_v1010.Routes.pollAnswerVoters(channelId, messageId, answerId), {
|
|
2094
2255
|
signal,
|
|
2095
2256
|
query: (0, import_rest7.makeURLSearchParams)(query)
|
|
2096
2257
|
});
|
|
@@ -2104,14 +2265,14 @@ var PollAPI = class {
|
|
|
2104
2265
|
* @param options - The options for expiring the poll
|
|
2105
2266
|
*/
|
|
2106
2267
|
async expirePoll(channelId, messageId, { signal } = {}) {
|
|
2107
|
-
return this.rest.post(
|
|
2268
|
+
return this.rest.post(import_v1010.Routes.expirePoll(channelId, messageId), {
|
|
2108
2269
|
signal
|
|
2109
2270
|
});
|
|
2110
2271
|
}
|
|
2111
2272
|
};
|
|
2112
2273
|
|
|
2113
2274
|
// src/api/roleConnections.ts
|
|
2114
|
-
var
|
|
2275
|
+
var import_v1011 = require("discord-api-types/v10");
|
|
2115
2276
|
var RoleConnectionsAPI = class {
|
|
2116
2277
|
constructor(rest) {
|
|
2117
2278
|
this.rest = rest;
|
|
@@ -2127,7 +2288,7 @@ var RoleConnectionsAPI = class {
|
|
|
2127
2288
|
* @param options - The options for fetching the role connection metadata records
|
|
2128
2289
|
*/
|
|
2129
2290
|
async getMetadataRecords(applicationId, { signal } = {}) {
|
|
2130
|
-
return this.rest.get(
|
|
2291
|
+
return this.rest.get(import_v1011.Routes.applicationRoleConnectionMetadata(applicationId), {
|
|
2131
2292
|
signal
|
|
2132
2293
|
});
|
|
2133
2294
|
}
|
|
@@ -2140,7 +2301,7 @@ var RoleConnectionsAPI = class {
|
|
|
2140
2301
|
* @param options - The options for updating the role connection metadata records
|
|
2141
2302
|
*/
|
|
2142
2303
|
async updateMetadataRecords(applicationId, body, { signal } = {}) {
|
|
2143
|
-
return this.rest.put(
|
|
2304
|
+
return this.rest.put(import_v1011.Routes.applicationRoleConnectionMetadata(applicationId), {
|
|
2144
2305
|
body,
|
|
2145
2306
|
signal
|
|
2146
2307
|
});
|
|
@@ -2148,7 +2309,7 @@ var RoleConnectionsAPI = class {
|
|
|
2148
2309
|
};
|
|
2149
2310
|
|
|
2150
2311
|
// src/api/stageInstances.ts
|
|
2151
|
-
var
|
|
2312
|
+
var import_v1012 = require("discord-api-types/v10");
|
|
2152
2313
|
var StageInstancesAPI = class {
|
|
2153
2314
|
constructor(rest) {
|
|
2154
2315
|
this.rest = rest;
|
|
@@ -2164,7 +2325,7 @@ var StageInstancesAPI = class {
|
|
|
2164
2325
|
* @param options - The options for creating the new stage instance
|
|
2165
2326
|
*/
|
|
2166
2327
|
async create(body, { reason, signal } = {}) {
|
|
2167
|
-
return this.rest.post(
|
|
2328
|
+
return this.rest.post(import_v1012.Routes.stageInstances(), {
|
|
2168
2329
|
body,
|
|
2169
2330
|
reason,
|
|
2170
2331
|
signal
|
|
@@ -2178,7 +2339,7 @@ var StageInstancesAPI = class {
|
|
|
2178
2339
|
* @param options - The options for fetching the stage instance
|
|
2179
2340
|
*/
|
|
2180
2341
|
async get(channelId, { signal } = {}) {
|
|
2181
|
-
return this.rest.get(
|
|
2342
|
+
return this.rest.get(import_v1012.Routes.stageInstance(channelId), { signal });
|
|
2182
2343
|
}
|
|
2183
2344
|
/**
|
|
2184
2345
|
* Edits a stage instance
|
|
@@ -2189,7 +2350,7 @@ var StageInstancesAPI = class {
|
|
|
2189
2350
|
* @param options - The options for editing the stage instance
|
|
2190
2351
|
*/
|
|
2191
2352
|
async edit(channelId, body, { reason, signal } = {}) {
|
|
2192
|
-
return this.rest.patch(
|
|
2353
|
+
return this.rest.patch(import_v1012.Routes.stageInstance(channelId), {
|
|
2193
2354
|
body,
|
|
2194
2355
|
reason,
|
|
2195
2356
|
signal
|
|
@@ -2203,12 +2364,12 @@ var StageInstancesAPI = class {
|
|
|
2203
2364
|
* @param options - The options for deleting the stage instance
|
|
2204
2365
|
*/
|
|
2205
2366
|
async delete(channelId, { reason, signal } = {}) {
|
|
2206
|
-
await this.rest.delete(
|
|
2367
|
+
await this.rest.delete(import_v1012.Routes.stageInstance(channelId), { reason, signal });
|
|
2207
2368
|
}
|
|
2208
2369
|
};
|
|
2209
2370
|
|
|
2210
2371
|
// src/api/sticker.ts
|
|
2211
|
-
var
|
|
2372
|
+
var import_v1013 = require("discord-api-types/v10");
|
|
2212
2373
|
var StickersAPI = class {
|
|
2213
2374
|
constructor(rest) {
|
|
2214
2375
|
this.rest = rest;
|
|
@@ -2216,6 +2377,16 @@ var StickersAPI = class {
|
|
|
2216
2377
|
static {
|
|
2217
2378
|
__name(this, "StickersAPI");
|
|
2218
2379
|
}
|
|
2380
|
+
/**
|
|
2381
|
+
* Fetches a sticker pack
|
|
2382
|
+
*
|
|
2383
|
+
* @see {@link https://discord.com/developers/docs/resources/sticker#get-sticker-pack}
|
|
2384
|
+
* @param packId - The id of the sticker pack
|
|
2385
|
+
* @param options - The options for fetching the sticker pack
|
|
2386
|
+
*/
|
|
2387
|
+
async getStickerPack(packId, { signal } = {}) {
|
|
2388
|
+
return this.rest.get(import_v1013.Routes.stickerPack(packId), { signal });
|
|
2389
|
+
}
|
|
2219
2390
|
/**
|
|
2220
2391
|
* Fetches all of the sticker packs
|
|
2221
2392
|
*
|
|
@@ -2223,7 +2394,7 @@ var StickersAPI = class {
|
|
|
2223
2394
|
* @param options - The options for fetching the sticker packs
|
|
2224
2395
|
*/
|
|
2225
2396
|
async getStickers({ signal } = {}) {
|
|
2226
|
-
return this.rest.get(
|
|
2397
|
+
return this.rest.get(import_v1013.Routes.stickerPacks(), { signal });
|
|
2227
2398
|
}
|
|
2228
2399
|
/**
|
|
2229
2400
|
* Fetches all of the sticker packs
|
|
@@ -2243,12 +2414,12 @@ var StickersAPI = class {
|
|
|
2243
2414
|
* @param options - The options for fetching the sticker
|
|
2244
2415
|
*/
|
|
2245
2416
|
async get(stickerId, { signal } = {}) {
|
|
2246
|
-
return this.rest.get(
|
|
2417
|
+
return this.rest.get(import_v1013.Routes.sticker(stickerId), { signal });
|
|
2247
2418
|
}
|
|
2248
2419
|
};
|
|
2249
2420
|
|
|
2250
2421
|
// src/api/thread.ts
|
|
2251
|
-
var
|
|
2422
|
+
var import_v1014 = require("discord-api-types/v10");
|
|
2252
2423
|
var ThreadsAPI = class {
|
|
2253
2424
|
constructor(rest) {
|
|
2254
2425
|
this.rest = rest;
|
|
@@ -2264,7 +2435,7 @@ var ThreadsAPI = class {
|
|
|
2264
2435
|
* @param options - The options for joining the thread
|
|
2265
2436
|
*/
|
|
2266
2437
|
async join(threadId, { signal } = {}) {
|
|
2267
|
-
await this.rest.put(
|
|
2438
|
+
await this.rest.put(import_v1014.Routes.threadMembers(threadId, "@me"), { signal });
|
|
2268
2439
|
}
|
|
2269
2440
|
/**
|
|
2270
2441
|
* Adds a member to a thread
|
|
@@ -2275,7 +2446,7 @@ var ThreadsAPI = class {
|
|
|
2275
2446
|
* @param options - The options for adding the member to the thread
|
|
2276
2447
|
*/
|
|
2277
2448
|
async addMember(threadId, userId, { signal } = {}) {
|
|
2278
|
-
await this.rest.put(
|
|
2449
|
+
await this.rest.put(import_v1014.Routes.threadMembers(threadId, userId), { signal });
|
|
2279
2450
|
}
|
|
2280
2451
|
/**
|
|
2281
2452
|
* Removes the current user from a thread
|
|
@@ -2285,7 +2456,7 @@ var ThreadsAPI = class {
|
|
|
2285
2456
|
* @param options - The options for leaving the thread
|
|
2286
2457
|
*/
|
|
2287
2458
|
async leave(threadId, { signal } = {}) {
|
|
2288
|
-
await this.rest.delete(
|
|
2459
|
+
await this.rest.delete(import_v1014.Routes.threadMembers(threadId, "@me"), { signal });
|
|
2289
2460
|
}
|
|
2290
2461
|
/**
|
|
2291
2462
|
* Removes a member from a thread
|
|
@@ -2296,7 +2467,7 @@ var ThreadsAPI = class {
|
|
|
2296
2467
|
* @param options - The options for removing the member from the thread
|
|
2297
2468
|
*/
|
|
2298
2469
|
async removeMember(threadId, userId, { signal } = {}) {
|
|
2299
|
-
await this.rest.delete(
|
|
2470
|
+
await this.rest.delete(import_v1014.Routes.threadMembers(threadId, userId), { signal });
|
|
2300
2471
|
}
|
|
2301
2472
|
/**
|
|
2302
2473
|
* Fetches a member of a thread
|
|
@@ -2307,7 +2478,7 @@ var ThreadsAPI = class {
|
|
|
2307
2478
|
* @param options - The options for fetching the member
|
|
2308
2479
|
*/
|
|
2309
2480
|
async getMember(threadId, userId, { signal } = {}) {
|
|
2310
|
-
return this.rest.get(
|
|
2481
|
+
return this.rest.get(import_v1014.Routes.threadMembers(threadId, userId), { signal });
|
|
2311
2482
|
}
|
|
2312
2483
|
/**
|
|
2313
2484
|
* Fetches all members of a thread
|
|
@@ -2317,13 +2488,13 @@ var ThreadsAPI = class {
|
|
|
2317
2488
|
* @param options - The options for fetching the members
|
|
2318
2489
|
*/
|
|
2319
2490
|
async getAllMembers(threadId, { signal } = {}) {
|
|
2320
|
-
return this.rest.get(
|
|
2491
|
+
return this.rest.get(import_v1014.Routes.threadMembers(threadId), { signal });
|
|
2321
2492
|
}
|
|
2322
2493
|
};
|
|
2323
2494
|
|
|
2324
2495
|
// src/api/user.ts
|
|
2325
2496
|
var import_rest8 = require("@discordjs/rest");
|
|
2326
|
-
var
|
|
2497
|
+
var import_v1015 = require("discord-api-types/v10");
|
|
2327
2498
|
var UsersAPI = class {
|
|
2328
2499
|
constructor(rest) {
|
|
2329
2500
|
this.rest = rest;
|
|
@@ -2339,7 +2510,7 @@ var UsersAPI = class {
|
|
|
2339
2510
|
* @param options - The options for fetching the user
|
|
2340
2511
|
*/
|
|
2341
2512
|
async get(userId, { signal } = {}) {
|
|
2342
|
-
return this.rest.get(
|
|
2513
|
+
return this.rest.get(import_v1015.Routes.user(userId), { signal });
|
|
2343
2514
|
}
|
|
2344
2515
|
/**
|
|
2345
2516
|
* Returns the user object of the requester's account
|
|
@@ -2348,7 +2519,7 @@ var UsersAPI = class {
|
|
|
2348
2519
|
* @param options - The options for fetching the current user
|
|
2349
2520
|
*/
|
|
2350
2521
|
async getCurrent({ signal } = {}) {
|
|
2351
|
-
return this.rest.get(
|
|
2522
|
+
return this.rest.get(import_v1015.Routes.user("@me"), { signal });
|
|
2352
2523
|
}
|
|
2353
2524
|
/**
|
|
2354
2525
|
* Returns a list of partial guild objects the current user is a member of
|
|
@@ -2358,7 +2529,7 @@ var UsersAPI = class {
|
|
|
2358
2529
|
* @param options - The options for fetching the guilds
|
|
2359
2530
|
*/
|
|
2360
2531
|
async getGuilds(query = {}, { signal } = {}) {
|
|
2361
|
-
return this.rest.get(
|
|
2532
|
+
return this.rest.get(import_v1015.Routes.userGuilds(), {
|
|
2362
2533
|
query: (0, import_rest8.makeURLSearchParams)(query),
|
|
2363
2534
|
signal
|
|
2364
2535
|
});
|
|
@@ -2371,7 +2542,7 @@ var UsersAPI = class {
|
|
|
2371
2542
|
* @param options - The options for leaving the guild
|
|
2372
2543
|
*/
|
|
2373
2544
|
async leaveGuild(guildId, { signal } = {}) {
|
|
2374
|
-
await this.rest.delete(
|
|
2545
|
+
await this.rest.delete(import_v1015.Routes.userGuild(guildId), { signal });
|
|
2375
2546
|
}
|
|
2376
2547
|
/**
|
|
2377
2548
|
* Edits the current user
|
|
@@ -2381,7 +2552,7 @@ var UsersAPI = class {
|
|
|
2381
2552
|
* @param options - The options for editing the user
|
|
2382
2553
|
*/
|
|
2383
2554
|
async edit(body, { signal } = {}) {
|
|
2384
|
-
return this.rest.patch(
|
|
2555
|
+
return this.rest.patch(import_v1015.Routes.user("@me"), { body, signal });
|
|
2385
2556
|
}
|
|
2386
2557
|
/**
|
|
2387
2558
|
* Fetches the guild member for the current user
|
|
@@ -2391,7 +2562,7 @@ var UsersAPI = class {
|
|
|
2391
2562
|
* @param options - The options for fetching the guild member
|
|
2392
2563
|
*/
|
|
2393
2564
|
async getGuildMember(guildId, { signal } = {}) {
|
|
2394
|
-
return this.rest.get(
|
|
2565
|
+
return this.rest.get(import_v1015.Routes.userGuildMember(guildId), { signal });
|
|
2395
2566
|
}
|
|
2396
2567
|
/**
|
|
2397
2568
|
* Edits the guild member for the current user
|
|
@@ -2402,7 +2573,7 @@ var UsersAPI = class {
|
|
|
2402
2573
|
* @param options - The options for editing the guild member
|
|
2403
2574
|
*/
|
|
2404
2575
|
async editCurrentGuildMember(guildId, body = {}, { reason, signal } = {}) {
|
|
2405
|
-
return this.rest.patch(
|
|
2576
|
+
return this.rest.patch(import_v1015.Routes.guildMember(guildId, "@me"), {
|
|
2406
2577
|
reason,
|
|
2407
2578
|
body,
|
|
2408
2579
|
signal
|
|
@@ -2416,7 +2587,7 @@ var UsersAPI = class {
|
|
|
2416
2587
|
* @param options - The options for opening the DM
|
|
2417
2588
|
*/
|
|
2418
2589
|
async createDM(userId, { signal } = {}) {
|
|
2419
|
-
return this.rest.post(
|
|
2590
|
+
return this.rest.post(import_v1015.Routes.userChannels(), {
|
|
2420
2591
|
body: { recipient_id: userId },
|
|
2421
2592
|
signal
|
|
2422
2593
|
});
|
|
@@ -2428,7 +2599,7 @@ var UsersAPI = class {
|
|
|
2428
2599
|
* @param options - The options for fetching the user's connections
|
|
2429
2600
|
*/
|
|
2430
2601
|
async getConnections({ signal } = {}) {
|
|
2431
|
-
return this.rest.get(
|
|
2602
|
+
return this.rest.get(import_v1015.Routes.userConnections(), { signal });
|
|
2432
2603
|
}
|
|
2433
2604
|
/**
|
|
2434
2605
|
* Gets the current user's active application role connection
|
|
@@ -2438,7 +2609,7 @@ var UsersAPI = class {
|
|
|
2438
2609
|
* @param options - The options for fetching the role connections
|
|
2439
2610
|
*/
|
|
2440
2611
|
async getApplicationRoleConnection(applicationId, { signal } = {}) {
|
|
2441
|
-
return this.rest.get(
|
|
2612
|
+
return this.rest.get(import_v1015.Routes.userApplicationRoleConnection(applicationId), {
|
|
2442
2613
|
signal
|
|
2443
2614
|
});
|
|
2444
2615
|
}
|
|
@@ -2451,33 +2622,13 @@ var UsersAPI = class {
|
|
|
2451
2622
|
* @param options - The options for updating the application role connection
|
|
2452
2623
|
*/
|
|
2453
2624
|
async updateApplicationRoleConnection(applicationId, body, { signal } = {}) {
|
|
2454
|
-
return this.rest.put(
|
|
2625
|
+
return this.rest.put(import_v1015.Routes.userApplicationRoleConnection(applicationId), {
|
|
2455
2626
|
body,
|
|
2456
2627
|
signal
|
|
2457
2628
|
});
|
|
2458
2629
|
}
|
|
2459
2630
|
};
|
|
2460
2631
|
|
|
2461
|
-
// src/api/voice.ts
|
|
2462
|
-
var import_v1015 = require("discord-api-types/v10");
|
|
2463
|
-
var VoiceAPI = class {
|
|
2464
|
-
constructor(rest) {
|
|
2465
|
-
this.rest = rest;
|
|
2466
|
-
}
|
|
2467
|
-
static {
|
|
2468
|
-
__name(this, "VoiceAPI");
|
|
2469
|
-
}
|
|
2470
|
-
/**
|
|
2471
|
-
* Fetches all voice regions
|
|
2472
|
-
*
|
|
2473
|
-
* @see {@link https://discord.com/developers/docs/resources/voice#list-voice-regions}
|
|
2474
|
-
* @param options - The options for fetching the voice regions
|
|
2475
|
-
*/
|
|
2476
|
-
async getVoiceRegions({ signal } = {}) {
|
|
2477
|
-
return this.rest.get(import_v1015.Routes.voiceRegions(), { signal });
|
|
2478
|
-
}
|
|
2479
|
-
};
|
|
2480
|
-
|
|
2481
2632
|
// src/api/webhook.ts
|
|
2482
2633
|
var import_rest9 = require("@discordjs/rest");
|
|
2483
2634
|
var import_v1016 = require("discord-api-types/v10");
|
|
@@ -2714,7 +2865,7 @@ __name(withFiles, "withFiles");
|
|
|
2714
2865
|
|
|
2715
2866
|
// src/http-only/index.ts
|
|
2716
2867
|
__reExport(http_only_exports, require("discord-api-types/v10"), module.exports);
|
|
2717
|
-
var version = "2.0.0-dev.
|
|
2868
|
+
var version = "2.0.0-dev.1724155493-bf83db948";
|
|
2718
2869
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2719
2870
|
0 && (module.exports = {
|
|
2720
2871
|
API,
|