@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.
@@ -262,6 +262,71 @@ var ApplicationsAPI = class {
262
262
  signal
263
263
  });
264
264
  }
265
+ /**
266
+ * Fetches all emojis of an application
267
+ *
268
+ * @see {@link https://discord.com/developers/docs/resources/emoji#list-application-emojis}
269
+ * @param applicationId - The id of the application to fetch the emojis of
270
+ * @param options - The options for fetching the emojis
271
+ */
272
+ async getEmojis(applicationId, { signal } = {}) {
273
+ return this.rest.get(Routes2.applicationEmojis(applicationId), {
274
+ signal
275
+ });
276
+ }
277
+ /**
278
+ * Fetches an emoji of an application
279
+ *
280
+ * @see {@link https://discord.com/developers/docs/resources/emoji#get-application-emoji}
281
+ * @param applicationId - The id of the application to fetch the emoji of
282
+ * @param emojiId - The id of the emoji to fetch
283
+ * @param options - The options for fetching the emoji
284
+ */
285
+ async getEmoji(applicationId, emojiId, { signal } = {}) {
286
+ return this.rest.get(Routes2.applicationEmoji(applicationId, emojiId), {
287
+ signal
288
+ });
289
+ }
290
+ /**
291
+ * Creates a new emoji of an application
292
+ *
293
+ * @see {@link https://discord.com/developers/docs/resources/emoji#create-application-emoji}
294
+ * @param applicationId - The id of the application to create the emoji of
295
+ * @param body - The data for creating the emoji
296
+ * @param options - The options for creating the emoji
297
+ */
298
+ async createEmoji(applicationId, body, { signal } = {}) {
299
+ return this.rest.post(Routes2.applicationEmojis(applicationId), {
300
+ body,
301
+ signal
302
+ });
303
+ }
304
+ /**
305
+ * Edits an emoji of an application
306
+ *
307
+ * @see {@link https://discord.com/developers/docs/resources/emoji#modify-application-emoji}
308
+ * @param applicationId - The id of the application to edit the emoji of
309
+ * @param emojiId - The id of the emoji to edit
310
+ * @param body - The data for editing the emoji
311
+ * @param options - The options for editing the emoji
312
+ */
313
+ async editEmoji(applicationId, emojiId, body, { signal } = {}) {
314
+ return this.rest.patch(Routes2.applicationEmoji(applicationId, emojiId), {
315
+ body,
316
+ signal
317
+ });
318
+ }
319
+ /**
320
+ * Deletes an emoji of an application
321
+ *
322
+ * @see {@link https://discord.com/developers/docs/resources/emoji#delete-application-emoji}
323
+ * @param applicationId - The id of the application to delete the emoji of
324
+ * @param emojiId - The id of the emoji to delete
325
+ * @param options - The options for deleting the emoji
326
+ */
327
+ async deleteEmoji(applicationId, emojiId, { signal } = {}) {
328
+ await this.rest.delete(Routes2.applicationEmoji(applicationId, emojiId), { signal });
329
+ }
265
330
  };
266
331
 
267
332
  // src/api/channel.ts
@@ -682,9 +747,85 @@ var ChannelsAPI = class {
682
747
 
683
748
  // src/api/guild.ts
684
749
  import { makeURLSearchParams as makeURLSearchParams3 } from "@discordjs/rest";
750
+ import {
751
+ Routes as Routes5
752
+ } from "discord-api-types/v10";
753
+
754
+ // src/api/voice.ts
685
755
  import {
686
756
  Routes as Routes4
687
757
  } from "discord-api-types/v10";
758
+ var VoiceAPI = class {
759
+ constructor(rest) {
760
+ this.rest = rest;
761
+ }
762
+ static {
763
+ __name(this, "VoiceAPI");
764
+ }
765
+ /**
766
+ * Fetches all voice regions
767
+ *
768
+ * @see {@link https://discord.com/developers/docs/resources/voice#list-voice-regions}
769
+ * @param options - The options for fetching the voice regions
770
+ */
771
+ async getVoiceRegions({ signal } = {}) {
772
+ return this.rest.get(Routes4.voiceRegions(), { signal });
773
+ }
774
+ /**
775
+ * Fetches voice state of a user by their id
776
+ *
777
+ * @see {@link https://discord.com/developers/docs/resources/voice#get-user-voice-state}
778
+ * @param options - The options for fetching user voice state
779
+ */
780
+ async getUserVoiceState(guildId, userId, { signal } = {}) {
781
+ return this.rest.get(Routes4.guildVoiceState(guildId, userId), {
782
+ signal
783
+ });
784
+ }
785
+ /**
786
+ * Fetches the current user's voice state
787
+ *
788
+ * @see {@link https://discord.com/developers/docs/resources/voice#get-current-user-voice-state}
789
+ * @param options - The options for fetching user voice state
790
+ */
791
+ async getVoiceState(guildId, { signal } = {}) {
792
+ return this.rest.get(Routes4.guildVoiceState(guildId, "@me"), {
793
+ signal
794
+ });
795
+ }
796
+ /**
797
+ * Edits a user's voice state in a guild
798
+ *
799
+ * @see {@link https://discord.com/developers/docs/resources/voice#modify-user-voice-state}
800
+ * @param guildId - The id of the guild to edit the current user's voice state in
801
+ * @param userId - The id of the user to edit the voice state for
802
+ * @param body - The data for editing the voice state
803
+ * @param options - The options for editing the voice state
804
+ */
805
+ async editUserVoiceState(guildId, userId, body, { reason, signal } = {}) {
806
+ return this.rest.patch(Routes4.guildVoiceState(guildId, userId), {
807
+ reason,
808
+ body,
809
+ signal
810
+ });
811
+ }
812
+ /**
813
+ * Edits the voice state for the current user
814
+ *
815
+ * @see {@link https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state}
816
+ * @param guildId - The id of the guild
817
+ * @param body - The data for editing the voice state
818
+ * @param options - The options for editing the voice state
819
+ */
820
+ async editVoiceState(guildId, body = {}, { signal } = {}) {
821
+ return this.rest.patch(Routes4.guildVoiceState(guildId, "@me"), {
822
+ body,
823
+ signal
824
+ });
825
+ }
826
+ };
827
+
828
+ // src/api/guild.ts
688
829
  var GuildsAPI = class {
689
830
  constructor(rest) {
690
831
  this.rest = rest;
@@ -699,7 +840,7 @@ var GuildsAPI = class {
699
840
  if ("with_counts" in queryOrOptions) {
700
841
  requestData.query = makeURLSearchParams3(queryOrOptions);
701
842
  }
702
- return this.rest.get(Routes4.guild(guildId), requestData);
843
+ return this.rest.get(Routes5.guild(guildId), requestData);
703
844
  }
704
845
  /**
705
846
  * Fetches a guild preview
@@ -709,7 +850,7 @@ var GuildsAPI = class {
709
850
  * @param options - The options for fetching the guild preview
710
851
  */
711
852
  async getPreview(guildId, { signal } = {}) {
712
- return this.rest.get(Routes4.guildPreview(guildId), {
853
+ return this.rest.get(Routes5.guildPreview(guildId), {
713
854
  signal
714
855
  });
715
856
  }
@@ -721,7 +862,7 @@ var GuildsAPI = class {
721
862
  * @param options - The options for creating the guild
722
863
  */
723
864
  async create(body, { signal } = {}) {
724
- return this.rest.post(Routes4.guilds(), { body, signal });
865
+ return this.rest.post(Routes5.guilds(), { body, signal });
725
866
  }
726
867
  /**
727
868
  * Edits a guild
@@ -732,7 +873,7 @@ var GuildsAPI = class {
732
873
  * @param options - The options for editing the guild
733
874
  */
734
875
  async edit(guildId, body, { reason, signal } = {}) {
735
- return this.rest.patch(Routes4.guild(guildId), {
876
+ return this.rest.patch(Routes5.guild(guildId), {
736
877
  reason,
737
878
  body,
738
879
  signal
@@ -746,7 +887,7 @@ var GuildsAPI = class {
746
887
  * @param options - The options for deleting this guild
747
888
  */
748
889
  async delete(guildId, { signal, reason } = {}) {
749
- await this.rest.delete(Routes4.guild(guildId), { reason, signal });
890
+ await this.rest.delete(Routes5.guild(guildId), { reason, signal });
750
891
  }
751
892
  /**
752
893
  * Adds user to the guild
@@ -758,7 +899,7 @@ var GuildsAPI = class {
758
899
  * @param options - The options for adding users to the guild
759
900
  */
760
901
  async addMember(guildId, userId, body, { signal } = {}) {
761
- return this.rest.put(Routes4.guildMember(guildId, userId), {
902
+ return this.rest.put(Routes5.guildMember(guildId, userId), {
762
903
  body,
763
904
  signal
764
905
  });
@@ -772,7 +913,7 @@ var GuildsAPI = class {
772
913
  * @param options - The options for fetching the guild members
773
914
  */
774
915
  async getMembers(guildId, query = {}, { signal } = {}) {
775
- return this.rest.get(Routes4.guildMembers(guildId), {
916
+ return this.rest.get(Routes5.guildMembers(guildId), {
776
917
  query: makeURLSearchParams3(query),
777
918
  signal
778
919
  });
@@ -785,7 +926,7 @@ var GuildsAPI = class {
785
926
  * @param options - The options for fetching the guild channels
786
927
  */
787
928
  async getChannels(guildId, { signal } = {}) {
788
- return this.rest.get(Routes4.guildChannels(guildId), {
929
+ return this.rest.get(Routes5.guildChannels(guildId), {
789
930
  signal
790
931
  });
791
932
  }
@@ -798,7 +939,7 @@ var GuildsAPI = class {
798
939
  * @param options - The options for creating the guild channel
799
940
  */
800
941
  async createChannel(guildId, body, { reason, signal } = {}) {
801
- return this.rest.post(Routes4.guildChannels(guildId), {
942
+ return this.rest.post(Routes5.guildChannels(guildId), {
802
943
  reason,
803
944
  body,
804
945
  signal
@@ -813,7 +954,7 @@ var GuildsAPI = class {
813
954
  * @param options - The options for editing the guild channel positions
814
955
  */
815
956
  async setChannelPositions(guildId, body, { reason, signal } = {}) {
816
- await this.rest.patch(Routes4.guildChannels(guildId), { reason, body, signal });
957
+ await this.rest.patch(Routes5.guildChannels(guildId), { reason, body, signal });
817
958
  }
818
959
  /**
819
960
  * Fetches the active threads in a guild
@@ -823,7 +964,7 @@ var GuildsAPI = class {
823
964
  * @param options - The options for fetching the active threads
824
965
  */
825
966
  async getActiveThreads(guildId, { signal } = {}) {
826
- return this.rest.get(Routes4.guildActiveThreads(guildId), { signal });
967
+ return this.rest.get(Routes5.guildActiveThreads(guildId), { signal });
827
968
  }
828
969
  /**
829
970
  * Fetches a guild member ban
@@ -834,7 +975,7 @@ var GuildsAPI = class {
834
975
  * @param options - The options for fetching the ban
835
976
  */
836
977
  async getMemberBan(guildId, userId, { signal } = {}) {
837
- return this.rest.get(Routes4.guildBan(guildId, userId), { signal });
978
+ return this.rest.get(Routes5.guildBan(guildId, userId), { signal });
838
979
  }
839
980
  /**
840
981
  * Fetches guild member bans
@@ -845,7 +986,7 @@ var GuildsAPI = class {
845
986
  * @param options - The options for fetching the bans
846
987
  */
847
988
  async getMemberBans(guildId, query = {}, { signal } = {}) {
848
- return this.rest.get(Routes4.guildBans(guildId), {
989
+ return this.rest.get(Routes5.guildBans(guildId), {
849
990
  query: makeURLSearchParams3(query),
850
991
  signal
851
992
  });
@@ -860,7 +1001,7 @@ var GuildsAPI = class {
860
1001
  * @param options - The options for banning the user
861
1002
  */
862
1003
  async banUser(guildId, userId, body = {}, { reason, signal } = {}) {
863
- await this.rest.put(Routes4.guildBan(guildId, userId), { reason, body, signal });
1004
+ await this.rest.put(Routes5.guildBan(guildId, userId), { reason, body, signal });
864
1005
  }
865
1006
  /**
866
1007
  * Unbans a user from a guild
@@ -871,7 +1012,7 @@ var GuildsAPI = class {
871
1012
  * @param options - The options for unbanning the user
872
1013
  */
873
1014
  async unbanUser(guildId, userId, { reason, signal } = {}) {
874
- await this.rest.delete(Routes4.guildBan(guildId, userId), { reason, signal });
1015
+ await this.rest.delete(Routes5.guildBan(guildId, userId), { reason, signal });
875
1016
  }
876
1017
  /**
877
1018
  * Bulk ban users from a guild
@@ -882,7 +1023,7 @@ var GuildsAPI = class {
882
1023
  * @param options - The options for bulk banning users
883
1024
  */
884
1025
  async bulkBanUsers(guildId, body, { reason, signal } = {}) {
885
- return this.rest.post(Routes4.guildBulkBan(guildId), {
1026
+ return this.rest.post(Routes5.guildBulkBan(guildId), {
886
1027
  reason,
887
1028
  body,
888
1029
  signal
@@ -896,7 +1037,7 @@ var GuildsAPI = class {
896
1037
  * @param options - The options for fetching the guild roles
897
1038
  */
898
1039
  async getRoles(guildId, { signal } = {}) {
899
- return this.rest.get(Routes4.guildRoles(guildId), { signal });
1040
+ return this.rest.get(Routes5.guildRoles(guildId), { signal });
900
1041
  }
901
1042
  /**
902
1043
  * Creates a guild role
@@ -907,7 +1048,7 @@ var GuildsAPI = class {
907
1048
  * @param options - The options for creating the guild role
908
1049
  */
909
1050
  async createRole(guildId, body, { reason, signal } = {}) {
910
- return this.rest.post(Routes4.guildRoles(guildId), { reason, body, signal });
1051
+ return this.rest.post(Routes5.guildRoles(guildId), { reason, body, signal });
911
1052
  }
912
1053
  /**
913
1054
  * Sets role positions in a guild
@@ -918,7 +1059,7 @@ var GuildsAPI = class {
918
1059
  * @param options - The options for setting role positions
919
1060
  */
920
1061
  async setRolePositions(guildId, body, { reason, signal } = {}) {
921
- return this.rest.patch(Routes4.guildRoles(guildId), {
1062
+ return this.rest.patch(Routes5.guildRoles(guildId), {
922
1063
  reason,
923
1064
  body,
924
1065
  signal
@@ -934,7 +1075,7 @@ var GuildsAPI = class {
934
1075
  * @param options - The options for editing the guild role
935
1076
  */
936
1077
  async editRole(guildId, roleId, body, { reason, signal } = {}) {
937
- return this.rest.patch(Routes4.guildRole(guildId, roleId), {
1078
+ return this.rest.patch(Routes5.guildRole(guildId, roleId), {
938
1079
  reason,
939
1080
  body,
940
1081
  signal
@@ -949,7 +1090,7 @@ var GuildsAPI = class {
949
1090
  * @param options - The options for deleting the guild role
950
1091
  */
951
1092
  async deleteRole(guildId, roleId, { reason, signal } = {}) {
952
- await this.rest.delete(Routes4.guildRole(guildId, roleId), { reason, signal });
1093
+ await this.rest.delete(Routes5.guildRole(guildId, roleId), { reason, signal });
953
1094
  }
954
1095
  /**
955
1096
  * Edits the multi-factor-authentication (MFA) level of a guild
@@ -960,7 +1101,7 @@ var GuildsAPI = class {
960
1101
  * @param options - The options for editing the MFA level
961
1102
  */
962
1103
  async editMFALevel(guildId, level, { reason, signal } = {}) {
963
- return this.rest.post(Routes4.guildMFA(guildId), {
1104
+ return this.rest.post(Routes5.guildMFA(guildId), {
964
1105
  reason,
965
1106
  signal,
966
1107
  body: { level }
@@ -975,7 +1116,7 @@ var GuildsAPI = class {
975
1116
  * @param options - The options for fetching the number of pruned members
976
1117
  */
977
1118
  async getPruneCount(guildId, query = {}, { signal } = {}) {
978
- return this.rest.get(Routes4.guildPrune(guildId), {
1119
+ return this.rest.get(Routes5.guildPrune(guildId), {
979
1120
  signal,
980
1121
  query: makeURLSearchParams3(query)
981
1122
  });
@@ -989,7 +1130,7 @@ var GuildsAPI = class {
989
1130
  * @param options - The options for initiating the prune
990
1131
  */
991
1132
  async beginPrune(guildId, body = {}, { reason, signal } = {}) {
992
- return this.rest.post(Routes4.guildPrune(guildId), {
1133
+ return this.rest.post(Routes5.guildPrune(guildId), {
993
1134
  body,
994
1135
  reason,
995
1136
  signal
@@ -1003,7 +1144,7 @@ var GuildsAPI = class {
1003
1144
  * @param options - The options for fetching the voice regions
1004
1145
  */
1005
1146
  async getVoiceRegions(guildId, { signal } = {}) {
1006
- return this.rest.get(Routes4.guildVoiceRegions(guildId), { signal });
1147
+ return this.rest.get(Routes5.guildVoiceRegions(guildId), { signal });
1007
1148
  }
1008
1149
  /**
1009
1150
  * Fetches the invites for a guild
@@ -1013,7 +1154,7 @@ var GuildsAPI = class {
1013
1154
  * @param options - The options for fetching the invites
1014
1155
  */
1015
1156
  async getInvites(guildId, { signal } = {}) {
1016
- return this.rest.get(Routes4.guildInvites(guildId), { signal });
1157
+ return this.rest.get(Routes5.guildInvites(guildId), { signal });
1017
1158
  }
1018
1159
  /**
1019
1160
  * Fetches the integrations for a guild
@@ -1023,7 +1164,7 @@ var GuildsAPI = class {
1023
1164
  * @param options - The options for fetching the integrations
1024
1165
  */
1025
1166
  async getIntegrations(guildId, { signal } = {}) {
1026
- return this.rest.get(Routes4.guildIntegrations(guildId), { signal });
1167
+ return this.rest.get(Routes5.guildIntegrations(guildId), { signal });
1027
1168
  }
1028
1169
  /**
1029
1170
  * Deletes an integration from a guild
@@ -1034,7 +1175,7 @@ var GuildsAPI = class {
1034
1175
  * @param options - The options for deleting the integration
1035
1176
  */
1036
1177
  async deleteIntegration(guildId, integrationId, { reason, signal } = {}) {
1037
- await this.rest.delete(Routes4.guildIntegration(guildId, integrationId), { reason, signal });
1178
+ await this.rest.delete(Routes5.guildIntegration(guildId, integrationId), { reason, signal });
1038
1179
  }
1039
1180
  /**
1040
1181
  * Fetches the widget settings for a guild
@@ -1044,7 +1185,7 @@ var GuildsAPI = class {
1044
1185
  * @param options - The options for fetching the widget settings
1045
1186
  */
1046
1187
  async getWidgetSettings(guildId, { signal } = {}) {
1047
- return this.rest.get(Routes4.guildWidgetSettings(guildId), {
1188
+ return this.rest.get(Routes5.guildWidgetSettings(guildId), {
1048
1189
  signal
1049
1190
  });
1050
1191
  }
@@ -1057,7 +1198,7 @@ var GuildsAPI = class {
1057
1198
  * @param options - The options for editing the widget settings
1058
1199
  */
1059
1200
  async editWidgetSettings(guildId, body, { reason, signal } = {}) {
1060
- return this.rest.patch(Routes4.guildWidgetSettings(guildId), {
1201
+ return this.rest.patch(Routes5.guildWidgetSettings(guildId), {
1061
1202
  reason,
1062
1203
  body,
1063
1204
  signal
@@ -1071,7 +1212,7 @@ var GuildsAPI = class {
1071
1212
  * @param options - The options for fetching the widget
1072
1213
  */
1073
1214
  async getWidget(guildId, { signal } = {}) {
1074
- return this.rest.get(Routes4.guildWidgetJSON(guildId), { signal });
1215
+ return this.rest.get(Routes5.guildWidgetJSON(guildId), { signal });
1075
1216
  }
1076
1217
  /**
1077
1218
  * Fetches the vanity url for a guild
@@ -1081,7 +1222,7 @@ var GuildsAPI = class {
1081
1222
  * @param options - The options for fetching the vanity url
1082
1223
  */
1083
1224
  async getVanityURL(guildId, { signal } = {}) {
1084
- return this.rest.get(Routes4.guildVanityUrl(guildId), { signal });
1225
+ return this.rest.get(Routes5.guildVanityUrl(guildId), { signal });
1085
1226
  }
1086
1227
  /**
1087
1228
  * Fetches the widget image for a guild
@@ -1092,7 +1233,7 @@ var GuildsAPI = class {
1092
1233
  * @param options - The options for fetching the widget image
1093
1234
  */
1094
1235
  async getWidgetImage(guildId, style, { signal } = {}) {
1095
- return this.rest.get(Routes4.guildWidgetImage(guildId), {
1236
+ return this.rest.get(Routes5.guildWidgetImage(guildId), {
1096
1237
  query: makeURLSearchParams3({ style }),
1097
1238
  signal
1098
1239
  });
@@ -1105,7 +1246,7 @@ var GuildsAPI = class {
1105
1246
  * @param options - The options for fetching the welcome screen
1106
1247
  */
1107
1248
  async getWelcomeScreen(guildId, { signal } = {}) {
1108
- return this.rest.get(Routes4.guildWelcomeScreen(guildId), { signal });
1249
+ return this.rest.get(Routes5.guildWelcomeScreen(guildId), { signal });
1109
1250
  }
1110
1251
  /**
1111
1252
  * Edits the welcome screen for a guild
@@ -1116,7 +1257,7 @@ var GuildsAPI = class {
1116
1257
  * @param options - The options for editing the welcome screen
1117
1258
  */
1118
1259
  async editWelcomeScreen(guildId, body, { reason, signal } = {}) {
1119
- return this.rest.patch(Routes4.guildWelcomeScreen(guildId), {
1260
+ return this.rest.patch(Routes5.guildWelcomeScreen(guildId), {
1120
1261
  reason,
1121
1262
  body,
1122
1263
  signal
@@ -1125,14 +1266,15 @@ var GuildsAPI = class {
1125
1266
  /**
1126
1267
  * Edits a user's voice state in a guild
1127
1268
  *
1128
- * @see {@link https://discord.com/developers/docs/resources/guild#modify-user-voice-state}
1269
+ * @see {@link https://discord.com/developers/docs/resources/voice#modify-user-voice-state}
1129
1270
  * @param guildId - The id of the guild to edit the current user's voice state in
1130
1271
  * @param userId - The id of the user to edit the voice state for
1131
1272
  * @param body - The data for editing the voice state
1132
1273
  * @param options - The options for editing the voice state
1274
+ * @deprecated Use {@link VoiceAPI.editUserVoiceState} instead
1133
1275
  */
1134
1276
  async editUserVoiceState(guildId, userId, body, { reason, signal } = {}) {
1135
- await this.rest.patch(Routes4.guildVoiceState(guildId, userId), { reason, body, signal });
1277
+ return new VoiceAPI(this.rest).editUserVoiceState(guildId, userId, body, { reason, signal });
1136
1278
  }
1137
1279
  /**
1138
1280
  * Fetches all emojis for a guild
@@ -1142,7 +1284,7 @@ var GuildsAPI = class {
1142
1284
  * @param options - The options for fetching the emojis
1143
1285
  */
1144
1286
  async getEmojis(guildId, { signal } = {}) {
1145
- return this.rest.get(Routes4.guildEmojis(guildId), { signal });
1287
+ return this.rest.get(Routes5.guildEmojis(guildId), { signal });
1146
1288
  }
1147
1289
  /**
1148
1290
  * Fetches an emoji for a guild
@@ -1153,7 +1295,7 @@ var GuildsAPI = class {
1153
1295
  * @param options - The options for fetching the emoji
1154
1296
  */
1155
1297
  async getEmoji(guildId, emojiId, { signal } = {}) {
1156
- return this.rest.get(Routes4.guildEmoji(guildId, emojiId), { signal });
1298
+ return this.rest.get(Routes5.guildEmoji(guildId, emojiId), { signal });
1157
1299
  }
1158
1300
  /**
1159
1301
  * Creates a new emoji for a guild
@@ -1164,7 +1306,7 @@ var GuildsAPI = class {
1164
1306
  * @param options - The options for creating the emoji
1165
1307
  */
1166
1308
  async createEmoji(guildId, body, { reason, signal } = {}) {
1167
- return this.rest.post(Routes4.guildEmojis(guildId), {
1309
+ return this.rest.post(Routes5.guildEmojis(guildId), {
1168
1310
  reason,
1169
1311
  body,
1170
1312
  signal
@@ -1180,7 +1322,7 @@ var GuildsAPI = class {
1180
1322
  * @param options - The options for editing the emoji
1181
1323
  */
1182
1324
  async editEmoji(guildId, emojiId, body, { reason, signal } = {}) {
1183
- return this.rest.patch(Routes4.guildEmoji(guildId, emojiId), {
1325
+ return this.rest.patch(Routes5.guildEmoji(guildId, emojiId), {
1184
1326
  reason,
1185
1327
  body,
1186
1328
  signal
@@ -1195,7 +1337,7 @@ var GuildsAPI = class {
1195
1337
  * @param options - The options for deleting the emoji
1196
1338
  */
1197
1339
  async deleteEmoji(guildId, emojiId, { reason, signal } = {}) {
1198
- await this.rest.delete(Routes4.guildEmoji(guildId, emojiId), { reason, signal });
1340
+ await this.rest.delete(Routes5.guildEmoji(guildId, emojiId), { reason, signal });
1199
1341
  }
1200
1342
  /**
1201
1343
  * Fetches all scheduled events for a guild
@@ -1206,7 +1348,7 @@ var GuildsAPI = class {
1206
1348
  * @param options - The options for fetching the scheduled events
1207
1349
  */
1208
1350
  async getScheduledEvents(guildId, query = {}, { signal } = {}) {
1209
- return this.rest.get(Routes4.guildScheduledEvents(guildId), {
1351
+ return this.rest.get(Routes5.guildScheduledEvents(guildId), {
1210
1352
  query: makeURLSearchParams3(query),
1211
1353
  signal
1212
1354
  });
@@ -1220,7 +1362,7 @@ var GuildsAPI = class {
1220
1362
  * @param options - The options for creating the scheduled event
1221
1363
  */
1222
1364
  async createScheduledEvent(guildId, body, { reason, signal } = {}) {
1223
- return this.rest.post(Routes4.guildScheduledEvents(guildId), {
1365
+ return this.rest.post(Routes5.guildScheduledEvents(guildId), {
1224
1366
  reason,
1225
1367
  body,
1226
1368
  signal
@@ -1236,7 +1378,7 @@ var GuildsAPI = class {
1236
1378
  * @param options - The options for fetching the scheduled event
1237
1379
  */
1238
1380
  async getScheduledEvent(guildId, eventId, query = {}, { signal } = {}) {
1239
- return this.rest.get(Routes4.guildScheduledEvent(guildId, eventId), {
1381
+ return this.rest.get(Routes5.guildScheduledEvent(guildId, eventId), {
1240
1382
  query: makeURLSearchParams3(query),
1241
1383
  signal
1242
1384
  });
@@ -1251,7 +1393,7 @@ var GuildsAPI = class {
1251
1393
  * @param options - The options for editing the scheduled event
1252
1394
  */
1253
1395
  async editScheduledEvent(guildId, eventId, body, { reason, signal } = {}) {
1254
- return this.rest.patch(Routes4.guildScheduledEvent(guildId, eventId), {
1396
+ return this.rest.patch(Routes5.guildScheduledEvent(guildId, eventId), {
1255
1397
  reason,
1256
1398
  body,
1257
1399
  signal
@@ -1266,7 +1408,7 @@ var GuildsAPI = class {
1266
1408
  * @param options - The options for deleting the scheduled event
1267
1409
  */
1268
1410
  async deleteScheduledEvent(guildId, eventId, { reason, signal } = {}) {
1269
- await this.rest.delete(Routes4.guildScheduledEvent(guildId, eventId), { reason, signal });
1411
+ await this.rest.delete(Routes5.guildScheduledEvent(guildId, eventId), { reason, signal });
1270
1412
  }
1271
1413
  /**
1272
1414
  * Gets all users that are interested in a scheduled event
@@ -1278,7 +1420,7 @@ var GuildsAPI = class {
1278
1420
  * @param options - The options for fetching the scheduled event users
1279
1421
  */
1280
1422
  async getScheduledEventUsers(guildId, eventId, query = {}, { signal } = {}) {
1281
- return this.rest.get(Routes4.guildScheduledEventUsers(guildId, eventId), {
1423
+ return this.rest.get(Routes5.guildScheduledEventUsers(guildId, eventId), {
1282
1424
  query: makeURLSearchParams3(query),
1283
1425
  signal
1284
1426
  });
@@ -1291,7 +1433,7 @@ var GuildsAPI = class {
1291
1433
  * @param options - The options for fetching the templates
1292
1434
  */
1293
1435
  async getTemplates(guildId, { signal } = {}) {
1294
- return this.rest.get(Routes4.guildTemplates(guildId), { signal });
1436
+ return this.rest.get(Routes5.guildTemplates(guildId), { signal });
1295
1437
  }
1296
1438
  /**
1297
1439
  * Syncs a template for a guild
@@ -1302,7 +1444,7 @@ var GuildsAPI = class {
1302
1444
  * @param options - The options for syncing the template
1303
1445
  */
1304
1446
  async syncTemplate(guildId, templateCode, { signal } = {}) {
1305
- return this.rest.put(Routes4.guildTemplate(guildId, templateCode), {
1447
+ return this.rest.put(Routes5.guildTemplate(guildId, templateCode), {
1306
1448
  signal
1307
1449
  });
1308
1450
  }
@@ -1316,7 +1458,7 @@ var GuildsAPI = class {
1316
1458
  * @param options - The options for editing the template
1317
1459
  */
1318
1460
  async editTemplate(guildId, templateCode, body, { signal } = {}) {
1319
- return this.rest.patch(Routes4.guildTemplate(guildId, templateCode), {
1461
+ return this.rest.patch(Routes5.guildTemplate(guildId, templateCode), {
1320
1462
  body,
1321
1463
  signal
1322
1464
  });
@@ -1330,7 +1472,7 @@ var GuildsAPI = class {
1330
1472
  * @param options - The options for deleting the template
1331
1473
  */
1332
1474
  async deleteTemplate(guildId, templateCode, { signal } = {}) {
1333
- await this.rest.delete(Routes4.guildTemplate(guildId, templateCode), { signal });
1475
+ await this.rest.delete(Routes5.guildTemplate(guildId, templateCode), { signal });
1334
1476
  }
1335
1477
  /**
1336
1478
  * Fetches all the stickers for a guild
@@ -1340,7 +1482,7 @@ var GuildsAPI = class {
1340
1482
  * @param options - The options for fetching the stickers
1341
1483
  */
1342
1484
  async getStickers(guildId, { signal } = {}) {
1343
- return this.rest.get(Routes4.guildStickers(guildId), { signal });
1485
+ return this.rest.get(Routes5.guildStickers(guildId), { signal });
1344
1486
  }
1345
1487
  /**
1346
1488
  * Fetches a sticker for a guild
@@ -1351,7 +1493,7 @@ var GuildsAPI = class {
1351
1493
  * @param options - The options for fetching the sticker
1352
1494
  */
1353
1495
  async getSticker(guildId, stickerId, { signal } = {}) {
1354
- return this.rest.get(Routes4.guildSticker(guildId, stickerId), { signal });
1496
+ return this.rest.get(Routes5.guildSticker(guildId, stickerId), { signal });
1355
1497
  }
1356
1498
  /**
1357
1499
  * Creates a sticker for a guild
@@ -1363,7 +1505,7 @@ var GuildsAPI = class {
1363
1505
  */
1364
1506
  async createSticker(guildId, { file, ...body }, { reason, signal } = {}) {
1365
1507
  const fileData = { ...file, key: "file" };
1366
- return this.rest.post(Routes4.guildStickers(guildId), {
1508
+ return this.rest.post(Routes5.guildStickers(guildId), {
1367
1509
  appendToFormData: true,
1368
1510
  body,
1369
1511
  files: [fileData],
@@ -1381,7 +1523,7 @@ var GuildsAPI = class {
1381
1523
  * @param options - The options for editing the sticker
1382
1524
  */
1383
1525
  async editSticker(guildId, stickerId, body, { reason, signal } = {}) {
1384
- return this.rest.patch(Routes4.guildSticker(guildId, stickerId), {
1526
+ return this.rest.patch(Routes5.guildSticker(guildId, stickerId), {
1385
1527
  reason,
1386
1528
  body,
1387
1529
  signal
@@ -1396,7 +1538,7 @@ var GuildsAPI = class {
1396
1538
  * @param options - The options for deleting the sticker
1397
1539
  */
1398
1540
  async deleteSticker(guildId, stickerId, { reason, signal } = {}) {
1399
- await this.rest.delete(Routes4.guildSticker(guildId, stickerId), { reason, signal });
1541
+ await this.rest.delete(Routes5.guildSticker(guildId, stickerId), { reason, signal });
1400
1542
  }
1401
1543
  /**
1402
1544
  * Fetches the audit logs for a guild
@@ -1407,7 +1549,7 @@ var GuildsAPI = class {
1407
1549
  * @param options - The options for fetching the audit logs
1408
1550
  */
1409
1551
  async getAuditLogs(guildId, query = {}, { signal } = {}) {
1410
- return this.rest.get(Routes4.guildAuditLog(guildId), {
1552
+ return this.rest.get(Routes5.guildAuditLog(guildId), {
1411
1553
  query: makeURLSearchParams3(query),
1412
1554
  signal
1413
1555
  });
@@ -1420,7 +1562,7 @@ var GuildsAPI = class {
1420
1562
  * @param options - The options for fetching the auto moderation rules
1421
1563
  */
1422
1564
  async getAutoModerationRules(guildId, { signal } = {}) {
1423
- return this.rest.get(Routes4.guildAutoModerationRules(guildId), {
1565
+ return this.rest.get(Routes5.guildAutoModerationRules(guildId), {
1424
1566
  signal
1425
1567
  });
1426
1568
  }
@@ -1433,7 +1575,7 @@ var GuildsAPI = class {
1433
1575
  * @param options - The options for fetching the auto moderation rule
1434
1576
  */
1435
1577
  async getAutoModerationRule(guildId, ruleId, { signal } = {}) {
1436
- return this.rest.get(Routes4.guildAutoModerationRule(guildId, ruleId), {
1578
+ return this.rest.get(Routes5.guildAutoModerationRule(guildId, ruleId), {
1437
1579
  signal
1438
1580
  });
1439
1581
  }
@@ -1446,7 +1588,7 @@ var GuildsAPI = class {
1446
1588
  * @param options - The options for creating the auto moderation rule
1447
1589
  */
1448
1590
  async createAutoModerationRule(guildId, body, { reason, signal } = {}) {
1449
- return this.rest.post(Routes4.guildAutoModerationRules(guildId), {
1591
+ return this.rest.post(Routes5.guildAutoModerationRules(guildId), {
1450
1592
  reason,
1451
1593
  body,
1452
1594
  signal
@@ -1462,7 +1604,7 @@ var GuildsAPI = class {
1462
1604
  * @param options - The options for editing the auto moderation rule
1463
1605
  */
1464
1606
  async editAutoModerationRule(guildId, ruleId, body, { reason, signal } = {}) {
1465
- return this.rest.patch(Routes4.guildAutoModerationRule(guildId, ruleId), {
1607
+ return this.rest.patch(Routes5.guildAutoModerationRule(guildId, ruleId), {
1466
1608
  reason,
1467
1609
  body,
1468
1610
  signal
@@ -1477,7 +1619,7 @@ var GuildsAPI = class {
1477
1619
  * @param options - The options for deleting the auto moderation rule
1478
1620
  */
1479
1621
  async deleteAutoModerationRule(guildId, ruleId, { reason, signal } = {}) {
1480
- await this.rest.delete(Routes4.guildAutoModerationRule(guildId, ruleId), { reason, signal });
1622
+ await this.rest.delete(Routes5.guildAutoModerationRule(guildId, ruleId), { reason, signal });
1481
1623
  }
1482
1624
  /**
1483
1625
  * Fetches a guild member
@@ -1488,7 +1630,7 @@ var GuildsAPI = class {
1488
1630
  * @param options - The options for fetching the guild member
1489
1631
  */
1490
1632
  async getMember(guildId, userId, { signal } = {}) {
1491
- return this.rest.get(Routes4.guildMember(guildId, userId), { signal });
1633
+ return this.rest.get(Routes5.guildMember(guildId, userId), { signal });
1492
1634
  }
1493
1635
  /**
1494
1636
  * Searches for guild members
@@ -1499,7 +1641,7 @@ var GuildsAPI = class {
1499
1641
  * @param options - The options for searching for guild members
1500
1642
  */
1501
1643
  async searchForMembers(guildId, query, { signal } = {}) {
1502
- return this.rest.get(Routes4.guildMembersSearch(guildId), {
1644
+ return this.rest.get(Routes5.guildMembersSearch(guildId), {
1503
1645
  query: makeURLSearchParams3(query),
1504
1646
  signal
1505
1647
  });
@@ -1514,7 +1656,7 @@ var GuildsAPI = class {
1514
1656
  * @param options - The options for editing the guild member
1515
1657
  */
1516
1658
  async editMember(guildId, userId, body = {}, { reason, signal } = {}) {
1517
- return this.rest.patch(Routes4.guildMember(guildId, userId), {
1659
+ return this.rest.patch(Routes5.guildMember(guildId, userId), {
1518
1660
  reason,
1519
1661
  body,
1520
1662
  signal
@@ -1529,7 +1671,7 @@ var GuildsAPI = class {
1529
1671
  * @param options - The options for removing the guild member
1530
1672
  */
1531
1673
  async removeMember(guildId, userId, { reason, signal } = {}) {
1532
- return this.rest.delete(Routes4.guildMember(guildId, userId), { reason, signal });
1674
+ return this.rest.delete(Routes5.guildMember(guildId, userId), { reason, signal });
1533
1675
  }
1534
1676
  /**
1535
1677
  * Adds a role to a guild member
@@ -1541,7 +1683,7 @@ var GuildsAPI = class {
1541
1683
  * @param options - The options for adding a role to a guild member
1542
1684
  */
1543
1685
  async addRoleToMember(guildId, userId, roleId, { reason, signal } = {}) {
1544
- await this.rest.put(Routes4.guildMemberRole(guildId, userId, roleId), { reason, signal });
1686
+ await this.rest.put(Routes5.guildMemberRole(guildId, userId, roleId), { reason, signal });
1545
1687
  }
1546
1688
  /**
1547
1689
  * Removes a role from a guild member
@@ -1553,7 +1695,7 @@ var GuildsAPI = class {
1553
1695
  * @param options - The options for removing a role from a guild member
1554
1696
  */
1555
1697
  async removeRoleFromMember(guildId, userId, roleId, { reason, signal } = {}) {
1556
- await this.rest.delete(Routes4.guildMemberRole(guildId, userId, roleId), { reason, signal });
1698
+ await this.rest.delete(Routes5.guildMemberRole(guildId, userId, roleId), { reason, signal });
1557
1699
  }
1558
1700
  /**
1559
1701
  * Fetches a guild template
@@ -1563,7 +1705,7 @@ var GuildsAPI = class {
1563
1705
  * @param options - The options for fetching the guild template
1564
1706
  */
1565
1707
  async getTemplate(templateCode, { signal } = {}) {
1566
- return this.rest.get(Routes4.template(templateCode), { signal });
1708
+ return this.rest.get(Routes5.template(templateCode), { signal });
1567
1709
  }
1568
1710
  /**
1569
1711
  * Creates a new template
@@ -1574,7 +1716,7 @@ var GuildsAPI = class {
1574
1716
  * @param options - The options for creating the template
1575
1717
  */
1576
1718
  async createTemplate(templateCode, body, { signal } = {}) {
1577
- return this.rest.post(Routes4.template(templateCode), { body, signal });
1719
+ return this.rest.post(Routes5.template(templateCode), { body, signal });
1578
1720
  }
1579
1721
  /**
1580
1722
  * Fetches webhooks for a guild
@@ -1583,19 +1725,19 @@ var GuildsAPI = class {
1583
1725
  * @param id - The id of the guild
1584
1726
  */
1585
1727
  async getWebhooks(id) {
1586
- return this.rest.get(Routes4.guildWebhooks(id));
1728
+ return this.rest.get(Routes5.guildWebhooks(id));
1587
1729
  }
1588
1730
  /**
1589
1731
  * Sets the voice state for the current user
1590
1732
  *
1591
- * @see {@link https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state}
1733
+ * @see {@link https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state}
1592
1734
  * @param guildId - The id of the guild
1593
- * @param body - The options for setting the voice state
1735
+ * @param body - The data for setting the voice state
1736
+ * @param options - The options for setting the voice state
1737
+ * @deprecated Use {@link VoiceAPI.editVoiceState} instead
1594
1738
  */
1595
- async setVoiceState(guildId, body = {}) {
1596
- return this.rest.patch(Routes4.guildVoiceState(guildId, "@me"), {
1597
- body
1598
- });
1739
+ async setVoiceState(guildId, body = {}, { signal } = {}) {
1740
+ return new VoiceAPI(this.rest).editVoiceState(guildId, body, { signal });
1599
1741
  }
1600
1742
  /**
1601
1743
  * Fetches a guild onboarding
@@ -1605,7 +1747,7 @@ var GuildsAPI = class {
1605
1747
  * @param options - The options for fetching the guild onboarding
1606
1748
  */
1607
1749
  async getOnboarding(guildId, { signal } = {}) {
1608
- return this.rest.get(Routes4.guildOnboarding(guildId), { signal });
1750
+ return this.rest.get(Routes5.guildOnboarding(guildId), { signal });
1609
1751
  }
1610
1752
  /**
1611
1753
  * Edits a guild onboarding
@@ -1616,7 +1758,7 @@ var GuildsAPI = class {
1616
1758
  * @param options - The options for editing the guild onboarding
1617
1759
  */
1618
1760
  async editOnboarding(guildId, body, { reason, signal } = {}) {
1619
- return this.rest.put(Routes4.guildOnboarding(guildId), {
1761
+ return this.rest.put(Routes5.guildOnboarding(guildId), {
1620
1762
  reason,
1621
1763
  body,
1622
1764
  signal
@@ -1627,7 +1769,7 @@ var GuildsAPI = class {
1627
1769
  // src/api/interactions.ts
1628
1770
  import {
1629
1771
  InteractionResponseType,
1630
- Routes as Routes5
1772
+ Routes as Routes6
1631
1773
  } from "discord-api-types/v10";
1632
1774
  var InteractionsAPI = class {
1633
1775
  constructor(rest, webhooks) {
@@ -1647,7 +1789,7 @@ var InteractionsAPI = class {
1647
1789
  * @param options - The options for replying
1648
1790
  */
1649
1791
  async reply(interactionId, interactionToken, { files, ...data }, { signal } = {}) {
1650
- await this.rest.post(Routes5.interactionCallback(interactionId, interactionToken), {
1792
+ await this.rest.post(Routes6.interactionCallback(interactionId, interactionToken), {
1651
1793
  files,
1652
1794
  auth: false,
1653
1795
  body: {
@@ -1667,7 +1809,7 @@ var InteractionsAPI = class {
1667
1809
  * @param options - The options for deferring
1668
1810
  */
1669
1811
  async defer(interactionId, interactionToken, data, { signal } = {}) {
1670
- await this.rest.post(Routes5.interactionCallback(interactionId, interactionToken), {
1812
+ await this.rest.post(Routes6.interactionCallback(interactionId, interactionToken), {
1671
1813
  auth: false,
1672
1814
  body: {
1673
1815
  type: InteractionResponseType.DeferredChannelMessageWithSource,
@@ -1685,7 +1827,7 @@ var InteractionsAPI = class {
1685
1827
  * @param options - The options for deferring
1686
1828
  */
1687
1829
  async deferMessageUpdate(interactionId, interactionToken, { signal } = {}) {
1688
- await this.rest.post(Routes5.interactionCallback(interactionId, interactionToken), {
1830
+ await this.rest.post(Routes6.interactionCallback(interactionId, interactionToken), {
1689
1831
  auth: false,
1690
1832
  body: {
1691
1833
  type: InteractionResponseType.DeferredMessageUpdate
@@ -1761,7 +1903,7 @@ var InteractionsAPI = class {
1761
1903
  * @param options - The options for updating the interaction
1762
1904
  */
1763
1905
  async updateMessage(interactionId, interactionToken, { files, ...data }, { signal } = {}) {
1764
- await this.rest.post(Routes5.interactionCallback(interactionId, interactionToken), {
1906
+ await this.rest.post(Routes6.interactionCallback(interactionId, interactionToken), {
1765
1907
  files,
1766
1908
  auth: false,
1767
1909
  body: {
@@ -1781,7 +1923,7 @@ var InteractionsAPI = class {
1781
1923
  * @param options - The options for sending the autocomplete response
1782
1924
  */
1783
1925
  async createAutocompleteResponse(interactionId, interactionToken, callbackData, { signal } = {}) {
1784
- await this.rest.post(Routes5.interactionCallback(interactionId, interactionToken), {
1926
+ await this.rest.post(Routes6.interactionCallback(interactionId, interactionToken), {
1785
1927
  auth: false,
1786
1928
  body: {
1787
1929
  type: InteractionResponseType.ApplicationCommandAutocompleteResult,
@@ -1800,7 +1942,7 @@ var InteractionsAPI = class {
1800
1942
  * @param options - The options for sending the modal
1801
1943
  */
1802
1944
  async createModal(interactionId, interactionToken, callbackData, { signal } = {}) {
1803
- await this.rest.post(Routes5.interactionCallback(interactionId, interactionToken), {
1945
+ await this.rest.post(Routes6.interactionCallback(interactionId, interactionToken), {
1804
1946
  auth: false,
1805
1947
  body: {
1806
1948
  type: InteractionResponseType.Modal,
@@ -1819,7 +1961,7 @@ var InteractionsAPI = class {
1819
1961
  * @deprecated Sending a premium-style button is the new Discord behaviour.
1820
1962
  */
1821
1963
  async sendPremiumRequired(interactionId, interactionToken, { signal } = {}) {
1822
- await this.rest.post(Routes5.interactionCallback(interactionId, interactionToken), {
1964
+ await this.rest.post(Routes6.interactionCallback(interactionId, interactionToken), {
1823
1965
  auth: false,
1824
1966
  body: {
1825
1967
  type: InteractionResponseType.PremiumRequired
@@ -1831,7 +1973,7 @@ var InteractionsAPI = class {
1831
1973
 
1832
1974
  // src/api/invite.ts
1833
1975
  import { makeURLSearchParams as makeURLSearchParams4 } from "@discordjs/rest";
1834
- import { Routes as Routes6 } from "discord-api-types/v10";
1976
+ import { Routes as Routes7 } from "discord-api-types/v10";
1835
1977
  var InvitesAPI = class {
1836
1978
  constructor(rest) {
1837
1979
  this.rest = rest;
@@ -1848,7 +1990,7 @@ var InvitesAPI = class {
1848
1990
  * @param options - The options for fetching the invite
1849
1991
  */
1850
1992
  async get(code, query = {}, { signal } = {}) {
1851
- return this.rest.get(Routes6.invite(code), {
1993
+ return this.rest.get(Routes7.invite(code), {
1852
1994
  query: makeURLSearchParams4(query),
1853
1995
  signal
1854
1996
  });
@@ -1861,14 +2003,14 @@ var InvitesAPI = class {
1861
2003
  * @param options - The options for deleting the invite
1862
2004
  */
1863
2005
  async delete(code, { reason, signal } = {}) {
1864
- await this.rest.delete(Routes6.invite(code), { reason, signal });
2006
+ await this.rest.delete(Routes7.invite(code), { reason, signal });
1865
2007
  }
1866
2008
  };
1867
2009
 
1868
2010
  // src/api/monetization.ts
1869
2011
  import { makeURLSearchParams as makeURLSearchParams5 } from "@discordjs/rest";
1870
2012
  import {
1871
- Routes as Routes7
2013
+ Routes as Routes8
1872
2014
  } from "discord-api-types/v10";
1873
2015
  var MonetizationAPI = class {
1874
2016
  constructor(rest) {
@@ -1884,7 +2026,7 @@ var MonetizationAPI = class {
1884
2026
  * @param options - The options for fetching the SKUs.
1885
2027
  */
1886
2028
  async getSKUs(applicationId, { signal } = {}) {
1887
- return this.rest.get(Routes7.skus(applicationId), { signal });
2029
+ return this.rest.get(Routes8.skus(applicationId), { signal });
1888
2030
  }
1889
2031
  /**
1890
2032
  * Fetches the entitlements for an application.
@@ -1895,7 +2037,7 @@ var MonetizationAPI = class {
1895
2037
  * @param options - The options for fetching entitlements
1896
2038
  */
1897
2039
  async getEntitlements(applicationId, query, { signal } = {}) {
1898
- return this.rest.get(Routes7.entitlements(applicationId), {
2040
+ return this.rest.get(Routes8.entitlements(applicationId), {
1899
2041
  signal,
1900
2042
  query: makeURLSearchParams5(query)
1901
2043
  });
@@ -1909,7 +2051,7 @@ var MonetizationAPI = class {
1909
2051
  * @param options - The options for creating the entitlement
1910
2052
  */
1911
2053
  async createTestEntitlement(applicationId, body, { signal } = {}) {
1912
- return this.rest.post(Routes7.entitlements(applicationId), {
2054
+ return this.rest.post(Routes8.entitlements(applicationId), {
1913
2055
  body,
1914
2056
  signal
1915
2057
  });
@@ -1923,7 +2065,7 @@ var MonetizationAPI = class {
1923
2065
  * @param options - The options for deleting the entitlement
1924
2066
  */
1925
2067
  async deleteTestEntitlement(applicationId, entitlementId, { signal } = {}) {
1926
- await this.rest.delete(Routes7.entitlement(applicationId, entitlementId), { signal });
2068
+ await this.rest.delete(Routes8.entitlement(applicationId, entitlementId), { signal });
1927
2069
  }
1928
2070
  /**
1929
2071
  * Marks a given entitlement for the user as consumed. Only available for One-Time Purchase consumable SKUs.
@@ -1934,14 +2076,14 @@ var MonetizationAPI = class {
1934
2076
  * @param options - The options for consuming the entitlement
1935
2077
  */
1936
2078
  async consumeEntitlement(applicationId, entitlementId, { signal } = {}) {
1937
- await this.rest.post(Routes7.consumeEntitlement(applicationId, entitlementId), { signal });
2079
+ await this.rest.post(Routes8.consumeEntitlement(applicationId, entitlementId), { signal });
1938
2080
  }
1939
2081
  };
1940
2082
 
1941
2083
  // src/api/oauth2.ts
1942
2084
  import { makeURLSearchParams as makeURLSearchParams6 } from "@discordjs/rest";
1943
2085
  import {
1944
- Routes as Routes8,
2086
+ Routes as Routes9,
1945
2087
  RouteBases
1946
2088
  } from "discord-api-types/v10";
1947
2089
  var OAuth2API = class {
@@ -1958,7 +2100,7 @@ var OAuth2API = class {
1958
2100
  * @param options - The options for creating the authorization URL
1959
2101
  */
1960
2102
  generateAuthorizationURL(options) {
1961
- const url = new URL(`${RouteBases.api}${Routes8.oauth2Authorization()}`);
2103
+ const url = new URL(`${RouteBases.api}${Routes9.oauth2Authorization()}`);
1962
2104
  url.search = makeURLSearchParams6(options).toString();
1963
2105
  return url.toString();
1964
2106
  }
@@ -1970,7 +2112,7 @@ var OAuth2API = class {
1970
2112
  * @param options - The options for the token exchange request
1971
2113
  */
1972
2114
  async tokenExchange(body, { signal } = {}) {
1973
- return this.rest.post(Routes8.oauth2TokenExchange(), {
2115
+ return this.rest.post(Routes9.oauth2TokenExchange(), {
1974
2116
  body: makeURLSearchParams6(body),
1975
2117
  passThroughBody: true,
1976
2118
  headers: {
@@ -1988,7 +2130,7 @@ var OAuth2API = class {
1988
2130
  * @param options - The options for the refresh token request
1989
2131
  */
1990
2132
  async refreshToken(body, { signal } = {}) {
1991
- return this.rest.post(Routes8.oauth2TokenExchange(), {
2133
+ return this.rest.post(Routes9.oauth2TokenExchange(), {
1992
2134
  body: makeURLSearchParams6(body),
1993
2135
  passThroughBody: true,
1994
2136
  headers: {
@@ -2008,7 +2150,7 @@ var OAuth2API = class {
2008
2150
  * @param options - The options for the client credentials grant request
2009
2151
  */
2010
2152
  async getToken(body, { signal } = {}) {
2011
- return this.rest.post(Routes8.oauth2TokenExchange(), {
2153
+ return this.rest.post(Routes9.oauth2TokenExchange(), {
2012
2154
  body: makeURLSearchParams6(body),
2013
2155
  passThroughBody: true,
2014
2156
  headers: {
@@ -2025,7 +2167,7 @@ var OAuth2API = class {
2025
2167
  * @param options - The options for the current bot application information request
2026
2168
  */
2027
2169
  async getCurrentBotApplicationInformation({ signal } = {}) {
2028
- return this.rest.get(Routes8.oauth2CurrentApplication(), {
2170
+ return this.rest.get(Routes9.oauth2CurrentApplication(), {
2029
2171
  signal
2030
2172
  });
2031
2173
  }
@@ -2036,7 +2178,28 @@ var OAuth2API = class {
2036
2178
  * @param options - The options for the current authorization information request
2037
2179
  */
2038
2180
  async getCurrentAuthorizationInformation({ signal } = {}) {
2039
- return this.rest.get(Routes8.oauth2CurrentAuthorization(), {
2181
+ return this.rest.get(Routes9.oauth2CurrentAuthorization(), {
2182
+ signal
2183
+ });
2184
+ }
2185
+ /**
2186
+ * Revokes an OAuth2 token
2187
+ *
2188
+ * @see {@link https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-token-revocation-example}
2189
+ * @param applicationId - The application id
2190
+ * @param applicationSecret - The application secret
2191
+ * @param body - The body of the token revocation request
2192
+ * @param options - The options for the token revocation request
2193
+ */
2194
+ async revokeToken(applicationId, applicationSecret, body, { signal } = {}) {
2195
+ await this.rest.post(Routes9.oauth2TokenRevocation(), {
2196
+ body: makeURLSearchParams6(body),
2197
+ passThroughBody: true,
2198
+ headers: {
2199
+ Authorization: `Basic ${btoa(`${applicationId}:${applicationSecret}`)}`,
2200
+ "Content-Type": "application/x-www-form-urlencoded"
2201
+ },
2202
+ auth: false,
2040
2203
  signal
2041
2204
  });
2042
2205
  }
@@ -2045,7 +2208,7 @@ var OAuth2API = class {
2045
2208
  // src/api/poll.ts
2046
2209
  import { makeURLSearchParams as makeURLSearchParams7 } from "@discordjs/rest";
2047
2210
  import {
2048
- Routes as Routes9
2211
+ Routes as Routes10
2049
2212
  } from "discord-api-types/v10";
2050
2213
  var PollAPI = class {
2051
2214
  constructor(rest) {
@@ -2065,7 +2228,7 @@ var PollAPI = class {
2065
2228
  * @param options - The options for getting the list of voters
2066
2229
  */
2067
2230
  async getAnswerVoters(channelId, messageId, answerId, query, { signal } = {}) {
2068
- return this.rest.get(Routes9.pollAnswerVoters(channelId, messageId, answerId), {
2231
+ return this.rest.get(Routes10.pollAnswerVoters(channelId, messageId, answerId), {
2069
2232
  signal,
2070
2233
  query: makeURLSearchParams7(query)
2071
2234
  });
@@ -2079,7 +2242,7 @@ var PollAPI = class {
2079
2242
  * @param options - The options for expiring the poll
2080
2243
  */
2081
2244
  async expirePoll(channelId, messageId, { signal } = {}) {
2082
- return this.rest.post(Routes9.expirePoll(channelId, messageId), {
2245
+ return this.rest.post(Routes10.expirePoll(channelId, messageId), {
2083
2246
  signal
2084
2247
  });
2085
2248
  }
@@ -2087,7 +2250,7 @@ var PollAPI = class {
2087
2250
 
2088
2251
  // src/api/roleConnections.ts
2089
2252
  import {
2090
- Routes as Routes10
2253
+ Routes as Routes11
2091
2254
  } from "discord-api-types/v10";
2092
2255
  var RoleConnectionsAPI = class {
2093
2256
  constructor(rest) {
@@ -2104,7 +2267,7 @@ var RoleConnectionsAPI = class {
2104
2267
  * @param options - The options for fetching the role connection metadata records
2105
2268
  */
2106
2269
  async getMetadataRecords(applicationId, { signal } = {}) {
2107
- return this.rest.get(Routes10.applicationRoleConnectionMetadata(applicationId), {
2270
+ return this.rest.get(Routes11.applicationRoleConnectionMetadata(applicationId), {
2108
2271
  signal
2109
2272
  });
2110
2273
  }
@@ -2117,7 +2280,7 @@ var RoleConnectionsAPI = class {
2117
2280
  * @param options - The options for updating the role connection metadata records
2118
2281
  */
2119
2282
  async updateMetadataRecords(applicationId, body, { signal } = {}) {
2120
- return this.rest.put(Routes10.applicationRoleConnectionMetadata(applicationId), {
2283
+ return this.rest.put(Routes11.applicationRoleConnectionMetadata(applicationId), {
2121
2284
  body,
2122
2285
  signal
2123
2286
  });
@@ -2126,7 +2289,7 @@ var RoleConnectionsAPI = class {
2126
2289
 
2127
2290
  // src/api/stageInstances.ts
2128
2291
  import {
2129
- Routes as Routes11
2292
+ Routes as Routes12
2130
2293
  } from "discord-api-types/v10";
2131
2294
  var StageInstancesAPI = class {
2132
2295
  constructor(rest) {
@@ -2143,7 +2306,7 @@ var StageInstancesAPI = class {
2143
2306
  * @param options - The options for creating the new stage instance
2144
2307
  */
2145
2308
  async create(body, { reason, signal } = {}) {
2146
- return this.rest.post(Routes11.stageInstances(), {
2309
+ return this.rest.post(Routes12.stageInstances(), {
2147
2310
  body,
2148
2311
  reason,
2149
2312
  signal
@@ -2157,7 +2320,7 @@ var StageInstancesAPI = class {
2157
2320
  * @param options - The options for fetching the stage instance
2158
2321
  */
2159
2322
  async get(channelId, { signal } = {}) {
2160
- return this.rest.get(Routes11.stageInstance(channelId), { signal });
2323
+ return this.rest.get(Routes12.stageInstance(channelId), { signal });
2161
2324
  }
2162
2325
  /**
2163
2326
  * Edits a stage instance
@@ -2168,7 +2331,7 @@ var StageInstancesAPI = class {
2168
2331
  * @param options - The options for editing the stage instance
2169
2332
  */
2170
2333
  async edit(channelId, body, { reason, signal } = {}) {
2171
- return this.rest.patch(Routes11.stageInstance(channelId), {
2334
+ return this.rest.patch(Routes12.stageInstance(channelId), {
2172
2335
  body,
2173
2336
  reason,
2174
2337
  signal
@@ -2182,13 +2345,13 @@ var StageInstancesAPI = class {
2182
2345
  * @param options - The options for deleting the stage instance
2183
2346
  */
2184
2347
  async delete(channelId, { reason, signal } = {}) {
2185
- await this.rest.delete(Routes11.stageInstance(channelId), { reason, signal });
2348
+ await this.rest.delete(Routes12.stageInstance(channelId), { reason, signal });
2186
2349
  }
2187
2350
  };
2188
2351
 
2189
2352
  // src/api/sticker.ts
2190
2353
  import {
2191
- Routes as Routes12
2354
+ Routes as Routes13
2192
2355
  } from "discord-api-types/v10";
2193
2356
  var StickersAPI = class {
2194
2357
  constructor(rest) {
@@ -2197,6 +2360,16 @@ var StickersAPI = class {
2197
2360
  static {
2198
2361
  __name(this, "StickersAPI");
2199
2362
  }
2363
+ /**
2364
+ * Fetches a sticker pack
2365
+ *
2366
+ * @see {@link https://discord.com/developers/docs/resources/sticker#get-sticker-pack}
2367
+ * @param packId - The id of the sticker pack
2368
+ * @param options - The options for fetching the sticker pack
2369
+ */
2370
+ async getStickerPack(packId, { signal } = {}) {
2371
+ return this.rest.get(Routes13.stickerPack(packId), { signal });
2372
+ }
2200
2373
  /**
2201
2374
  * Fetches all of the sticker packs
2202
2375
  *
@@ -2204,7 +2377,7 @@ var StickersAPI = class {
2204
2377
  * @param options - The options for fetching the sticker packs
2205
2378
  */
2206
2379
  async getStickers({ signal } = {}) {
2207
- return this.rest.get(Routes12.stickerPacks(), { signal });
2380
+ return this.rest.get(Routes13.stickerPacks(), { signal });
2208
2381
  }
2209
2382
  /**
2210
2383
  * Fetches all of the sticker packs
@@ -2224,13 +2397,13 @@ var StickersAPI = class {
2224
2397
  * @param options - The options for fetching the sticker
2225
2398
  */
2226
2399
  async get(stickerId, { signal } = {}) {
2227
- return this.rest.get(Routes12.sticker(stickerId), { signal });
2400
+ return this.rest.get(Routes13.sticker(stickerId), { signal });
2228
2401
  }
2229
2402
  };
2230
2403
 
2231
2404
  // src/api/thread.ts
2232
2405
  import {
2233
- Routes as Routes13
2406
+ Routes as Routes14
2234
2407
  } from "discord-api-types/v10";
2235
2408
  var ThreadsAPI = class {
2236
2409
  constructor(rest) {
@@ -2247,7 +2420,7 @@ var ThreadsAPI = class {
2247
2420
  * @param options - The options for joining the thread
2248
2421
  */
2249
2422
  async join(threadId, { signal } = {}) {
2250
- await this.rest.put(Routes13.threadMembers(threadId, "@me"), { signal });
2423
+ await this.rest.put(Routes14.threadMembers(threadId, "@me"), { signal });
2251
2424
  }
2252
2425
  /**
2253
2426
  * Adds a member to a thread
@@ -2258,7 +2431,7 @@ var ThreadsAPI = class {
2258
2431
  * @param options - The options for adding the member to the thread
2259
2432
  */
2260
2433
  async addMember(threadId, userId, { signal } = {}) {
2261
- await this.rest.put(Routes13.threadMembers(threadId, userId), { signal });
2434
+ await this.rest.put(Routes14.threadMembers(threadId, userId), { signal });
2262
2435
  }
2263
2436
  /**
2264
2437
  * Removes the current user from a thread
@@ -2268,7 +2441,7 @@ var ThreadsAPI = class {
2268
2441
  * @param options - The options for leaving the thread
2269
2442
  */
2270
2443
  async leave(threadId, { signal } = {}) {
2271
- await this.rest.delete(Routes13.threadMembers(threadId, "@me"), { signal });
2444
+ await this.rest.delete(Routes14.threadMembers(threadId, "@me"), { signal });
2272
2445
  }
2273
2446
  /**
2274
2447
  * Removes a member from a thread
@@ -2279,7 +2452,7 @@ var ThreadsAPI = class {
2279
2452
  * @param options - The options for removing the member from the thread
2280
2453
  */
2281
2454
  async removeMember(threadId, userId, { signal } = {}) {
2282
- await this.rest.delete(Routes13.threadMembers(threadId, userId), { signal });
2455
+ await this.rest.delete(Routes14.threadMembers(threadId, userId), { signal });
2283
2456
  }
2284
2457
  /**
2285
2458
  * Fetches a member of a thread
@@ -2290,7 +2463,7 @@ var ThreadsAPI = class {
2290
2463
  * @param options - The options for fetching the member
2291
2464
  */
2292
2465
  async getMember(threadId, userId, { signal } = {}) {
2293
- return this.rest.get(Routes13.threadMembers(threadId, userId), { signal });
2466
+ return this.rest.get(Routes14.threadMembers(threadId, userId), { signal });
2294
2467
  }
2295
2468
  /**
2296
2469
  * Fetches all members of a thread
@@ -2300,14 +2473,14 @@ var ThreadsAPI = class {
2300
2473
  * @param options - The options for fetching the members
2301
2474
  */
2302
2475
  async getAllMembers(threadId, { signal } = {}) {
2303
- return this.rest.get(Routes13.threadMembers(threadId), { signal });
2476
+ return this.rest.get(Routes14.threadMembers(threadId), { signal });
2304
2477
  }
2305
2478
  };
2306
2479
 
2307
2480
  // src/api/user.ts
2308
2481
  import { makeURLSearchParams as makeURLSearchParams8 } from "@discordjs/rest";
2309
2482
  import {
2310
- Routes as Routes14
2483
+ Routes as Routes15
2311
2484
  } from "discord-api-types/v10";
2312
2485
  var UsersAPI = class {
2313
2486
  constructor(rest) {
@@ -2324,7 +2497,7 @@ var UsersAPI = class {
2324
2497
  * @param options - The options for fetching the user
2325
2498
  */
2326
2499
  async get(userId, { signal } = {}) {
2327
- return this.rest.get(Routes14.user(userId), { signal });
2500
+ return this.rest.get(Routes15.user(userId), { signal });
2328
2501
  }
2329
2502
  /**
2330
2503
  * Returns the user object of the requester's account
@@ -2333,7 +2506,7 @@ var UsersAPI = class {
2333
2506
  * @param options - The options for fetching the current user
2334
2507
  */
2335
2508
  async getCurrent({ signal } = {}) {
2336
- return this.rest.get(Routes14.user("@me"), { signal });
2509
+ return this.rest.get(Routes15.user("@me"), { signal });
2337
2510
  }
2338
2511
  /**
2339
2512
  * Returns a list of partial guild objects the current user is a member of
@@ -2343,7 +2516,7 @@ var UsersAPI = class {
2343
2516
  * @param options - The options for fetching the guilds
2344
2517
  */
2345
2518
  async getGuilds(query = {}, { signal } = {}) {
2346
- return this.rest.get(Routes14.userGuilds(), {
2519
+ return this.rest.get(Routes15.userGuilds(), {
2347
2520
  query: makeURLSearchParams8(query),
2348
2521
  signal
2349
2522
  });
@@ -2356,7 +2529,7 @@ var UsersAPI = class {
2356
2529
  * @param options - The options for leaving the guild
2357
2530
  */
2358
2531
  async leaveGuild(guildId, { signal } = {}) {
2359
- await this.rest.delete(Routes14.userGuild(guildId), { signal });
2532
+ await this.rest.delete(Routes15.userGuild(guildId), { signal });
2360
2533
  }
2361
2534
  /**
2362
2535
  * Edits the current user
@@ -2366,7 +2539,7 @@ var UsersAPI = class {
2366
2539
  * @param options - The options for editing the user
2367
2540
  */
2368
2541
  async edit(body, { signal } = {}) {
2369
- return this.rest.patch(Routes14.user("@me"), { body, signal });
2542
+ return this.rest.patch(Routes15.user("@me"), { body, signal });
2370
2543
  }
2371
2544
  /**
2372
2545
  * Fetches the guild member for the current user
@@ -2376,7 +2549,7 @@ var UsersAPI = class {
2376
2549
  * @param options - The options for fetching the guild member
2377
2550
  */
2378
2551
  async getGuildMember(guildId, { signal } = {}) {
2379
- return this.rest.get(Routes14.userGuildMember(guildId), { signal });
2552
+ return this.rest.get(Routes15.userGuildMember(guildId), { signal });
2380
2553
  }
2381
2554
  /**
2382
2555
  * Edits the guild member for the current user
@@ -2387,7 +2560,7 @@ var UsersAPI = class {
2387
2560
  * @param options - The options for editing the guild member
2388
2561
  */
2389
2562
  async editCurrentGuildMember(guildId, body = {}, { reason, signal } = {}) {
2390
- return this.rest.patch(Routes14.guildMember(guildId, "@me"), {
2563
+ return this.rest.patch(Routes15.guildMember(guildId, "@me"), {
2391
2564
  reason,
2392
2565
  body,
2393
2566
  signal
@@ -2401,7 +2574,7 @@ var UsersAPI = class {
2401
2574
  * @param options - The options for opening the DM
2402
2575
  */
2403
2576
  async createDM(userId, { signal } = {}) {
2404
- return this.rest.post(Routes14.userChannels(), {
2577
+ return this.rest.post(Routes15.userChannels(), {
2405
2578
  body: { recipient_id: userId },
2406
2579
  signal
2407
2580
  });
@@ -2413,7 +2586,7 @@ var UsersAPI = class {
2413
2586
  * @param options - The options for fetching the user's connections
2414
2587
  */
2415
2588
  async getConnections({ signal } = {}) {
2416
- return this.rest.get(Routes14.userConnections(), { signal });
2589
+ return this.rest.get(Routes15.userConnections(), { signal });
2417
2590
  }
2418
2591
  /**
2419
2592
  * Gets the current user's active application role connection
@@ -2423,7 +2596,7 @@ var UsersAPI = class {
2423
2596
  * @param options - The options for fetching the role connections
2424
2597
  */
2425
2598
  async getApplicationRoleConnection(applicationId, { signal } = {}) {
2426
- return this.rest.get(Routes14.userApplicationRoleConnection(applicationId), {
2599
+ return this.rest.get(Routes15.userApplicationRoleConnection(applicationId), {
2427
2600
  signal
2428
2601
  });
2429
2602
  }
@@ -2436,33 +2609,13 @@ var UsersAPI = class {
2436
2609
  * @param options - The options for updating the application role connection
2437
2610
  */
2438
2611
  async updateApplicationRoleConnection(applicationId, body, { signal } = {}) {
2439
- return this.rest.put(Routes14.userApplicationRoleConnection(applicationId), {
2612
+ return this.rest.put(Routes15.userApplicationRoleConnection(applicationId), {
2440
2613
  body,
2441
2614
  signal
2442
2615
  });
2443
2616
  }
2444
2617
  };
2445
2618
 
2446
- // src/api/voice.ts
2447
- import { Routes as Routes15 } from "discord-api-types/v10";
2448
- var VoiceAPI = class {
2449
- constructor(rest) {
2450
- this.rest = rest;
2451
- }
2452
- static {
2453
- __name(this, "VoiceAPI");
2454
- }
2455
- /**
2456
- * Fetches all voice regions
2457
- *
2458
- * @see {@link https://discord.com/developers/docs/resources/voice#list-voice-regions}
2459
- * @param options - The options for fetching the voice regions
2460
- */
2461
- async getVoiceRegions({ signal } = {}) {
2462
- return this.rest.get(Routes15.voiceRegions(), { signal });
2463
- }
2464
- };
2465
-
2466
2619
  // src/api/webhook.ts
2467
2620
  import { makeURLSearchParams as makeURLSearchParams9 } from "@discordjs/rest";
2468
2621
  import {
@@ -2701,7 +2854,7 @@ __name(withFiles, "withFiles");
2701
2854
 
2702
2855
  // src/http-only/index.ts
2703
2856
  export * from "discord-api-types/v10";
2704
- var version = "2.0.0-dev.1724112651-87776bb0e";
2857
+ var version = "2.0.0-dev.1724155493-bf83db948";
2705
2858
  export {
2706
2859
  API,
2707
2860
  ApplicationCommandsAPI,