@discordjs/core 2.2.2 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -20,13 +20,15 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
20
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
21
 
22
22
  // src/index.ts
23
- var src_exports = {};
24
- __export(src_exports, {
23
+ var index_exports = {};
24
+ __export(index_exports, {
25
25
  API: () => API,
26
26
  ApplicationCommandsAPI: () => ApplicationCommandsAPI,
27
27
  ApplicationsAPI: () => ApplicationsAPI,
28
28
  ChannelsAPI: () => ChannelsAPI,
29
29
  Client: () => Client,
30
+ GatewayAPI: () => GatewayAPI,
31
+ GatewayRateLimitError: () => import_util2.GatewayRateLimitError,
30
32
  GuildsAPI: () => GuildsAPI,
31
33
  InteractionsAPI: () => InteractionsAPI,
32
34
  InvitesAPI: () => InvitesAPI,
@@ -34,6 +36,7 @@ __export(src_exports, {
34
36
  OAuth2API: () => OAuth2API,
35
37
  PollAPI: () => PollAPI,
36
38
  RoleConnectionsAPI: () => RoleConnectionsAPI,
39
+ SoundboardSoundsAPI: () => SoundboardSoundsAPI,
37
40
  StageInstancesAPI: () => StageInstancesAPI,
38
41
  StickersAPI: () => StickersAPI,
39
42
  ThreadsAPI: () => ThreadsAPI,
@@ -43,7 +46,7 @@ __export(src_exports, {
43
46
  version: () => version,
44
47
  withFiles: () => withFiles
45
48
  });
46
- module.exports = __toCommonJS(src_exports);
49
+ module.exports = __toCommonJS(index_exports);
47
50
 
48
51
  // src/api/applicationCommands.ts
49
52
  var import_rest = require("@discordjs/rest");
@@ -791,14 +794,88 @@ var ChannelsAPI = class {
791
794
  signal
792
795
  });
793
796
  }
797
+ /**
798
+ * Sends a soundboard sound in a channel
799
+ *
800
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound}
801
+ * @param channelId - The id of the channel to send the soundboard sound in
802
+ * @param body - The data for sending the soundboard sound
803
+ * @param options - The options for sending the soundboard sound
804
+ */
805
+ async sendSoundboardSound(channelId, body, { signal } = {}) {
806
+ return this.rest.post(import_v103.Routes.sendSoundboardSound(channelId), {
807
+ body,
808
+ signal
809
+ });
810
+ }
811
+ /**
812
+ * Adds a recipient to a group DM channel
813
+ *
814
+ * @see {@link https://discord.com/developers/docs/resources/channel#group-dm-add-recipient}
815
+ * @param channelId - The id of the channel to add the recipient to
816
+ * @param userId - The id of the user to add as a recipient
817
+ * @param body - The data for adding the recipient
818
+ * @param options - The options for adding the recipient
819
+ */
820
+ async addGroupDMRecipient(channelId, userId, body, { signal } = {}) {
821
+ await this.rest.put(import_v103.Routes.channelRecipient(channelId, userId), {
822
+ body,
823
+ signal
824
+ });
825
+ }
826
+ /**
827
+ * Removes a recipient from a group DM channel
828
+ *
829
+ * @see {@link https://discord.com/developers/docs/resources/channel#group-dm-remove-recipient}
830
+ * @param channelId - The id of the channel to remove the recipient from
831
+ * @param userId - The id of the user to remove as a recipient
832
+ * @param options - The options for removing the recipient
833
+ */
834
+ async removeGroupDMRecipient(channelId, userId, { signal } = {}) {
835
+ await this.rest.delete(import_v103.Routes.channelRecipient(channelId, userId), {
836
+ signal
837
+ });
838
+ }
839
+ };
840
+
841
+ // src/api/gateway.ts
842
+ var import_v104 = require("discord-api-types/v10");
843
+ var GatewayAPI = class {
844
+ constructor(rest) {
845
+ this.rest = rest;
846
+ }
847
+ static {
848
+ __name(this, "GatewayAPI");
849
+ }
850
+ /**
851
+ * Gets gateway information.
852
+ *
853
+ * @see {@link https://discord.com/developers/docs/events/gateway#get-gateway}
854
+ * @param options - The options for fetching the gateway information
855
+ */
856
+ async get({ signal } = {}) {
857
+ return this.rest.get(import_v104.Routes.gateway(), {
858
+ auth: false,
859
+ signal
860
+ });
861
+ }
862
+ /**
863
+ * Gets gateway information with additional metadata.
864
+ *
865
+ * @see {@link https://discord.com/developers/docs/events/gateway#get-gateway-bot}
866
+ * @param options - The options for fetching the gateway information
867
+ */
868
+ async getBot({ signal } = {}) {
869
+ return this.rest.get(import_v104.Routes.gatewayBot(), { signal });
870
+ }
794
871
  };
795
872
 
796
873
  // src/api/guild.ts
797
874
  var import_rest3 = require("@discordjs/rest");
798
- var import_v105 = require("discord-api-types/v10");
875
+ var import_v106 = require("discord-api-types/v10");
799
876
 
800
877
  // src/api/voice.ts
801
- var import_v104 = require("discord-api-types/v10");
878
+ var import_v105 = require("discord-api-types/v10");
802
879
  var VoiceAPI = class {
803
880
  constructor(rest) {
804
881
  this.rest = rest;
@@ -813,7 +890,7 @@ var VoiceAPI = class {
813
890
  * @param options - The options for fetching the voice regions
814
891
  */
815
892
  async getVoiceRegions({ signal } = {}) {
816
- return this.rest.get(import_v104.Routes.voiceRegions(), { signal });
893
+ return this.rest.get(import_v105.Routes.voiceRegions(), { signal });
817
894
  }
818
895
  /**
819
896
  * Fetches voice state of a user by their id
@@ -822,7 +899,7 @@ var VoiceAPI = class {
822
899
  * @param options - The options for fetching user voice state
823
900
  */
824
901
  async getUserVoiceState(guildId, userId, { signal } = {}) {
825
- return this.rest.get(import_v104.Routes.guildVoiceState(guildId, userId), {
902
+ return this.rest.get(import_v105.Routes.guildVoiceState(guildId, userId), {
826
903
  signal
827
904
  });
828
905
  }
@@ -833,7 +910,7 @@ var VoiceAPI = class {
833
910
  * @param options - The options for fetching user voice state
834
911
  */
835
912
  async getVoiceState(guildId, { signal } = {}) {
836
- return this.rest.get(import_v104.Routes.guildVoiceState(guildId, "@me"), {
913
+ return this.rest.get(import_v105.Routes.guildVoiceState(guildId, "@me"), {
837
914
  signal
838
915
  });
839
916
  }
@@ -847,7 +924,7 @@ var VoiceAPI = class {
847
924
  * @param options - The options for editing the voice state
848
925
  */
849
926
  async editUserVoiceState(guildId, userId, body, { reason, signal } = {}) {
850
- return this.rest.patch(import_v104.Routes.guildVoiceState(guildId, userId), {
927
+ return this.rest.patch(import_v105.Routes.guildVoiceState(guildId, userId), {
851
928
  reason,
852
929
  body,
853
930
  signal
@@ -862,7 +939,7 @@ var VoiceAPI = class {
862
939
  * @param options - The options for editing the voice state
863
940
  */
864
941
  async editVoiceState(guildId, body = {}, { signal } = {}) {
865
- return this.rest.patch(import_v104.Routes.guildVoiceState(guildId, "@me"), {
942
+ return this.rest.patch(import_v105.Routes.guildVoiceState(guildId, "@me"), {
866
943
  body,
867
944
  signal
868
945
  });
@@ -884,7 +961,7 @@ var GuildsAPI = class {
884
961
  if ("with_counts" in queryOrOptions) {
885
962
  requestData.query = (0, import_rest3.makeURLSearchParams)(queryOrOptions);
886
963
  }
887
- return this.rest.get(import_v105.Routes.guild(guildId), requestData);
964
+ return this.rest.get(import_v106.Routes.guild(guildId), requestData);
888
965
  }
889
966
  /**
890
967
  * Fetches a guild preview
@@ -894,7 +971,7 @@ var GuildsAPI = class {
894
971
  * @param options - The options for fetching the guild preview
895
972
  */
896
973
  async getPreview(guildId, { signal } = {}) {
897
- return this.rest.get(import_v105.Routes.guildPreview(guildId), {
974
+ return this.rest.get(import_v106.Routes.guildPreview(guildId), {
898
975
  signal
899
976
  });
900
977
  }
@@ -907,7 +984,7 @@ var GuildsAPI = class {
907
984
  * @deprecated API related to guild ownership may no longer be used.
908
985
  */
909
986
  async create(body, { signal } = {}) {
910
- return this.rest.post(import_v105.Routes.guilds(), { body, signal });
987
+ return this.rest.post(import_v106.Routes.guilds(), { body, signal });
911
988
  }
912
989
  /**
913
990
  * Edits a guild
@@ -918,7 +995,7 @@ var GuildsAPI = class {
918
995
  * @param options - The options for editing the guild
919
996
  */
920
997
  async edit(guildId, body, { reason, signal } = {}) {
921
- return this.rest.patch(import_v105.Routes.guild(guildId), {
998
+ return this.rest.patch(import_v106.Routes.guild(guildId), {
922
999
  reason,
923
1000
  body,
924
1001
  signal
@@ -933,7 +1010,7 @@ var GuildsAPI = class {
933
1010
  * @deprecated API related to guild ownership may no longer be used.
934
1011
  */
935
1012
  async delete(guildId, { signal } = {}) {
936
- await this.rest.delete(import_v105.Routes.guild(guildId), { signal });
1013
+ await this.rest.delete(import_v106.Routes.guild(guildId), { signal });
937
1014
  }
938
1015
  /**
939
1016
  * Adds user to the guild
@@ -945,13 +1022,13 @@ var GuildsAPI = class {
945
1022
  * @param options - The options for adding users to the guild
946
1023
  */
947
1024
  async addMember(guildId, userId, body, { signal } = {}) {
948
- return this.rest.put(import_v105.Routes.guildMember(guildId, userId), {
1025
+ return this.rest.put(import_v106.Routes.guildMember(guildId, userId), {
949
1026
  body,
950
1027
  signal
951
1028
  });
952
1029
  }
953
1030
  /**
954
- * Fetches all the members of a guild
1031
+ * Fetches members of a guild.
955
1032
  *
956
1033
  * @see {@link https://discord.com/developers/docs/resources/guild#list-guild-members}
957
1034
  * @param guildId - The id of the guild
@@ -959,7 +1036,7 @@ var GuildsAPI = class {
959
1036
  * @param options - The options for fetching the guild members
960
1037
  */
961
1038
  async getMembers(guildId, query = {}, { signal } = {}) {
962
- return this.rest.get(import_v105.Routes.guildMembers(guildId), {
1039
+ return this.rest.get(import_v106.Routes.guildMembers(guildId), {
963
1040
  query: (0, import_rest3.makeURLSearchParams)(query),
964
1041
  signal
965
1042
  });
@@ -972,7 +1049,7 @@ var GuildsAPI = class {
972
1049
  * @param options - The options for fetching the guild channels
973
1050
  */
974
1051
  async getChannels(guildId, { signal } = {}) {
975
- return this.rest.get(import_v105.Routes.guildChannels(guildId), {
1052
+ return this.rest.get(import_v106.Routes.guildChannels(guildId), {
976
1053
  signal
977
1054
  });
978
1055
  }
@@ -985,7 +1062,7 @@ var GuildsAPI = class {
985
1062
  * @param options - The options for creating the guild channel
986
1063
  */
987
1064
  async createChannel(guildId, body, { reason, signal } = {}) {
988
- return this.rest.post(import_v105.Routes.guildChannels(guildId), {
1065
+ return this.rest.post(import_v106.Routes.guildChannels(guildId), {
989
1066
  reason,
990
1067
  body,
991
1068
  signal
@@ -1000,7 +1077,7 @@ var GuildsAPI = class {
1000
1077
  * @param options - The options for editing the guild channel positions
1001
1078
  */
1002
1079
  async setChannelPositions(guildId, body, { reason, signal } = {}) {
1003
- await this.rest.patch(import_v105.Routes.guildChannels(guildId), { reason, body, signal });
1080
+ await this.rest.patch(import_v106.Routes.guildChannels(guildId), { reason, body, signal });
1004
1081
  }
1005
1082
  /**
1006
1083
  * Fetches the active threads in a guild
@@ -1010,7 +1087,7 @@ var GuildsAPI = class {
1010
1087
  * @param options - The options for fetching the active threads
1011
1088
  */
1012
1089
  async getActiveThreads(guildId, { signal } = {}) {
1013
- return this.rest.get(import_v105.Routes.guildActiveThreads(guildId), { signal });
1090
+ return this.rest.get(import_v106.Routes.guildActiveThreads(guildId), { signal });
1014
1091
  }
1015
1092
  /**
1016
1093
  * Fetches a guild member ban
@@ -1021,7 +1098,7 @@ var GuildsAPI = class {
1021
1098
  * @param options - The options for fetching the ban
1022
1099
  */
1023
1100
  async getMemberBan(guildId, userId, { signal } = {}) {
1024
- return this.rest.get(import_v105.Routes.guildBan(guildId, userId), { signal });
1101
+ return this.rest.get(import_v106.Routes.guildBan(guildId, userId), { signal });
1025
1102
  }
1026
1103
  /**
1027
1104
  * Fetches guild member bans
@@ -1032,7 +1109,7 @@ var GuildsAPI = class {
1032
1109
  * @param options - The options for fetching the bans
1033
1110
  */
1034
1111
  async getMemberBans(guildId, query = {}, { signal } = {}) {
1035
- return this.rest.get(import_v105.Routes.guildBans(guildId), {
1112
+ return this.rest.get(import_v106.Routes.guildBans(guildId), {
1036
1113
  query: (0, import_rest3.makeURLSearchParams)(query),
1037
1114
  signal
1038
1115
  });
@@ -1047,7 +1124,7 @@ var GuildsAPI = class {
1047
1124
  * @param options - The options for banning the user
1048
1125
  */
1049
1126
  async banUser(guildId, userId, body = {}, { reason, signal } = {}) {
1050
- await this.rest.put(import_v105.Routes.guildBan(guildId, userId), { reason, body, signal });
1127
+ await this.rest.put(import_v106.Routes.guildBan(guildId, userId), { reason, body, signal });
1051
1128
  }
1052
1129
  /**
1053
1130
  * Unbans a user from a guild
@@ -1058,7 +1135,7 @@ var GuildsAPI = class {
1058
1135
  * @param options - The options for unbanning the user
1059
1136
  */
1060
1137
  async unbanUser(guildId, userId, { reason, signal } = {}) {
1061
- await this.rest.delete(import_v105.Routes.guildBan(guildId, userId), { reason, signal });
1138
+ await this.rest.delete(import_v106.Routes.guildBan(guildId, userId), { reason, signal });
1062
1139
  }
1063
1140
  /**
1064
1141
  * Bulk ban users from a guild
@@ -1069,7 +1146,7 @@ var GuildsAPI = class {
1069
1146
  * @param options - The options for bulk banning users
1070
1147
  */
1071
1148
  async bulkBanUsers(guildId, body, { reason, signal } = {}) {
1072
- return this.rest.post(import_v105.Routes.guildBulkBan(guildId), {
1149
+ return this.rest.post(import_v106.Routes.guildBulkBan(guildId), {
1073
1150
  reason,
1074
1151
  body,
1075
1152
  signal
@@ -1083,7 +1160,7 @@ var GuildsAPI = class {
1083
1160
  * @param options - The options for fetching the guild roles
1084
1161
  */
1085
1162
  async getRoles(guildId, { signal } = {}) {
1086
- return this.rest.get(import_v105.Routes.guildRoles(guildId), { signal });
1163
+ return this.rest.get(import_v106.Routes.guildRoles(guildId), { signal });
1087
1164
  }
1088
1165
  /**
1089
1166
  * Get a role in a guild
@@ -1094,7 +1171,7 @@ var GuildsAPI = class {
1094
1171
  * @param options - The options for fetching the guild role
1095
1172
  */
1096
1173
  async getRole(guildId, roleId, { signal } = {}) {
1097
- return this.rest.get(import_v105.Routes.guildRole(guildId, roleId), { signal });
1174
+ return this.rest.get(import_v106.Routes.guildRole(guildId, roleId), { signal });
1098
1175
  }
1099
1176
  /**
1100
1177
  * Creates a guild role
@@ -1105,7 +1182,7 @@ var GuildsAPI = class {
1105
1182
  * @param options - The options for creating the guild role
1106
1183
  */
1107
1184
  async createRole(guildId, body, { reason, signal } = {}) {
1108
- return this.rest.post(import_v105.Routes.guildRoles(guildId), { reason, body, signal });
1185
+ return this.rest.post(import_v106.Routes.guildRoles(guildId), { reason, body, signal });
1109
1186
  }
1110
1187
  /**
1111
1188
  * Sets role positions in a guild
@@ -1116,7 +1193,7 @@ var GuildsAPI = class {
1116
1193
  * @param options - The options for setting role positions
1117
1194
  */
1118
1195
  async setRolePositions(guildId, body, { reason, signal } = {}) {
1119
- return this.rest.patch(import_v105.Routes.guildRoles(guildId), {
1196
+ return this.rest.patch(import_v106.Routes.guildRoles(guildId), {
1120
1197
  reason,
1121
1198
  body,
1122
1199
  signal
@@ -1132,7 +1209,7 @@ var GuildsAPI = class {
1132
1209
  * @param options - The options for editing the guild role
1133
1210
  */
1134
1211
  async editRole(guildId, roleId, body, { reason, signal } = {}) {
1135
- return this.rest.patch(import_v105.Routes.guildRole(guildId, roleId), {
1212
+ return this.rest.patch(import_v106.Routes.guildRole(guildId, roleId), {
1136
1213
  reason,
1137
1214
  body,
1138
1215
  signal
@@ -1147,7 +1224,7 @@ var GuildsAPI = class {
1147
1224
  * @param options - The options for deleting the guild role
1148
1225
  */
1149
1226
  async deleteRole(guildId, roleId, { reason, signal } = {}) {
1150
- await this.rest.delete(import_v105.Routes.guildRole(guildId, roleId), { reason, signal });
1227
+ await this.rest.delete(import_v106.Routes.guildRole(guildId, roleId), { reason, signal });
1151
1228
  }
1152
1229
  /**
1153
1230
  * Edits the multi-factor-authentication (MFA) level of a guild
@@ -1159,7 +1236,7 @@ var GuildsAPI = class {
1159
1236
  * @deprecated API related to guild ownership may no longer be used.
1160
1237
  */
1161
1238
  async editMFALevel(guildId, level, { reason, signal } = {}) {
1162
- return this.rest.post(import_v105.Routes.guildMFA(guildId), {
1239
+ return this.rest.post(import_v106.Routes.guildMFA(guildId), {
1163
1240
  reason,
1164
1241
  signal,
1165
1242
  body: { level }
@@ -1174,7 +1251,7 @@ var GuildsAPI = class {
1174
1251
  * @param options - The options for fetching the number of pruned members
1175
1252
  */
1176
1253
  async getPruneCount(guildId, query = {}, { signal } = {}) {
1177
- return this.rest.get(import_v105.Routes.guildPrune(guildId), {
1254
+ return this.rest.get(import_v106.Routes.guildPrune(guildId), {
1178
1255
  signal,
1179
1256
  query: (0, import_rest3.makeURLSearchParams)(query)
1180
1257
  });
@@ -1188,7 +1265,7 @@ var GuildsAPI = class {
1188
1265
  * @param options - The options for initiating the prune
1189
1266
  */
1190
1267
  async beginPrune(guildId, body = {}, { reason, signal } = {}) {
1191
- return this.rest.post(import_v105.Routes.guildPrune(guildId), {
1268
+ return this.rest.post(import_v106.Routes.guildPrune(guildId), {
1192
1269
  body,
1193
1270
  reason,
1194
1271
  signal
@@ -1202,7 +1279,7 @@ var GuildsAPI = class {
1202
1279
  * @param options - The options for fetching the voice regions
1203
1280
  */
1204
1281
  async getVoiceRegions(guildId, { signal } = {}) {
1205
- return this.rest.get(import_v105.Routes.guildVoiceRegions(guildId), { signal });
1282
+ return this.rest.get(import_v106.Routes.guildVoiceRegions(guildId), { signal });
1206
1283
  }
1207
1284
  /**
1208
1285
  * Fetches the invites for a guild
@@ -1212,7 +1289,7 @@ var GuildsAPI = class {
1212
1289
  * @param options - The options for fetching the invites
1213
1290
  */
1214
1291
  async getInvites(guildId, { signal } = {}) {
1215
- return this.rest.get(import_v105.Routes.guildInvites(guildId), { signal });
1292
+ return this.rest.get(import_v106.Routes.guildInvites(guildId), { signal });
1216
1293
  }
1217
1294
  /**
1218
1295
  * Fetches the integrations for a guild
@@ -1222,7 +1299,7 @@ var GuildsAPI = class {
1222
1299
  * @param options - The options for fetching the integrations
1223
1300
  */
1224
1301
  async getIntegrations(guildId, { signal } = {}) {
1225
- return this.rest.get(import_v105.Routes.guildIntegrations(guildId), { signal });
1302
+ return this.rest.get(import_v106.Routes.guildIntegrations(guildId), { signal });
1226
1303
  }
1227
1304
  /**
1228
1305
  * Deletes an integration from a guild
@@ -1233,7 +1310,7 @@ var GuildsAPI = class {
1233
1310
  * @param options - The options for deleting the integration
1234
1311
  */
1235
1312
  async deleteIntegration(guildId, integrationId, { reason, signal } = {}) {
1236
- await this.rest.delete(import_v105.Routes.guildIntegration(guildId, integrationId), { reason, signal });
1313
+ await this.rest.delete(import_v106.Routes.guildIntegration(guildId, integrationId), { reason, signal });
1237
1314
  }
1238
1315
  /**
1239
1316
  * Fetches the widget settings for a guild
@@ -1243,7 +1320,7 @@ var GuildsAPI = class {
1243
1320
  * @param options - The options for fetching the widget settings
1244
1321
  */
1245
1322
  async getWidgetSettings(guildId, { signal } = {}) {
1246
- return this.rest.get(import_v105.Routes.guildWidgetSettings(guildId), {
1323
+ return this.rest.get(import_v106.Routes.guildWidgetSettings(guildId), {
1247
1324
  signal
1248
1325
  });
1249
1326
  }
@@ -1256,7 +1333,7 @@ var GuildsAPI = class {
1256
1333
  * @param options - The options for editing the widget settings
1257
1334
  */
1258
1335
  async editWidgetSettings(guildId, body, { reason, signal } = {}) {
1259
- return this.rest.patch(import_v105.Routes.guildWidgetSettings(guildId), {
1336
+ return this.rest.patch(import_v106.Routes.guildWidgetSettings(guildId), {
1260
1337
  reason,
1261
1338
  body,
1262
1339
  signal
@@ -1270,7 +1347,7 @@ var GuildsAPI = class {
1270
1347
  * @param options - The options for fetching the widget
1271
1348
  */
1272
1349
  async getWidget(guildId, { signal } = {}) {
1273
- return this.rest.get(import_v105.Routes.guildWidgetJSON(guildId), { signal });
1350
+ return this.rest.get(import_v106.Routes.guildWidgetJSON(guildId), { signal });
1274
1351
  }
1275
1352
  /**
1276
1353
  * Fetches the vanity url for a guild
@@ -1280,7 +1357,7 @@ var GuildsAPI = class {
1280
1357
  * @param options - The options for fetching the vanity url
1281
1358
  */
1282
1359
  async getVanityURL(guildId, { signal } = {}) {
1283
- return this.rest.get(import_v105.Routes.guildVanityUrl(guildId), { signal });
1360
+ return this.rest.get(import_v106.Routes.guildVanityUrl(guildId), { signal });
1284
1361
  }
1285
1362
  /**
1286
1363
  * Fetches the widget image for a guild
@@ -1291,7 +1368,7 @@ var GuildsAPI = class {
1291
1368
  * @param options - The options for fetching the widget image
1292
1369
  */
1293
1370
  async getWidgetImage(guildId, style, { signal } = {}) {
1294
- return this.rest.get(import_v105.Routes.guildWidgetImage(guildId), {
1371
+ return this.rest.get(import_v106.Routes.guildWidgetImage(guildId), {
1295
1372
  query: (0, import_rest3.makeURLSearchParams)({ style }),
1296
1373
  signal
1297
1374
  });
@@ -1304,7 +1381,7 @@ var GuildsAPI = class {
1304
1381
  * @param options - The options for fetching the welcome screen
1305
1382
  */
1306
1383
  async getWelcomeScreen(guildId, { signal } = {}) {
1307
- return this.rest.get(import_v105.Routes.guildWelcomeScreen(guildId), { signal });
1384
+ return this.rest.get(import_v106.Routes.guildWelcomeScreen(guildId), { signal });
1308
1385
  }
1309
1386
  /**
1310
1387
  * Edits the welcome screen for a guild
@@ -1315,7 +1392,7 @@ var GuildsAPI = class {
1315
1392
  * @param options - The options for editing the welcome screen
1316
1393
  */
1317
1394
  async editWelcomeScreen(guildId, body, { reason, signal } = {}) {
1318
- return this.rest.patch(import_v105.Routes.guildWelcomeScreen(guildId), {
1395
+ return this.rest.patch(import_v106.Routes.guildWelcomeScreen(guildId), {
1319
1396
  reason,
1320
1397
  body,
1321
1398
  signal
@@ -1342,7 +1419,7 @@ var GuildsAPI = class {
1342
1419
  * @param options - The options for fetching the emojis
1343
1420
  */
1344
1421
  async getEmojis(guildId, { signal } = {}) {
1345
- return this.rest.get(import_v105.Routes.guildEmojis(guildId), { signal });
1422
+ return this.rest.get(import_v106.Routes.guildEmojis(guildId), { signal });
1346
1423
  }
1347
1424
  /**
1348
1425
  * Fetches an emoji for a guild
@@ -1353,7 +1430,7 @@ var GuildsAPI = class {
1353
1430
  * @param options - The options for fetching the emoji
1354
1431
  */
1355
1432
  async getEmoji(guildId, emojiId, { signal } = {}) {
1356
- return this.rest.get(import_v105.Routes.guildEmoji(guildId, emojiId), { signal });
1433
+ return this.rest.get(import_v106.Routes.guildEmoji(guildId, emojiId), { signal });
1357
1434
  }
1358
1435
  /**
1359
1436
  * Creates a new emoji for a guild
@@ -1364,7 +1441,7 @@ var GuildsAPI = class {
1364
1441
  * @param options - The options for creating the emoji
1365
1442
  */
1366
1443
  async createEmoji(guildId, body, { reason, signal } = {}) {
1367
- return this.rest.post(import_v105.Routes.guildEmojis(guildId), {
1444
+ return this.rest.post(import_v106.Routes.guildEmojis(guildId), {
1368
1445
  reason,
1369
1446
  body,
1370
1447
  signal
@@ -1380,7 +1457,7 @@ var GuildsAPI = class {
1380
1457
  * @param options - The options for editing the emoji
1381
1458
  */
1382
1459
  async editEmoji(guildId, emojiId, body, { reason, signal } = {}) {
1383
- return this.rest.patch(import_v105.Routes.guildEmoji(guildId, emojiId), {
1460
+ return this.rest.patch(import_v106.Routes.guildEmoji(guildId, emojiId), {
1384
1461
  reason,
1385
1462
  body,
1386
1463
  signal
@@ -1395,7 +1472,7 @@ var GuildsAPI = class {
1395
1472
  * @param options - The options for deleting the emoji
1396
1473
  */
1397
1474
  async deleteEmoji(guildId, emojiId, { reason, signal } = {}) {
1398
- await this.rest.delete(import_v105.Routes.guildEmoji(guildId, emojiId), { reason, signal });
1475
+ await this.rest.delete(import_v106.Routes.guildEmoji(guildId, emojiId), { reason, signal });
1399
1476
  }
1400
1477
  /**
1401
1478
  * Fetches all scheduled events for a guild
@@ -1406,7 +1483,7 @@ var GuildsAPI = class {
1406
1483
  * @param options - The options for fetching the scheduled events
1407
1484
  */
1408
1485
  async getScheduledEvents(guildId, query = {}, { signal } = {}) {
1409
- return this.rest.get(import_v105.Routes.guildScheduledEvents(guildId), {
1486
+ return this.rest.get(import_v106.Routes.guildScheduledEvents(guildId), {
1410
1487
  query: (0, import_rest3.makeURLSearchParams)(query),
1411
1488
  signal
1412
1489
  });
@@ -1420,7 +1497,7 @@ var GuildsAPI = class {
1420
1497
  * @param options - The options for creating the scheduled event
1421
1498
  */
1422
1499
  async createScheduledEvent(guildId, body, { reason, signal } = {}) {
1423
- return this.rest.post(import_v105.Routes.guildScheduledEvents(guildId), {
1500
+ return this.rest.post(import_v106.Routes.guildScheduledEvents(guildId), {
1424
1501
  reason,
1425
1502
  body,
1426
1503
  signal
@@ -1436,7 +1513,7 @@ var GuildsAPI = class {
1436
1513
  * @param options - The options for fetching the scheduled event
1437
1514
  */
1438
1515
  async getScheduledEvent(guildId, eventId, query = {}, { signal } = {}) {
1439
- return this.rest.get(import_v105.Routes.guildScheduledEvent(guildId, eventId), {
1516
+ return this.rest.get(import_v106.Routes.guildScheduledEvent(guildId, eventId), {
1440
1517
  query: (0, import_rest3.makeURLSearchParams)(query),
1441
1518
  signal
1442
1519
  });
@@ -1451,7 +1528,7 @@ var GuildsAPI = class {
1451
1528
  * @param options - The options for editing the scheduled event
1452
1529
  */
1453
1530
  async editScheduledEvent(guildId, eventId, body, { reason, signal } = {}) {
1454
- return this.rest.patch(import_v105.Routes.guildScheduledEvent(guildId, eventId), {
1531
+ return this.rest.patch(import_v106.Routes.guildScheduledEvent(guildId, eventId), {
1455
1532
  reason,
1456
1533
  body,
1457
1534
  signal
@@ -1466,7 +1543,7 @@ var GuildsAPI = class {
1466
1543
  * @param options - The options for deleting the scheduled event
1467
1544
  */
1468
1545
  async deleteScheduledEvent(guildId, eventId, { reason, signal } = {}) {
1469
- await this.rest.delete(import_v105.Routes.guildScheduledEvent(guildId, eventId), { reason, signal });
1546
+ await this.rest.delete(import_v106.Routes.guildScheduledEvent(guildId, eventId), { reason, signal });
1470
1547
  }
1471
1548
  /**
1472
1549
  * Gets all users that are interested in a scheduled event
@@ -1478,7 +1555,7 @@ var GuildsAPI = class {
1478
1555
  * @param options - The options for fetching the scheduled event users
1479
1556
  */
1480
1557
  async getScheduledEventUsers(guildId, eventId, query = {}, { signal } = {}) {
1481
- return this.rest.get(import_v105.Routes.guildScheduledEventUsers(guildId, eventId), {
1558
+ return this.rest.get(import_v106.Routes.guildScheduledEventUsers(guildId, eventId), {
1482
1559
  query: (0, import_rest3.makeURLSearchParams)(query),
1483
1560
  signal
1484
1561
  });
@@ -1491,7 +1568,7 @@ var GuildsAPI = class {
1491
1568
  * @param options - The options for fetching the templates
1492
1569
  */
1493
1570
  async getTemplates(guildId, { signal } = {}) {
1494
- return this.rest.get(import_v105.Routes.guildTemplates(guildId), { signal });
1571
+ return this.rest.get(import_v106.Routes.guildTemplates(guildId), { signal });
1495
1572
  }
1496
1573
  /**
1497
1574
  * Syncs a template for a guild
@@ -1502,7 +1579,7 @@ var GuildsAPI = class {
1502
1579
  * @param options - The options for syncing the template
1503
1580
  */
1504
1581
  async syncTemplate(guildId, templateCode, { signal } = {}) {
1505
- return this.rest.put(import_v105.Routes.guildTemplate(guildId, templateCode), {
1582
+ return this.rest.put(import_v106.Routes.guildTemplate(guildId, templateCode), {
1506
1583
  signal
1507
1584
  });
1508
1585
  }
@@ -1516,7 +1593,7 @@ var GuildsAPI = class {
1516
1593
  * @param options - The options for editing the template
1517
1594
  */
1518
1595
  async editTemplate(guildId, templateCode, body, { signal } = {}) {
1519
- return this.rest.patch(import_v105.Routes.guildTemplate(guildId, templateCode), {
1596
+ return this.rest.patch(import_v106.Routes.guildTemplate(guildId, templateCode), {
1520
1597
  body,
1521
1598
  signal
1522
1599
  });
@@ -1530,7 +1607,7 @@ var GuildsAPI = class {
1530
1607
  * @param options - The options for deleting the template
1531
1608
  */
1532
1609
  async deleteTemplate(guildId, templateCode, { signal } = {}) {
1533
- await this.rest.delete(import_v105.Routes.guildTemplate(guildId, templateCode), { signal });
1610
+ await this.rest.delete(import_v106.Routes.guildTemplate(guildId, templateCode), { signal });
1534
1611
  }
1535
1612
  /**
1536
1613
  * Fetches all the stickers for a guild
@@ -1540,7 +1617,7 @@ var GuildsAPI = class {
1540
1617
  * @param options - The options for fetching the stickers
1541
1618
  */
1542
1619
  async getStickers(guildId, { signal } = {}) {
1543
- return this.rest.get(import_v105.Routes.guildStickers(guildId), { signal });
1620
+ return this.rest.get(import_v106.Routes.guildStickers(guildId), { signal });
1544
1621
  }
1545
1622
  /**
1546
1623
  * Fetches a sticker for a guild
@@ -1551,7 +1628,7 @@ var GuildsAPI = class {
1551
1628
  * @param options - The options for fetching the sticker
1552
1629
  */
1553
1630
  async getSticker(guildId, stickerId, { signal } = {}) {
1554
- return this.rest.get(import_v105.Routes.guildSticker(guildId, stickerId), { signal });
1631
+ return this.rest.get(import_v106.Routes.guildSticker(guildId, stickerId), { signal });
1555
1632
  }
1556
1633
  /**
1557
1634
  * Creates a sticker for a guild
@@ -1563,7 +1640,7 @@ var GuildsAPI = class {
1563
1640
  */
1564
1641
  async createSticker(guildId, { file, ...body }, { reason, signal } = {}) {
1565
1642
  const fileData = { ...file, key: "file" };
1566
- return this.rest.post(import_v105.Routes.guildStickers(guildId), {
1643
+ return this.rest.post(import_v106.Routes.guildStickers(guildId), {
1567
1644
  appendToFormData: true,
1568
1645
  body,
1569
1646
  files: [fileData],
@@ -1581,7 +1658,7 @@ var GuildsAPI = class {
1581
1658
  * @param options - The options for editing the sticker
1582
1659
  */
1583
1660
  async editSticker(guildId, stickerId, body, { reason, signal } = {}) {
1584
- return this.rest.patch(import_v105.Routes.guildSticker(guildId, stickerId), {
1661
+ return this.rest.patch(import_v106.Routes.guildSticker(guildId, stickerId), {
1585
1662
  reason,
1586
1663
  body,
1587
1664
  signal
@@ -1596,7 +1673,7 @@ var GuildsAPI = class {
1596
1673
  * @param options - The options for deleting the sticker
1597
1674
  */
1598
1675
  async deleteSticker(guildId, stickerId, { reason, signal } = {}) {
1599
- await this.rest.delete(import_v105.Routes.guildSticker(guildId, stickerId), { reason, signal });
1676
+ await this.rest.delete(import_v106.Routes.guildSticker(guildId, stickerId), { reason, signal });
1600
1677
  }
1601
1678
  /**
1602
1679
  * Fetches the audit logs for a guild
@@ -1607,7 +1684,7 @@ var GuildsAPI = class {
1607
1684
  * @param options - The options for fetching the audit logs
1608
1685
  */
1609
1686
  async getAuditLogs(guildId, query = {}, { signal } = {}) {
1610
- return this.rest.get(import_v105.Routes.guildAuditLog(guildId), {
1687
+ return this.rest.get(import_v106.Routes.guildAuditLog(guildId), {
1611
1688
  query: (0, import_rest3.makeURLSearchParams)(query),
1612
1689
  signal
1613
1690
  });
@@ -1620,7 +1697,7 @@ var GuildsAPI = class {
1620
1697
  * @param options - The options for fetching the auto moderation rules
1621
1698
  */
1622
1699
  async getAutoModerationRules(guildId, { signal } = {}) {
1623
- return this.rest.get(import_v105.Routes.guildAutoModerationRules(guildId), {
1700
+ return this.rest.get(import_v106.Routes.guildAutoModerationRules(guildId), {
1624
1701
  signal
1625
1702
  });
1626
1703
  }
@@ -1633,7 +1710,7 @@ var GuildsAPI = class {
1633
1710
  * @param options - The options for fetching the auto moderation rule
1634
1711
  */
1635
1712
  async getAutoModerationRule(guildId, ruleId, { signal } = {}) {
1636
- return this.rest.get(import_v105.Routes.guildAutoModerationRule(guildId, ruleId), {
1713
+ return this.rest.get(import_v106.Routes.guildAutoModerationRule(guildId, ruleId), {
1637
1714
  signal
1638
1715
  });
1639
1716
  }
@@ -1646,7 +1723,7 @@ var GuildsAPI = class {
1646
1723
  * @param options - The options for creating the auto moderation rule
1647
1724
  */
1648
1725
  async createAutoModerationRule(guildId, body, { reason, signal } = {}) {
1649
- return this.rest.post(import_v105.Routes.guildAutoModerationRules(guildId), {
1726
+ return this.rest.post(import_v106.Routes.guildAutoModerationRules(guildId), {
1650
1727
  reason,
1651
1728
  body,
1652
1729
  signal
@@ -1662,7 +1739,7 @@ var GuildsAPI = class {
1662
1739
  * @param options - The options for editing the auto moderation rule
1663
1740
  */
1664
1741
  async editAutoModerationRule(guildId, ruleId, body, { reason, signal } = {}) {
1665
- return this.rest.patch(import_v105.Routes.guildAutoModerationRule(guildId, ruleId), {
1742
+ return this.rest.patch(import_v106.Routes.guildAutoModerationRule(guildId, ruleId), {
1666
1743
  reason,
1667
1744
  body,
1668
1745
  signal
@@ -1677,7 +1754,7 @@ var GuildsAPI = class {
1677
1754
  * @param options - The options for deleting the auto moderation rule
1678
1755
  */
1679
1756
  async deleteAutoModerationRule(guildId, ruleId, { reason, signal } = {}) {
1680
- await this.rest.delete(import_v105.Routes.guildAutoModerationRule(guildId, ruleId), { reason, signal });
1757
+ await this.rest.delete(import_v106.Routes.guildAutoModerationRule(guildId, ruleId), { reason, signal });
1681
1758
  }
1682
1759
  /**
1683
1760
  * Fetches a guild member
@@ -1688,7 +1765,7 @@ var GuildsAPI = class {
1688
1765
  * @param options - The options for fetching the guild member
1689
1766
  */
1690
1767
  async getMember(guildId, userId, { signal } = {}) {
1691
- return this.rest.get(import_v105.Routes.guildMember(guildId, userId), { signal });
1768
+ return this.rest.get(import_v106.Routes.guildMember(guildId, userId), { signal });
1692
1769
  }
1693
1770
  /**
1694
1771
  * Searches for guild members
@@ -1699,7 +1776,7 @@ var GuildsAPI = class {
1699
1776
  * @param options - The options for searching for guild members
1700
1777
  */
1701
1778
  async searchForMembers(guildId, query, { signal } = {}) {
1702
- return this.rest.get(import_v105.Routes.guildMembersSearch(guildId), {
1779
+ return this.rest.get(import_v106.Routes.guildMembersSearch(guildId), {
1703
1780
  query: (0, import_rest3.makeURLSearchParams)(query),
1704
1781
  signal
1705
1782
  });
@@ -1714,7 +1791,7 @@ var GuildsAPI = class {
1714
1791
  * @param options - The options for editing the guild member
1715
1792
  */
1716
1793
  async editMember(guildId, userId, body = {}, { reason, signal } = {}) {
1717
- return this.rest.patch(import_v105.Routes.guildMember(guildId, userId), {
1794
+ return this.rest.patch(import_v106.Routes.guildMember(guildId, userId), {
1718
1795
  reason,
1719
1796
  body,
1720
1797
  signal
@@ -1729,7 +1806,7 @@ var GuildsAPI = class {
1729
1806
  * @param options - The options for removing the guild member
1730
1807
  */
1731
1808
  async removeMember(guildId, userId, { reason, signal } = {}) {
1732
- return this.rest.delete(import_v105.Routes.guildMember(guildId, userId), { reason, signal });
1809
+ return this.rest.delete(import_v106.Routes.guildMember(guildId, userId), { reason, signal });
1733
1810
  }
1734
1811
  /**
1735
1812
  * Adds a role to a guild member
@@ -1741,7 +1818,7 @@ var GuildsAPI = class {
1741
1818
  * @param options - The options for adding a role to a guild member
1742
1819
  */
1743
1820
  async addRoleToMember(guildId, userId, roleId, { reason, signal } = {}) {
1744
- await this.rest.put(import_v105.Routes.guildMemberRole(guildId, userId, roleId), { reason, signal });
1821
+ await this.rest.put(import_v106.Routes.guildMemberRole(guildId, userId, roleId), { reason, signal });
1745
1822
  }
1746
1823
  /**
1747
1824
  * Removes a role from a guild member
@@ -1753,7 +1830,7 @@ var GuildsAPI = class {
1753
1830
  * @param options - The options for removing a role from a guild member
1754
1831
  */
1755
1832
  async removeRoleFromMember(guildId, userId, roleId, { reason, signal } = {}) {
1756
- await this.rest.delete(import_v105.Routes.guildMemberRole(guildId, userId, roleId), { reason, signal });
1833
+ await this.rest.delete(import_v106.Routes.guildMemberRole(guildId, userId, roleId), { reason, signal });
1757
1834
  }
1758
1835
  /**
1759
1836
  * Fetches a guild template
@@ -1763,7 +1840,7 @@ var GuildsAPI = class {
1763
1840
  * @param options - The options for fetching the guild template
1764
1841
  */
1765
1842
  async getTemplate(templateCode, { signal } = {}) {
1766
- return this.rest.get(import_v105.Routes.template(templateCode), { signal });
1843
+ return this.rest.get(import_v106.Routes.template(templateCode), { signal });
1767
1844
  }
1768
1845
  /**
1769
1846
  * Creates a new template
@@ -1774,7 +1851,7 @@ var GuildsAPI = class {
1774
1851
  * @param options - The options for creating the template
1775
1852
  */
1776
1853
  async createTemplate(guildId, body, { signal } = {}) {
1777
- return this.rest.post(import_v105.Routes.guildTemplates(guildId), { body, signal });
1854
+ return this.rest.post(import_v106.Routes.guildTemplates(guildId), { body, signal });
1778
1855
  }
1779
1856
  /**
1780
1857
  * Fetches webhooks for a guild
@@ -1783,7 +1860,7 @@ var GuildsAPI = class {
1783
1860
  * @param id - The id of the guild
1784
1861
  */
1785
1862
  async getWebhooks(id) {
1786
- return this.rest.get(import_v105.Routes.guildWebhooks(id));
1863
+ return this.rest.get(import_v106.Routes.guildWebhooks(id));
1787
1864
  }
1788
1865
  /**
1789
1866
  * Sets the voice state for the current user
@@ -1805,7 +1882,7 @@ var GuildsAPI = class {
1805
1882
  * @param options - The options for fetching the guild onboarding
1806
1883
  */
1807
1884
  async getOnboarding(guildId, { signal } = {}) {
1808
- return this.rest.get(import_v105.Routes.guildOnboarding(guildId), { signal });
1885
+ return this.rest.get(import_v106.Routes.guildOnboarding(guildId), { signal });
1809
1886
  }
1810
1887
  /**
1811
1888
  * Edits a guild onboarding
@@ -1816,16 +1893,98 @@ var GuildsAPI = class {
1816
1893
  * @param options - The options for editing the guild onboarding
1817
1894
  */
1818
1895
  async editOnboarding(guildId, body, { reason, signal } = {}) {
1819
- return this.rest.put(import_v105.Routes.guildOnboarding(guildId), {
1896
+ return this.rest.put(import_v106.Routes.guildOnboarding(guildId), {
1820
1897
  reason,
1821
1898
  body,
1822
1899
  signal
1823
1900
  });
1824
1901
  }
1902
+ /**
1903
+ * Fetches all the soundboard sounds for a guild
1904
+ *
1905
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#list-guild-soundboard-sounds}
1906
+ * @param guildId - The id of the guild to fetch the soundboard sounds for
1907
+ * @param options - The options for fetching the soundboard sounds
1908
+ */
1909
+ async getSoundboardSounds(guildId, { signal } = {}) {
1910
+ return this.rest.get(import_v106.Routes.guildSoundboardSounds(guildId), {
1911
+ signal
1912
+ });
1913
+ }
1914
+ /**
1915
+ * Fetches a soundboard sound for a guild
1916
+ *
1917
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#get-guild-soundboard-sound}
1918
+ * @param guildId - The id of the guild to fetch the soundboard sound for
1919
+ * @param soundId - The id of the soundboard sound to fetch
1920
+ * @param options - The options for fetching the soundboard sound
1921
+ */
1922
+ async getSoundboardSound(guildId, soundId, { signal } = {}) {
1923
+ return this.rest.get(import_v106.Routes.guildSoundboardSound(guildId, soundId), {
1924
+ signal
1925
+ });
1926
+ }
1927
+ /**
1928
+ * Creates a new soundboard sound for a guild
1929
+ *
1930
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound}
1931
+ * @param guildId - The id of the guild to create the soundboard sound for
1932
+ * @param body - The data for creating the soundboard sound
1933
+ * @param options - The options for creating the soundboard sound
1934
+ */
1935
+ async createSoundboardSound(guildId, body, { reason, signal } = {}) {
1936
+ return this.rest.post(import_v106.Routes.guildSoundboardSounds(guildId), {
1937
+ body,
1938
+ reason,
1939
+ signal
1940
+ });
1941
+ }
1942
+ /**
1943
+ * Edits a soundboard sound for a guild
1944
+ *
1945
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound}
1946
+ * @param guildId - The id of the guild to edit the soundboard sound for
1947
+ * @param soundId - The id of the soundboard sound to edit
1948
+ * @param body - The data for editing the soundboard sound
1949
+ * @param options - The options for editing the soundboard sound
1950
+ */
1951
+ async editSoundboardSound(guildId, soundId, body, { reason, signal } = {}) {
1952
+ return this.rest.patch(import_v106.Routes.guildSoundboardSound(guildId, soundId), {
1953
+ body,
1954
+ reason,
1955
+ signal
1956
+ });
1957
+ }
1958
+ /**
1959
+ * Deletes a soundboard sound for a guild
1960
+ *
1961
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound}
1962
+ * @param guildId - The id of the guild to delete the soundboard sound for
1963
+ * @param soundId - The id of the soundboard sound to delete
1964
+ * @param options - The options for deleting the soundboard sound
1965
+ */
1966
+ async deleteSoundboardSound(guildId, soundId, { reason, signal } = {}) {
1967
+ await this.rest.delete(import_v106.Routes.guildSoundboardSound(guildId, soundId), { reason, signal });
1968
+ }
1969
+ /**
1970
+ * Modifies incident actions for a guild.
1971
+ *
1972
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-incident-actions}
1973
+ * @param guildId - The id of the guild
1974
+ * @param body - The data for modifying guild incident actions
1975
+ * @param options - The options for modifying guild incident actions
1976
+ */
1977
+ async editIncidentActions(guildId, body, { signal } = {}) {
1978
+ return this.rest.put(import_v106.Routes.guildIncidentActions(guildId), {
1979
+ body,
1980
+ signal
1981
+ });
1982
+ }
1825
1983
  };
1826
1984
 
1827
1985
  // src/api/interactions.ts
1828
- var import_v106 = require("discord-api-types/v10");
1986
+ var import_rest4 = require("@discordjs/rest");
1987
+ var import_v107 = require("discord-api-types/v10");
1829
1988
  var InteractionsAPI = class {
1830
1989
  constructor(rest, webhooks) {
1831
1990
  this.rest = rest;
@@ -1834,61 +1993,41 @@ var InteractionsAPI = class {
1834
1993
  static {
1835
1994
  __name(this, "InteractionsAPI");
1836
1995
  }
1837
- /**
1838
- * Replies to an interaction
1839
- *
1840
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1841
- * @param interactionId - The id of the interaction
1842
- * @param interactionToken - The token of the interaction
1843
- * @param body - The callback data for replying
1844
- * @param options - The options for replying
1845
- */
1846
- async reply(interactionId, interactionToken, { files, ...data }, { signal } = {}) {
1847
- await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
1996
+ async reply(interactionId, interactionToken, { files, with_response, ...data }, { signal } = {}) {
1997
+ const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
1998
+ query: (0, import_rest4.makeURLSearchParams)({ with_response }),
1848
1999
  files,
1849
2000
  auth: false,
1850
2001
  body: {
1851
- type: import_v106.InteractionResponseType.ChannelMessageWithSource,
2002
+ type: import_v107.InteractionResponseType.ChannelMessageWithSource,
1852
2003
  data
1853
2004
  },
1854
2005
  signal
1855
2006
  });
2007
+ return with_response ? response : void 0;
1856
2008
  }
1857
- /**
1858
- * Defers the reply to an interaction
1859
- *
1860
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1861
- * @param interactionId - The id of the interaction
1862
- * @param interactionToken - The token of the interaction
1863
- * @param data - The data for deferring the reply
1864
- * @param options - The options for deferring
1865
- */
1866
- async defer(interactionId, interactionToken, data, { signal } = {}) {
1867
- await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
2009
+ async defer(interactionId, interactionToken, { with_response, ...data } = {}, { signal } = {}) {
2010
+ const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
2011
+ query: (0, import_rest4.makeURLSearchParams)({ with_response }),
1868
2012
  auth: false,
1869
2013
  body: {
1870
- type: import_v106.InteractionResponseType.DeferredChannelMessageWithSource,
2014
+ type: import_v107.InteractionResponseType.DeferredChannelMessageWithSource,
1871
2015
  data
1872
2016
  },
1873
2017
  signal
1874
2018
  });
2019
+ return with_response ? response : void 0;
1875
2020
  }
1876
- /**
1877
- * Defers an update from a message component interaction
1878
- *
1879
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1880
- * @param interactionId - The id of the interaction
1881
- * @param interactionToken - The token of the interaction
1882
- * @param options - The options for deferring
1883
- */
1884
- async deferMessageUpdate(interactionId, interactionToken, { signal } = {}) {
1885
- await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
2021
+ async deferMessageUpdate(interactionId, interactionToken, { with_response } = {}, { signal } = {}) {
2022
+ const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
2023
+ query: (0, import_rest4.makeURLSearchParams)({ with_response }),
1886
2024
  auth: false,
1887
2025
  body: {
1888
- type: import_v106.InteractionResponseType.DeferredMessageUpdate
2026
+ type: import_v107.InteractionResponseType.DeferredMessageUpdate
1889
2027
  },
1890
2028
  signal
1891
2029
  });
2030
+ return with_response ? response : void 0;
1892
2031
  }
1893
2032
  /**
1894
2033
  * Reply to a deferred interaction
@@ -1948,66 +2087,45 @@ var InteractionsAPI = class {
1948
2087
  async deleteReply(applicationId, interactionToken, messageId, { signal } = {}) {
1949
2088
  await this.webhooks.deleteMessage(applicationId, interactionToken, messageId ?? "@original", {}, { signal });
1950
2089
  }
1951
- /**
1952
- * Updates the message the component interaction was triggered on
1953
- *
1954
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1955
- * @param interactionId - The id of the interaction
1956
- * @param interactionToken - The token of the interaction
1957
- * @param callbackData - The callback data for updating the interaction
1958
- * @param options - The options for updating the interaction
1959
- */
1960
- async updateMessage(interactionId, interactionToken, { files, ...data }, { signal } = {}) {
1961
- await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
2090
+ async updateMessage(interactionId, interactionToken, { files, with_response, ...data }, { signal } = {}) {
2091
+ const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
2092
+ query: (0, import_rest4.makeURLSearchParams)({ with_response }),
1962
2093
  files,
1963
2094
  auth: false,
1964
2095
  body: {
1965
- type: import_v106.InteractionResponseType.UpdateMessage,
2096
+ type: import_v107.InteractionResponseType.UpdateMessage,
1966
2097
  data
1967
2098
  },
1968
2099
  signal
1969
2100
  });
2101
+ return with_response ? response : void 0;
1970
2102
  }
1971
- /**
1972
- * Sends an autocomplete response to an interaction
1973
- *
1974
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1975
- * @param interactionId - The id of the interaction
1976
- * @param interactionToken - The token of the interaction
1977
- * @param callbackData - The callback data for the autocomplete response
1978
- * @param options - The options for sending the autocomplete response
1979
- */
1980
- async createAutocompleteResponse(interactionId, interactionToken, callbackData, { signal } = {}) {
1981
- await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
2103
+ async createAutocompleteResponse(interactionId, interactionToken, { with_response, ...data }, { signal } = {}) {
2104
+ const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
2105
+ query: (0, import_rest4.makeURLSearchParams)({ with_response }),
1982
2106
  auth: false,
1983
2107
  body: {
1984
- type: import_v106.InteractionResponseType.ApplicationCommandAutocompleteResult,
1985
- data: callbackData
2108
+ type: import_v107.InteractionResponseType.ApplicationCommandAutocompleteResult,
2109
+ data
1986
2110
  },
1987
2111
  signal
1988
2112
  });
2113
+ return with_response ? response : void 0;
1989
2114
  }
1990
- /**
1991
- * Sends a modal response to an interaction
1992
- *
1993
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1994
- * @param interactionId - The id of the interaction
1995
- * @param interactionToken - The token of the interaction
1996
- * @param callbackData - The modal callback data to send
1997
- * @param options - The options for sending the modal
1998
- */
1999
- async createModal(interactionId, interactionToken, callbackData, { signal } = {}) {
2000
- await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
2115
+ async createModal(interactionId, interactionToken, { with_response, ...data }, { signal } = {}) {
2116
+ const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
2117
+ query: (0, import_rest4.makeURLSearchParams)({ with_response }),
2001
2118
  auth: false,
2002
2119
  body: {
2003
- type: import_v106.InteractionResponseType.Modal,
2004
- data: callbackData
2120
+ type: import_v107.InteractionResponseType.Modal,
2121
+ data
2005
2122
  },
2006
2123
  signal
2007
2124
  });
2125
+ return with_response ? response : void 0;
2008
2126
  }
2009
2127
  /**
2010
- * Sends a premium required response to an interaction
2128
+ * Launches an activity and returns an interaction callback object
2011
2129
  *
2012
2130
  * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
2013
2131
  * @param interactionId - The id of the interaction
@@ -2016,19 +2134,30 @@ var InteractionsAPI = class {
2016
2134
  * @deprecated Sending a premium-style button is the new Discord behavior.
2017
2135
  */
2018
2136
  async sendPremiumRequired(interactionId, interactionToken, { signal } = {}) {
2019
- await this.rest.post(import_v106.Routes.interactionCallback(interactionId, interactionToken), {
2137
+ await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
2020
2138
  auth: false,
2021
2139
  body: {
2022
- type: import_v106.InteractionResponseType.PremiumRequired
2140
+ type: import_v107.InteractionResponseType.PremiumRequired
2023
2141
  },
2024
2142
  signal
2025
2143
  });
2026
2144
  }
2145
+ async launchActivity(interactionId, interactionToken, { with_response } = {}, { signal } = {}) {
2146
+ const response = await this.rest.post(import_v107.Routes.interactionCallback(interactionId, interactionToken), {
2147
+ query: (0, import_rest4.makeURLSearchParams)({ with_response }),
2148
+ auth: false,
2149
+ body: {
2150
+ type: import_v107.InteractionResponseType.LaunchActivity
2151
+ },
2152
+ signal
2153
+ });
2154
+ return with_response ? response : void 0;
2155
+ }
2027
2156
  };
2028
2157
 
2029
2158
  // src/api/invite.ts
2030
- var import_rest4 = require("@discordjs/rest");
2031
- var import_v107 = require("discord-api-types/v10");
2159
+ var import_rest5 = require("@discordjs/rest");
2160
+ var import_v108 = require("discord-api-types/v10");
2032
2161
  var InvitesAPI = class {
2033
2162
  constructor(rest) {
2034
2163
  this.rest = rest;
@@ -2045,8 +2174,8 @@ var InvitesAPI = class {
2045
2174
  * @param options - The options for fetching the invite
2046
2175
  */
2047
2176
  async get(code, query = {}, { signal } = {}) {
2048
- return this.rest.get(import_v107.Routes.invite(code), {
2049
- query: (0, import_rest4.makeURLSearchParams)(query),
2177
+ return this.rest.get(import_v108.Routes.invite(code), {
2178
+ query: (0, import_rest5.makeURLSearchParams)(query),
2050
2179
  signal
2051
2180
  });
2052
2181
  }
@@ -2058,13 +2187,13 @@ var InvitesAPI = class {
2058
2187
  * @param options - The options for deleting the invite
2059
2188
  */
2060
2189
  async delete(code, { reason, signal } = {}) {
2061
- await this.rest.delete(import_v107.Routes.invite(code), { reason, signal });
2190
+ await this.rest.delete(import_v108.Routes.invite(code), { reason, signal });
2062
2191
  }
2063
2192
  };
2064
2193
 
2065
2194
  // src/api/monetization.ts
2066
- var import_rest5 = require("@discordjs/rest");
2067
- var import_v108 = require("discord-api-types/v10");
2195
+ var import_rest6 = require("@discordjs/rest");
2196
+ var import_v109 = require("discord-api-types/v10");
2068
2197
  var MonetizationAPI = class {
2069
2198
  constructor(rest) {
2070
2199
  this.rest = rest;
@@ -2075,36 +2204,77 @@ var MonetizationAPI = class {
2075
2204
  /**
2076
2205
  * Fetches the SKUs for an application.
2077
2206
  *
2078
- * @see {@link https://discord.com/developers/docs/monetization/skus#list-skus}
2207
+ * @see {@link https://discord.com/developers/docs/resources/sku#list-skus}
2208
+ * @param applicationId - The application id to fetch SKUs for
2079
2209
  * @param options - The options for fetching the SKUs.
2080
2210
  */
2081
2211
  async getSKUs(applicationId, { signal } = {}) {
2082
- return this.rest.get(import_v108.Routes.skus(applicationId), { signal });
2212
+ return this.rest.get(import_v109.Routes.skus(applicationId), { signal });
2213
+ }
2214
+ /**
2215
+ * Fetches subscriptions for an SKU.
2216
+ *
2217
+ * @see {@link https://discord.com/developers/docs/resources/subscription#list-sku-subscriptions}
2218
+ * @param skuId - The SKU id to fetch subscriptions for
2219
+ * @param query - The query options for fetching subscriptions
2220
+ * @param options - The options for fetching subscriptions
2221
+ */
2222
+ async getSKUSubscriptions(skuId, query = {}, { signal } = {}) {
2223
+ return this.rest.get(import_v109.Routes.skuSubscriptions(skuId), {
2224
+ signal,
2225
+ query: (0, import_rest6.makeURLSearchParams)(query)
2226
+ });
2227
+ }
2228
+ /**
2229
+ * Fetches a subscription for an SKU.
2230
+ *
2231
+ * @see {@link https://discord.com/developers/docs/resources/subscription#get-sku-subscription}
2232
+ * @param skuId - The SKU id to fetch subscription for
2233
+ * @param subscriptionId - The subscription id to fetch
2234
+ * @param options - The options for fetching the subscription
2235
+ */
2236
+ async getSKUSubscription(skuId, subscriptionId, { signal } = {}) {
2237
+ return this.rest.get(import_v109.Routes.skuSubscription(skuId, subscriptionId), {
2238
+ signal
2239
+ });
2083
2240
  }
2084
2241
  /**
2085
2242
  * Fetches the entitlements for an application.
2086
2243
  *
2087
- * @see {@link https://discord.com/developers/docs/monetization/entitlements#list-entitlements}
2244
+ * @see {@link https://discord.com/developers/docs/resources/entitlement#list-entitlements}
2088
2245
  * @param applicationId - The application id to fetch entitlements for
2089
2246
  * @param query - The query options for fetching entitlements
2090
2247
  * @param options - The options for fetching entitlements
2091
2248
  */
2092
- async getEntitlements(applicationId, query, { signal } = {}) {
2093
- return this.rest.get(import_v108.Routes.entitlements(applicationId), {
2249
+ async getEntitlements(applicationId, query = {}, { signal } = {}) {
2250
+ return this.rest.get(import_v109.Routes.entitlements(applicationId), {
2094
2251
  signal,
2095
- query: (0, import_rest5.makeURLSearchParams)(query)
2252
+ query: (0, import_rest6.makeURLSearchParams)(query)
2253
+ });
2254
+ }
2255
+ /**
2256
+ * Fetches an entitlement for an application.
2257
+ *
2258
+ * @see {@link https://discord.com/developers/docs/resources/entitlement#get-entitlement}
2259
+ * @param applicationId - The application id to fetch the entitlement for
2260
+ * @param entitlementId - The entitlement id to fetch
2261
+ * @param options - The options for fetching the entitlement
2262
+ */
2263
+ async getEntitlement(applicationId, entitlementId, { signal } = {}) {
2264
+ return this.rest.get(import_v109.Routes.entitlement(applicationId, entitlementId), {
2265
+ signal
2096
2266
  });
2097
2267
  }
2098
2268
  /**
2099
2269
  * Creates a test entitlement for an application's SKU.
2100
2270
  *
2101
- * @see {@link https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement}
2271
+ * @see {@link https://discord.com/developers/docs/resources/entitlement#create-test-entitlement}
2102
2272
  * @param applicationId - The application id to create the entitlement for
2103
2273
  * @param body - The data for creating the entitlement
2104
2274
  * @param options - The options for creating the entitlement
2105
2275
  */
2106
2276
  async createTestEntitlement(applicationId, body, { signal } = {}) {
2107
- return this.rest.post(import_v108.Routes.entitlements(applicationId), {
2277
+ return this.rest.post(import_v109.Routes.entitlements(applicationId), {
2108
2278
  body,
2109
2279
  signal
2110
2280
  });
@@ -2112,30 +2282,30 @@ var MonetizationAPI = class {
2112
2282
  /**
2113
2283
  * Deletes a test entitlement for an application's SKU.
2114
2284
  *
2115
- * @see {@link https://discord.com/developers/docs/monetization/entitlements#delete-test-entitlement}
2285
+ * @see {@link https://discord.com/developers/docs/resources/entitlement#delete-test-entitlement}
2116
2286
  * @param applicationId - The application id to delete the entitlement for
2117
2287
  * @param entitlementId - The entitlement id to delete
2118
2288
  * @param options - The options for deleting the entitlement
2119
2289
  */
2120
2290
  async deleteTestEntitlement(applicationId, entitlementId, { signal } = {}) {
2121
- await this.rest.delete(import_v108.Routes.entitlement(applicationId, entitlementId), { signal });
2291
+ await this.rest.delete(import_v109.Routes.entitlement(applicationId, entitlementId), { signal });
2122
2292
  }
2123
2293
  /**
2124
2294
  * Marks a given entitlement for the user as consumed. Only available for One-Time Purchase consumable SKUs.
2125
2295
  *
2126
- * @see {@link https://discord.com/developers/docs/monetization/entitlements#consume-an-entitlement}
2296
+ * @see {@link https://discord.com/developers/docs/resources/entitlement#consume-an-entitlement}
2127
2297
  * @param applicationId - The application id to consume the entitlement for
2128
2298
  * @param entitlementId - The entitlement id to consume
2129
2299
  * @param options - The options for consuming the entitlement
2130
2300
  */
2131
2301
  async consumeEntitlement(applicationId, entitlementId, { signal } = {}) {
2132
- await this.rest.post(import_v108.Routes.consumeEntitlement(applicationId, entitlementId), { signal });
2302
+ await this.rest.post(import_v109.Routes.consumeEntitlement(applicationId, entitlementId), { signal });
2133
2303
  }
2134
2304
  };
2135
2305
 
2136
2306
  // src/api/oauth2.ts
2137
- var import_rest6 = require("@discordjs/rest");
2138
- var import_v109 = require("discord-api-types/v10");
2307
+ var import_rest7 = require("@discordjs/rest");
2308
+ var import_v1010 = require("discord-api-types/v10");
2139
2309
  var OAuth2API = class {
2140
2310
  constructor(rest) {
2141
2311
  this.rest = rest;
@@ -2150,8 +2320,8 @@ var OAuth2API = class {
2150
2320
  * @param options - The options for creating the authorization URL
2151
2321
  */
2152
2322
  generateAuthorizationURL(options) {
2153
- const url = new URL(`${import_v109.RouteBases.api}${import_v109.Routes.oauth2Authorization()}`);
2154
- url.search = (0, import_rest6.makeURLSearchParams)(options).toString();
2323
+ const url = new URL(`${import_v1010.RouteBases.api}${import_v1010.Routes.oauth2Authorization()}`);
2324
+ url.search = (0, import_rest7.makeURLSearchParams)(options).toString();
2155
2325
  return url.toString();
2156
2326
  }
2157
2327
  /**
@@ -2162,8 +2332,8 @@ var OAuth2API = class {
2162
2332
  * @param options - The options for the token exchange request
2163
2333
  */
2164
2334
  async tokenExchange(body, { signal } = {}) {
2165
- return this.rest.post(import_v109.Routes.oauth2TokenExchange(), {
2166
- body: (0, import_rest6.makeURLSearchParams)(body),
2335
+ return this.rest.post(import_v1010.Routes.oauth2TokenExchange(), {
2336
+ body: (0, import_rest7.makeURLSearchParams)(body),
2167
2337
  passThroughBody: true,
2168
2338
  headers: {
2169
2339
  "Content-Type": "application/x-www-form-urlencoded"
@@ -2180,8 +2350,8 @@ var OAuth2API = class {
2180
2350
  * @param options - The options for the refresh token request
2181
2351
  */
2182
2352
  async refreshToken(body, { signal } = {}) {
2183
- return this.rest.post(import_v109.Routes.oauth2TokenExchange(), {
2184
- body: (0, import_rest6.makeURLSearchParams)(body),
2353
+ return this.rest.post(import_v1010.Routes.oauth2TokenExchange(), {
2354
+ body: (0, import_rest7.makeURLSearchParams)(body),
2185
2355
  passThroughBody: true,
2186
2356
  headers: {
2187
2357
  "Content-Type": "application/x-www-form-urlencoded"
@@ -2200,8 +2370,8 @@ var OAuth2API = class {
2200
2370
  * @param options - The options for the client credentials grant request
2201
2371
  */
2202
2372
  async getToken(body, { signal } = {}) {
2203
- return this.rest.post(import_v109.Routes.oauth2TokenExchange(), {
2204
- body: (0, import_rest6.makeURLSearchParams)(body),
2373
+ return this.rest.post(import_v1010.Routes.oauth2TokenExchange(), {
2374
+ body: (0, import_rest7.makeURLSearchParams)(body),
2205
2375
  passThroughBody: true,
2206
2376
  headers: {
2207
2377
  "Content-Type": "application/x-www-form-urlencoded"
@@ -2217,7 +2387,7 @@ var OAuth2API = class {
2217
2387
  * @param options - The options for the current bot application information request
2218
2388
  */
2219
2389
  async getCurrentBotApplicationInformation({ signal } = {}) {
2220
- return this.rest.get(import_v109.Routes.oauth2CurrentApplication(), {
2390
+ return this.rest.get(import_v1010.Routes.oauth2CurrentApplication(), {
2221
2391
  signal
2222
2392
  });
2223
2393
  }
@@ -2228,7 +2398,7 @@ var OAuth2API = class {
2228
2398
  * @param options - The options for the current authorization information request
2229
2399
  */
2230
2400
  async getCurrentAuthorizationInformation({ signal } = {}) {
2231
- return this.rest.get(import_v109.Routes.oauth2CurrentAuthorization(), {
2401
+ return this.rest.get(import_v1010.Routes.oauth2CurrentAuthorization(), {
2232
2402
  signal
2233
2403
  });
2234
2404
  }
@@ -2242,8 +2412,8 @@ var OAuth2API = class {
2242
2412
  * @param options - The options for the token revocation request
2243
2413
  */
2244
2414
  async revokeToken(applicationId, applicationSecret, body, { signal } = {}) {
2245
- await this.rest.post(import_v109.Routes.oauth2TokenRevocation(), {
2246
- body: (0, import_rest6.makeURLSearchParams)(body),
2415
+ await this.rest.post(import_v1010.Routes.oauth2TokenRevocation(), {
2416
+ body: (0, import_rest7.makeURLSearchParams)(body),
2247
2417
  passThroughBody: true,
2248
2418
  headers: {
2249
2419
  Authorization: `Basic ${btoa(`${applicationId}:${applicationSecret}`)}`,
@@ -2256,8 +2426,8 @@ var OAuth2API = class {
2256
2426
  };
2257
2427
 
2258
2428
  // src/api/poll.ts
2259
- var import_rest7 = require("@discordjs/rest");
2260
- var import_v1010 = require("discord-api-types/v10");
2429
+ var import_rest8 = require("@discordjs/rest");
2430
+ var import_v1011 = require("discord-api-types/v10");
2261
2431
  var PollAPI = class {
2262
2432
  constructor(rest) {
2263
2433
  this.rest = rest;
@@ -2275,10 +2445,10 @@ var PollAPI = class {
2275
2445
  * @param query - The query for getting the list of voters
2276
2446
  * @param options - The options for getting the list of voters
2277
2447
  */
2278
- async getAnswerVoters(channelId, messageId, answerId, query, { signal } = {}) {
2279
- return this.rest.get(import_v1010.Routes.pollAnswerVoters(channelId, messageId, answerId), {
2448
+ async getAnswerVoters(channelId, messageId, answerId, query = {}, { signal } = {}) {
2449
+ return this.rest.get(import_v1011.Routes.pollAnswerVoters(channelId, messageId, answerId), {
2280
2450
  signal,
2281
- query: (0, import_rest7.makeURLSearchParams)(query)
2451
+ query: (0, import_rest8.makeURLSearchParams)(query)
2282
2452
  });
2283
2453
  }
2284
2454
  /**
@@ -2290,14 +2460,14 @@ var PollAPI = class {
2290
2460
  * @param options - The options for expiring the poll
2291
2461
  */
2292
2462
  async expirePoll(channelId, messageId, { signal } = {}) {
2293
- return this.rest.post(import_v1010.Routes.expirePoll(channelId, messageId), {
2463
+ return this.rest.post(import_v1011.Routes.expirePoll(channelId, messageId), {
2294
2464
  signal
2295
2465
  });
2296
2466
  }
2297
2467
  };
2298
2468
 
2299
2469
  // src/api/roleConnections.ts
2300
- var import_v1011 = require("discord-api-types/v10");
2470
+ var import_v1012 = require("discord-api-types/v10");
2301
2471
  var RoleConnectionsAPI = class {
2302
2472
  constructor(rest) {
2303
2473
  this.rest = rest;
@@ -2313,7 +2483,7 @@ var RoleConnectionsAPI = class {
2313
2483
  * @param options - The options for fetching the role connection metadata records
2314
2484
  */
2315
2485
  async getMetadataRecords(applicationId, { signal } = {}) {
2316
- return this.rest.get(import_v1011.Routes.applicationRoleConnectionMetadata(applicationId), {
2486
+ return this.rest.get(import_v1012.Routes.applicationRoleConnectionMetadata(applicationId), {
2317
2487
  signal
2318
2488
  });
2319
2489
  }
@@ -2326,15 +2496,37 @@ var RoleConnectionsAPI = class {
2326
2496
  * @param options - The options for updating the role connection metadata records
2327
2497
  */
2328
2498
  async updateMetadataRecords(applicationId, body, { signal } = {}) {
2329
- return this.rest.put(import_v1011.Routes.applicationRoleConnectionMetadata(applicationId), {
2499
+ return this.rest.put(import_v1012.Routes.applicationRoleConnectionMetadata(applicationId), {
2330
2500
  body,
2331
2501
  signal
2332
2502
  });
2333
2503
  }
2334
2504
  };
2335
2505
 
2506
+ // src/api/soundboardSounds.ts
2507
+ var import_v1013 = require("discord-api-types/v10");
2508
+ var SoundboardSoundsAPI = class {
2509
+ constructor(rest) {
2510
+ this.rest = rest;
2511
+ }
2512
+ static {
2513
+ __name(this, "SoundboardSoundsAPI");
2514
+ }
2515
+ /**
2516
+ * Fetches all the soundboard default sounds.
2517
+ *
2518
+ * @see {@link https://discord.com/developers/docs/resources/soundboard#list-default-soundboard-sounds}
2519
+ * @param options - The options for fetching the soundboard default sounds.
2520
+ */
2521
+ async getSoundboardDefaultSounds({ signal } = {}) {
2522
+ return this.rest.get(import_v1013.Routes.soundboardDefaultSounds(), {
2523
+ signal
2524
+ });
2525
+ }
2526
+ };
2527
+
2336
2528
  // src/api/stageInstances.ts
2337
- var import_v1012 = require("discord-api-types/v10");
2529
+ var import_v1014 = require("discord-api-types/v10");
2338
2530
  var StageInstancesAPI = class {
2339
2531
  constructor(rest) {
2340
2532
  this.rest = rest;
@@ -2350,7 +2542,7 @@ var StageInstancesAPI = class {
2350
2542
  * @param options - The options for creating the new stage instance
2351
2543
  */
2352
2544
  async create(body, { reason, signal } = {}) {
2353
- return this.rest.post(import_v1012.Routes.stageInstances(), {
2545
+ return this.rest.post(import_v1014.Routes.stageInstances(), {
2354
2546
  body,
2355
2547
  reason,
2356
2548
  signal
@@ -2364,7 +2556,7 @@ var StageInstancesAPI = class {
2364
2556
  * @param options - The options for fetching the stage instance
2365
2557
  */
2366
2558
  async get(channelId, { signal } = {}) {
2367
- return this.rest.get(import_v1012.Routes.stageInstance(channelId), { signal });
2559
+ return this.rest.get(import_v1014.Routes.stageInstance(channelId), { signal });
2368
2560
  }
2369
2561
  /**
2370
2562
  * Edits a stage instance
@@ -2375,7 +2567,7 @@ var StageInstancesAPI = class {
2375
2567
  * @param options - The options for editing the stage instance
2376
2568
  */
2377
2569
  async edit(channelId, body, { reason, signal } = {}) {
2378
- return this.rest.patch(import_v1012.Routes.stageInstance(channelId), {
2570
+ return this.rest.patch(import_v1014.Routes.stageInstance(channelId), {
2379
2571
  body,
2380
2572
  reason,
2381
2573
  signal
@@ -2389,12 +2581,12 @@ var StageInstancesAPI = class {
2389
2581
  * @param options - The options for deleting the stage instance
2390
2582
  */
2391
2583
  async delete(channelId, { reason, signal } = {}) {
2392
- await this.rest.delete(import_v1012.Routes.stageInstance(channelId), { reason, signal });
2584
+ await this.rest.delete(import_v1014.Routes.stageInstance(channelId), { reason, signal });
2393
2585
  }
2394
2586
  };
2395
2587
 
2396
2588
  // src/api/sticker.ts
2397
- var import_v1013 = require("discord-api-types/v10");
2589
+ var import_v1015 = require("discord-api-types/v10");
2398
2590
  var StickersAPI = class {
2399
2591
  constructor(rest) {
2400
2592
  this.rest = rest;
@@ -2410,7 +2602,7 @@ var StickersAPI = class {
2410
2602
  * @param options - The options for fetching the sticker pack
2411
2603
  */
2412
2604
  async getStickerPack(packId, { signal } = {}) {
2413
- return this.rest.get(import_v1013.Routes.stickerPack(packId), { signal });
2605
+ return this.rest.get(import_v1015.Routes.stickerPack(packId), { signal });
2414
2606
  }
2415
2607
  /**
2416
2608
  * Fetches all of the sticker packs
@@ -2419,7 +2611,7 @@ var StickersAPI = class {
2419
2611
  * @param options - The options for fetching the sticker packs
2420
2612
  */
2421
2613
  async getStickers({ signal } = {}) {
2422
- return this.rest.get(import_v1013.Routes.stickerPacks(), { signal });
2614
+ return this.rest.get(import_v1015.Routes.stickerPacks(), { signal });
2423
2615
  }
2424
2616
  /**
2425
2617
  * Fetches all of the sticker packs
@@ -2439,12 +2631,12 @@ var StickersAPI = class {
2439
2631
  * @param options - The options for fetching the sticker
2440
2632
  */
2441
2633
  async get(stickerId, { signal } = {}) {
2442
- return this.rest.get(import_v1013.Routes.sticker(stickerId), { signal });
2634
+ return this.rest.get(import_v1015.Routes.sticker(stickerId), { signal });
2443
2635
  }
2444
2636
  };
2445
2637
 
2446
2638
  // src/api/thread.ts
2447
- var import_v1014 = require("discord-api-types/v10");
2639
+ var import_v1016 = require("discord-api-types/v10");
2448
2640
  var ThreadsAPI = class {
2449
2641
  constructor(rest) {
2450
2642
  this.rest = rest;
@@ -2460,7 +2652,7 @@ var ThreadsAPI = class {
2460
2652
  * @param options - The options for joining the thread
2461
2653
  */
2462
2654
  async join(threadId, { signal } = {}) {
2463
- await this.rest.put(import_v1014.Routes.threadMembers(threadId, "@me"), { signal });
2655
+ await this.rest.put(import_v1016.Routes.threadMembers(threadId, "@me"), { signal });
2464
2656
  }
2465
2657
  /**
2466
2658
  * Adds a member to a thread
@@ -2471,7 +2663,7 @@ var ThreadsAPI = class {
2471
2663
  * @param options - The options for adding the member to the thread
2472
2664
  */
2473
2665
  async addMember(threadId, userId, { signal } = {}) {
2474
- await this.rest.put(import_v1014.Routes.threadMembers(threadId, userId), { signal });
2666
+ await this.rest.put(import_v1016.Routes.threadMembers(threadId, userId), { signal });
2475
2667
  }
2476
2668
  /**
2477
2669
  * Removes the current user from a thread
@@ -2481,7 +2673,7 @@ var ThreadsAPI = class {
2481
2673
  * @param options - The options for leaving the thread
2482
2674
  */
2483
2675
  async leave(threadId, { signal } = {}) {
2484
- await this.rest.delete(import_v1014.Routes.threadMembers(threadId, "@me"), { signal });
2676
+ await this.rest.delete(import_v1016.Routes.threadMembers(threadId, "@me"), { signal });
2485
2677
  }
2486
2678
  /**
2487
2679
  * Removes a member from a thread
@@ -2492,7 +2684,7 @@ var ThreadsAPI = class {
2492
2684
  * @param options - The options for removing the member from the thread
2493
2685
  */
2494
2686
  async removeMember(threadId, userId, { signal } = {}) {
2495
- await this.rest.delete(import_v1014.Routes.threadMembers(threadId, userId), { signal });
2687
+ await this.rest.delete(import_v1016.Routes.threadMembers(threadId, userId), { signal });
2496
2688
  }
2497
2689
  /**
2498
2690
  * Fetches a member of a thread
@@ -2503,7 +2695,7 @@ var ThreadsAPI = class {
2503
2695
  * @param options - The options for fetching the member
2504
2696
  */
2505
2697
  async getMember(threadId, userId, { signal } = {}) {
2506
- return this.rest.get(import_v1014.Routes.threadMembers(threadId, userId), { signal });
2698
+ return this.rest.get(import_v1016.Routes.threadMembers(threadId, userId), { signal });
2507
2699
  }
2508
2700
  /**
2509
2701
  * Fetches all members of a thread
@@ -2513,13 +2705,13 @@ var ThreadsAPI = class {
2513
2705
  * @param options - The options for fetching the members
2514
2706
  */
2515
2707
  async getAllMembers(threadId, { signal } = {}) {
2516
- return this.rest.get(import_v1014.Routes.threadMembers(threadId), { signal });
2708
+ return this.rest.get(import_v1016.Routes.threadMembers(threadId), { signal });
2517
2709
  }
2518
2710
  };
2519
2711
 
2520
2712
  // src/api/user.ts
2521
- var import_rest8 = require("@discordjs/rest");
2522
- var import_v1015 = require("discord-api-types/v10");
2713
+ var import_rest9 = require("@discordjs/rest");
2714
+ var import_v1017 = require("discord-api-types/v10");
2523
2715
  var UsersAPI = class {
2524
2716
  constructor(rest) {
2525
2717
  this.rest = rest;
@@ -2535,7 +2727,7 @@ var UsersAPI = class {
2535
2727
  * @param options - The options for fetching the user
2536
2728
  */
2537
2729
  async get(userId, { signal } = {}) {
2538
- return this.rest.get(import_v1015.Routes.user(userId), { signal });
2730
+ return this.rest.get(import_v1017.Routes.user(userId), { signal });
2539
2731
  }
2540
2732
  /**
2541
2733
  * Returns the user object of the requester's account
@@ -2544,7 +2736,7 @@ var UsersAPI = class {
2544
2736
  * @param options - The options for fetching the current user
2545
2737
  */
2546
2738
  async getCurrent({ signal } = {}) {
2547
- return this.rest.get(import_v1015.Routes.user("@me"), { signal });
2739
+ return this.rest.get(import_v1017.Routes.user("@me"), { signal });
2548
2740
  }
2549
2741
  /**
2550
2742
  * Returns a list of partial guild objects the current user is a member of
@@ -2554,8 +2746,8 @@ var UsersAPI = class {
2554
2746
  * @param options - The options for fetching the guilds
2555
2747
  */
2556
2748
  async getGuilds(query = {}, { signal } = {}) {
2557
- return this.rest.get(import_v1015.Routes.userGuilds(), {
2558
- query: (0, import_rest8.makeURLSearchParams)(query),
2749
+ return this.rest.get(import_v1017.Routes.userGuilds(), {
2750
+ query: (0, import_rest9.makeURLSearchParams)(query),
2559
2751
  signal
2560
2752
  });
2561
2753
  }
@@ -2567,7 +2759,7 @@ var UsersAPI = class {
2567
2759
  * @param options - The options for leaving the guild
2568
2760
  */
2569
2761
  async leaveGuild(guildId, { signal } = {}) {
2570
- await this.rest.delete(import_v1015.Routes.userGuild(guildId), { signal });
2762
+ await this.rest.delete(import_v1017.Routes.userGuild(guildId), { signal });
2571
2763
  }
2572
2764
  /**
2573
2765
  * Edits the current user
@@ -2577,7 +2769,7 @@ var UsersAPI = class {
2577
2769
  * @param options - The options for editing the user
2578
2770
  */
2579
2771
  async edit(body, { signal } = {}) {
2580
- return this.rest.patch(import_v1015.Routes.user("@me"), { body, signal });
2772
+ return this.rest.patch(import_v1017.Routes.user("@me"), { body, signal });
2581
2773
  }
2582
2774
  /**
2583
2775
  * Fetches the guild member for the current user
@@ -2587,7 +2779,7 @@ var UsersAPI = class {
2587
2779
  * @param options - The options for fetching the guild member
2588
2780
  */
2589
2781
  async getGuildMember(guildId, { signal } = {}) {
2590
- return this.rest.get(import_v1015.Routes.userGuildMember(guildId), { signal });
2782
+ return this.rest.get(import_v1017.Routes.userGuildMember(guildId), { signal });
2591
2783
  }
2592
2784
  /**
2593
2785
  * Edits the guild member for the current user
@@ -2598,7 +2790,7 @@ var UsersAPI = class {
2598
2790
  * @param options - The options for editing the guild member
2599
2791
  */
2600
2792
  async editCurrentGuildMember(guildId, body = {}, { reason, signal } = {}) {
2601
- return this.rest.patch(import_v1015.Routes.guildMember(guildId, "@me"), {
2793
+ return this.rest.patch(import_v1017.Routes.guildMember(guildId, "@me"), {
2602
2794
  reason,
2603
2795
  body,
2604
2796
  signal
@@ -2612,7 +2804,7 @@ var UsersAPI = class {
2612
2804
  * @param options - The options for opening the DM
2613
2805
  */
2614
2806
  async createDM(userId, { signal } = {}) {
2615
- return this.rest.post(import_v1015.Routes.userChannels(), {
2807
+ return this.rest.post(import_v1017.Routes.userChannels(), {
2616
2808
  body: { recipient_id: userId },
2617
2809
  signal
2618
2810
  });
@@ -2624,7 +2816,7 @@ var UsersAPI = class {
2624
2816
  * @param options - The options for fetching the user's connections
2625
2817
  */
2626
2818
  async getConnections({ signal } = {}) {
2627
- return this.rest.get(import_v1015.Routes.userConnections(), { signal });
2819
+ return this.rest.get(import_v1017.Routes.userConnections(), { signal });
2628
2820
  }
2629
2821
  /**
2630
2822
  * Gets the current user's active application role connection
@@ -2634,7 +2826,7 @@ var UsersAPI = class {
2634
2826
  * @param options - The options for fetching the role connections
2635
2827
  */
2636
2828
  async getApplicationRoleConnection(applicationId, { signal } = {}) {
2637
- return this.rest.get(import_v1015.Routes.userApplicationRoleConnection(applicationId), {
2829
+ return this.rest.get(import_v1017.Routes.userApplicationRoleConnection(applicationId), {
2638
2830
  signal
2639
2831
  });
2640
2832
  }
@@ -2647,7 +2839,7 @@ var UsersAPI = class {
2647
2839
  * @param options - The options for updating the application role connection
2648
2840
  */
2649
2841
  async updateApplicationRoleConnection(applicationId, body, { signal } = {}) {
2650
- return this.rest.put(import_v1015.Routes.userApplicationRoleConnection(applicationId), {
2842
+ return this.rest.put(import_v1017.Routes.userApplicationRoleConnection(applicationId), {
2651
2843
  body,
2652
2844
  signal
2653
2845
  });
@@ -2655,8 +2847,8 @@ var UsersAPI = class {
2655
2847
  };
2656
2848
 
2657
2849
  // src/api/webhook.ts
2658
- var import_rest9 = require("@discordjs/rest");
2659
- var import_v1016 = require("discord-api-types/v10");
2850
+ var import_rest10 = require("@discordjs/rest");
2851
+ var import_v1018 = require("discord-api-types/v10");
2660
2852
  var WebhooksAPI = class {
2661
2853
  constructor(rest) {
2662
2854
  this.rest = rest;
@@ -2673,7 +2865,7 @@ var WebhooksAPI = class {
2673
2865
  * @param options - The options for fetching the webhook
2674
2866
  */
2675
2867
  async get(id, { token, signal } = {}) {
2676
- return this.rest.get(import_v1016.Routes.webhook(id, token), {
2868
+ return this.rest.get(import_v1018.Routes.webhook(id, token), {
2677
2869
  signal,
2678
2870
  auth: !token
2679
2871
  });
@@ -2688,7 +2880,7 @@ var WebhooksAPI = class {
2688
2880
  * @param options - The options for editing the webhook
2689
2881
  */
2690
2882
  async edit(id, body, { token, reason, signal } = {}) {
2691
- return this.rest.patch(import_v1016.Routes.webhook(id, token), {
2883
+ return this.rest.patch(import_v1018.Routes.webhook(id, token), {
2692
2884
  reason,
2693
2885
  body,
2694
2886
  signal,
@@ -2704,7 +2896,7 @@ var WebhooksAPI = class {
2704
2896
  * @param options - The options for deleting the webhook
2705
2897
  */
2706
2898
  async delete(id, { token, reason, signal } = {}) {
2707
- await this.rest.delete(import_v1016.Routes.webhook(id, token), {
2899
+ await this.rest.delete(import_v1018.Routes.webhook(id, token), {
2708
2900
  reason,
2709
2901
  signal,
2710
2902
  auth: !token
@@ -2719,15 +2911,9 @@ var WebhooksAPI = class {
2719
2911
  * @param body - The data for executing the webhook
2720
2912
  * @param options - The options for executing the webhook
2721
2913
  */
2722
- async execute(id, token, {
2723
- wait,
2724
- thread_id,
2725
- with_components,
2726
- files,
2727
- ...body
2728
- }, { signal } = {}) {
2729
- return this.rest.post(import_v1016.Routes.webhook(id, token), {
2730
- query: (0, import_rest9.makeURLSearchParams)({ wait, thread_id, with_components }),
2914
+ async execute(id, token, { wait, thread_id, with_components, files, ...body }, { signal } = {}) {
2915
+ return this.rest.post(import_v1018.Routes.webhook(id, token), {
2916
+ query: (0, import_rest10.makeURLSearchParams)({ wait, thread_id, with_components }),
2731
2917
  files,
2732
2918
  body,
2733
2919
  auth: false,
@@ -2746,8 +2932,8 @@ var WebhooksAPI = class {
2746
2932
  * @param options - The options for executing the webhook
2747
2933
  */
2748
2934
  async executeSlack(id, token, body, query = {}, { signal } = {}) {
2749
- await this.rest.post(import_v1016.Routes.webhookPlatform(id, token, "slack"), {
2750
- query: (0, import_rest9.makeURLSearchParams)(query),
2935
+ await this.rest.post(import_v1018.Routes.webhookPlatform(id, token, "slack"), {
2936
+ query: (0, import_rest10.makeURLSearchParams)(query),
2751
2937
  body,
2752
2938
  auth: false,
2753
2939
  signal
@@ -2764,8 +2950,8 @@ var WebhooksAPI = class {
2764
2950
  * @param options - The options for executing the webhook
2765
2951
  */
2766
2952
  async executeGitHub(id, token, body, query = {}, { signal } = {}) {
2767
- await this.rest.post(import_v1016.Routes.webhookPlatform(id, token, "github"), {
2768
- query: (0, import_rest9.makeURLSearchParams)(query),
2953
+ await this.rest.post(import_v1018.Routes.webhookPlatform(id, token, "github"), {
2954
+ query: (0, import_rest10.makeURLSearchParams)(query),
2769
2955
  body,
2770
2956
  signal,
2771
2957
  auth: false
@@ -2782,8 +2968,8 @@ var WebhooksAPI = class {
2782
2968
  * @param options - The options for fetching the message
2783
2969
  */
2784
2970
  async getMessage(id, token, messageId, query = {}, { signal } = {}) {
2785
- return this.rest.get(import_v1016.Routes.webhookMessage(id, token, messageId), {
2786
- query: (0, import_rest9.makeURLSearchParams)(query),
2971
+ return this.rest.get(import_v1018.Routes.webhookMessage(id, token, messageId), {
2972
+ query: (0, import_rest10.makeURLSearchParams)(query),
2787
2973
  auth: false,
2788
2974
  signal
2789
2975
  });
@@ -2798,14 +2984,9 @@ var WebhooksAPI = class {
2798
2984
  * @param body - The data for editing the message
2799
2985
  * @param options - The options for editing the message
2800
2986
  */
2801
- async editMessage(id, token, messageId, {
2802
- thread_id,
2803
- with_components,
2804
- files,
2805
- ...body
2806
- }, { signal } = {}) {
2807
- return this.rest.patch(import_v1016.Routes.webhookMessage(id, token, messageId), {
2808
- query: (0, import_rest9.makeURLSearchParams)({ thread_id, with_components }),
2987
+ async editMessage(id, token, messageId, { thread_id, with_components, files, ...body }, { signal } = {}) {
2988
+ return this.rest.patch(import_v1018.Routes.webhookMessage(id, token, messageId), {
2989
+ query: (0, import_rest10.makeURLSearchParams)({ thread_id, with_components }),
2809
2990
  auth: false,
2810
2991
  body,
2811
2992
  signal,
@@ -2823,8 +3004,8 @@ var WebhooksAPI = class {
2823
3004
  * @param options - The options for deleting the message
2824
3005
  */
2825
3006
  async deleteMessage(id, token, messageId, query = {}, { signal } = {}) {
2826
- await this.rest.delete(import_v1016.Routes.webhookMessage(id, token, messageId), {
2827
- query: (0, import_rest9.makeURLSearchParams)(query),
3007
+ await this.rest.delete(import_v1018.Routes.webhookMessage(id, token, messageId), {
3008
+ query: (0, import_rest10.makeURLSearchParams)(query),
2828
3009
  auth: false,
2829
3010
  signal
2830
3011
  });
@@ -2838,12 +3019,14 @@ var API = class {
2838
3019
  this.applicationCommands = new ApplicationCommandsAPI(rest);
2839
3020
  this.applications = new ApplicationsAPI(rest);
2840
3021
  this.channels = new ChannelsAPI(rest);
3022
+ this.gateway = new GatewayAPI(rest);
2841
3023
  this.guilds = new GuildsAPI(rest);
2842
3024
  this.invites = new InvitesAPI(rest);
2843
3025
  this.monetization = new MonetizationAPI(rest);
2844
3026
  this.oauth2 = new OAuth2API(rest);
2845
3027
  this.poll = new PollAPI(rest);
2846
3028
  this.roleConnections = new RoleConnectionsAPI(rest);
3029
+ this.soundboardSounds = new SoundboardSoundsAPI(rest);
2847
3030
  this.stageInstances = new StageInstancesAPI(rest);
2848
3031
  this.stickers = new StickersAPI(rest);
2849
3032
  this.threads = new ThreadsAPI(rest);
@@ -2858,6 +3041,7 @@ var API = class {
2858
3041
  applicationCommands;
2859
3042
  applications;
2860
3043
  channels;
3044
+ gateway;
2861
3045
  guilds;
2862
3046
  interactions;
2863
3047
  invites;
@@ -2865,6 +3049,7 @@ var API = class {
2865
3049
  oauth2;
2866
3050
  poll;
2867
3051
  roleConnections;
3052
+ soundboardSounds;
2868
3053
  stageInstances;
2869
3054
  stickers;
2870
3055
  threads;
@@ -2879,7 +3064,11 @@ var import_util = require("@discordjs/util");
2879
3064
  var import_ws = require("@discordjs/ws");
2880
3065
  var import_snowflake = require("@sapphire/snowflake");
2881
3066
  var import_async_event_emitter = require("@vladfrangu/async_event_emitter");
2882
- var import_v1017 = require("discord-api-types/v10");
3067
+ var import_v1019 = require("discord-api-types/v10");
3068
+ function createTimer(controller, timeout) {
3069
+ return (0, import_node_timers.setTimeout)(() => controller.abort(), timeout);
3070
+ }
3071
+ __name(createTimer, "createTimer");
2883
3072
  var Client = class extends import_async_event_emitter.AsyncEventEmitter {
2884
3073
  static {
2885
3074
  __name(this, "Client");
@@ -2914,12 +3103,21 @@ var Client = class extends import_async_event_emitter.AsyncEventEmitter {
2914
3103
  const shardId = (0, import_util.calculateShardId)(options.guild_id, await this.gateway.getShardCount());
2915
3104
  const nonce = options.nonce ?? import_snowflake.DiscordSnowflake.generate().toString();
2916
3105
  const controller = new AbortController();
2917
- const createTimer = /* @__PURE__ */ __name(() => (0, import_node_timers.setTimeout)(() => {
2918
- controller.abort();
2919
- }, timeout), "createTimer");
2920
- let timer = createTimer();
3106
+ let timer = createTimer(controller, timeout);
3107
+ const onRatelimit = /* @__PURE__ */ __name(({ data }) => {
3108
+ if (data.meta.nonce === nonce) {
3109
+ controller.abort(new import_util.GatewayRateLimitError(data, options));
3110
+ }
3111
+ }, "onRatelimit");
3112
+ const cleanup = /* @__PURE__ */ __name(() => {
3113
+ if (timer) {
3114
+ (0, import_node_timers.clearTimeout)(timer);
3115
+ }
3116
+ this.off(import_v1019.GatewayDispatchEvents.RateLimited, onRatelimit);
3117
+ }, "cleanup");
3118
+ this.on(import_v1019.GatewayDispatchEvents.RateLimited, onRatelimit);
2921
3119
  await this.gateway.send(shardId, {
2922
- op: import_v1017.GatewayOpcodes.RequestGuildMembers,
3120
+ op: import_v1019.GatewayOpcodes.RequestGuildMembers,
2923
3121
  // eslint-disable-next-line id-length
2924
3122
  d: {
2925
3123
  ...options,
@@ -2927,7 +3125,7 @@ var Client = class extends import_async_event_emitter.AsyncEventEmitter {
2927
3125
  }
2928
3126
  });
2929
3127
  try {
2930
- const iterator = import_async_event_emitter.AsyncEventEmitter.on(this, import_v1017.GatewayDispatchEvents.GuildMembersChunk, {
3128
+ const iterator = import_async_event_emitter.AsyncEventEmitter.on(this, import_v1019.GatewayDispatchEvents.GuildMembersChunk, {
2931
3129
  signal: controller.signal
2932
3130
  });
2933
3131
  for await (const [{ data }] of iterator) {
@@ -2942,21 +3140,19 @@ var Client = class extends import_async_event_emitter.AsyncEventEmitter {
2942
3140
  chunkIndex: data.chunk_index,
2943
3141
  chunkCount: data.chunk_count
2944
3142
  };
2945
- if (data.chunk_index >= data.chunk_count - 1) {
2946
- break;
2947
- } else {
2948
- timer = createTimer();
2949
- }
3143
+ if (data.chunk_index >= data.chunk_count - 1) break;
3144
+ timer = createTimer(controller, timeout);
2950
3145
  }
2951
3146
  } catch (error) {
2952
3147
  if (error instanceof Error && error.name === "AbortError") {
3148
+ if (error.cause instanceof import_util.GatewayRateLimitError) {
3149
+ throw error.cause;
3150
+ }
2953
3151
  throw new Error("Request timed out");
2954
3152
  }
2955
3153
  throw error;
2956
3154
  } finally {
2957
- if (timer) {
2958
- (0, import_node_timers.clearTimeout)(timer);
2959
- }
3155
+ cleanup();
2960
3156
  }
2961
3157
  }
2962
3158
  /**
@@ -2983,6 +3179,86 @@ var Client = class extends import_async_event_emitter.AsyncEventEmitter {
2983
3179
  }
2984
3180
  return { members, nonce, notFound, presences };
2985
3181
  }
3182
+ /**
3183
+ * Requests soundboard sounds from the gateway and returns an async iterator that yields the data from each soundboard sounds event.
3184
+ *
3185
+ * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds}
3186
+ * @param options - The options for the request
3187
+ * @param timeout - The timeout for waiting for each soundboard sounds
3188
+ * @example
3189
+ * Requesting soundboard sounds for specific guilds
3190
+ * ```ts
3191
+ * for await (const { guildId, soundboardSounds } of this.requestSoundboardSoundsIterator({
3192
+ * guild_ids: ['1234567890', '9876543210'],
3193
+ * })) {
3194
+ * console.log(`Soundboard sounds for guild ${guildId}:`, soundboardSounds);
3195
+ * }
3196
+ * ```
3197
+ */
3198
+ async *requestSoundboardSoundsIterator(options, timeout = 1e4) {
3199
+ const shardCount = await this.gateway.getShardCount();
3200
+ const shardIds = Map.groupBy(options.guild_ids, (guildId) => (0, import_util.calculateShardId)(guildId, shardCount));
3201
+ const controller = new AbortController();
3202
+ let timer = createTimer(controller, timeout);
3203
+ for (const [shardId, guildIds] of shardIds) {
3204
+ await this.gateway.send(shardId, {
3205
+ op: import_v1019.GatewayOpcodes.RequestSoundboardSounds,
3206
+ // eslint-disable-next-line id-length
3207
+ d: {
3208
+ ...options,
3209
+ guild_ids: guildIds
3210
+ }
3211
+ });
3212
+ }
3213
+ try {
3214
+ const iterator = import_async_event_emitter.AsyncEventEmitter.on(this, import_v1019.GatewayDispatchEvents.SoundboardSounds, {
3215
+ signal: controller.signal
3216
+ });
3217
+ const guildIds = new Set(options.guild_ids);
3218
+ for await (const [{ data }] of iterator) {
3219
+ if (!guildIds.has(data.guild_id)) continue;
3220
+ (0, import_node_timers.clearTimeout)(timer);
3221
+ timer = void 0;
3222
+ yield {
3223
+ guildId: data.guild_id,
3224
+ soundboardSounds: data.soundboard_sounds
3225
+ };
3226
+ guildIds.delete(data.guild_id);
3227
+ if (guildIds.size === 0) break;
3228
+ timer = createTimer(controller, timeout);
3229
+ }
3230
+ } catch (error) {
3231
+ if (error instanceof Error && error.name === "AbortError") {
3232
+ throw new Error("Request timed out");
3233
+ }
3234
+ throw error;
3235
+ } finally {
3236
+ if (timer) {
3237
+ (0, import_node_timers.clearTimeout)(timer);
3238
+ }
3239
+ }
3240
+ }
3241
+ /**
3242
+ * Requests soundboard sounds from the gateway.
3243
+ *
3244
+ * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds}
3245
+ * @param options - The options for the request
3246
+ * @param timeout - The timeout for waiting for each soundboard sounds event
3247
+ * @example
3248
+ * Requesting soundboard sounds for specific guilds
3249
+ * ```ts
3250
+ * const soundboardSounds = await client.requestSoundboardSounds({ guild_ids: ['1234567890', '9876543210'], });
3251
+ *
3252
+ * console.log(soundboardSounds.get('1234567890'));
3253
+ * ```
3254
+ */
3255
+ async requestSoundboardSounds(options, timeout = 1e4) {
3256
+ const soundboardSounds = /* @__PURE__ */ new Map();
3257
+ for await (const data of this.requestSoundboardSoundsIterator(options, timeout)) {
3258
+ soundboardSounds.set(data.guildId, data.soundboardSounds);
3259
+ }
3260
+ return soundboardSounds;
3261
+ }
2986
3262
  /**
2987
3263
  * Updates the voice state of the bot user
2988
3264
  *
@@ -2992,7 +3268,7 @@ var Client = class extends import_async_event_emitter.AsyncEventEmitter {
2992
3268
  async updateVoiceState(options) {
2993
3269
  const shardId = (0, import_util.calculateShardId)(options.guild_id, await this.gateway.getShardCount());
2994
3270
  await this.gateway.send(shardId, {
2995
- op: import_v1017.GatewayOpcodes.VoiceStateUpdate,
3271
+ op: import_v1019.GatewayOpcodes.VoiceStateUpdate,
2996
3272
  // eslint-disable-next-line id-length
2997
3273
  d: options
2998
3274
  });
@@ -3005,7 +3281,7 @@ var Client = class extends import_async_event_emitter.AsyncEventEmitter {
3005
3281
  */
3006
3282
  async updatePresence(shardId, options) {
3007
3283
  await this.gateway.send(shardId, {
3008
- op: import_v1017.GatewayOpcodes.PresenceUpdate,
3284
+ op: import_v1019.GatewayOpcodes.PresenceUpdate,
3009
3285
  // eslint-disable-next-line id-length
3010
3286
  d: options
3011
3287
  });
@@ -3037,8 +3313,9 @@ function withFiles(files, options) {
3037
3313
  __name(withFiles, "withFiles");
3038
3314
 
3039
3315
  // src/index.ts
3040
- __reExport(src_exports, require("discord-api-types/v10"), module.exports);
3041
- var version = "2.2.2";
3316
+ __reExport(index_exports, require("discord-api-types/v10"), module.exports);
3317
+ var import_util2 = require("@discordjs/util");
3318
+ var version = "2.4.0";
3042
3319
  // Annotate the CommonJS export names for ESM import in node:
3043
3320
  0 && (module.exports = {
3044
3321
  API,
@@ -3046,6 +3323,8 @@ var version = "2.2.2";
3046
3323
  ApplicationsAPI,
3047
3324
  ChannelsAPI,
3048
3325
  Client,
3326
+ GatewayAPI,
3327
+ GatewayRateLimitError,
3049
3328
  GuildsAPI,
3050
3329
  InteractionsAPI,
3051
3330
  InvitesAPI,
@@ -3053,6 +3332,7 @@ var version = "2.2.2";
3053
3332
  OAuth2API,
3054
3333
  PollAPI,
3055
3334
  RoleConnectionsAPI,
3335
+ SoundboardSoundsAPI,
3056
3336
  StageInstancesAPI,
3057
3337
  StickersAPI,
3058
3338
  ThreadsAPI,