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