@discordjs/core 0.3.1-dev.1677326689-4e0e125.0 → 0.3.1-dev.1677585862-dc142c4.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
@@ -47,75 +47,186 @@ var ApplicationCommandsAPI = class {
47
47
  constructor(rest) {
48
48
  this.rest = rest;
49
49
  }
50
+ /**
51
+ * Fetches all global commands for a application
52
+ *
53
+ * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands}
54
+ * @param applicationId - The application id to fetch commands for
55
+ * @param options - The options to use when fetching commands
56
+ */
50
57
  async getGlobalCommands(applicationId, options = {}) {
51
58
  return this.rest.get(import_v10.Routes.applicationCommands(applicationId), {
52
59
  query: (0, import_rest.makeURLSearchParams)(options)
53
60
  });
54
61
  }
62
+ /**
63
+ * Creates a new global command
64
+ *
65
+ * @see {@link https://discord.com/developers/docs/interactions/application-commands#create-global-application-command}
66
+ * @param applicationId - The application id to create the command for
67
+ * @param data - The data to use when creating the command
68
+ */
55
69
  async createGlobalCommand(applicationId, data) {
56
70
  return this.rest.post(import_v10.Routes.applicationCommands(applicationId), {
57
71
  body: data
58
72
  });
59
73
  }
74
+ /**
75
+ * Fetches a global command
76
+ *
77
+ * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-command}
78
+ * @param applicationId - The application id to fetch the command from
79
+ * @param commandId - The command id to fetch
80
+ */
60
81
  async getGlobalCommand(applicationId, commandId) {
61
- return this.rest.get(
62
- import_v10.Routes.applicationCommand(applicationId, commandId)
63
- );
64
- }
82
+ return this.rest.get(import_v10.Routes.applicationCommand(applicationId, commandId));
83
+ }
84
+ /**
85
+ * Edits a global command
86
+ *
87
+ * @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command}
88
+ * @param applicationId - The application id of the command
89
+ * @param commandId - The id of the command to edit
90
+ * @param data - The data to use when editing the command
91
+ */
65
92
  async editGlobalCommand(applicationId, commandId, data) {
66
93
  return this.rest.patch(import_v10.Routes.applicationCommand(applicationId, commandId), {
67
94
  body: data
68
95
  });
69
96
  }
97
+ /**
98
+ * Deletes a global command
99
+ *
100
+ * @see {@link https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command}
101
+ * @param applicationId - The application id of the command
102
+ * @param commandId - The id of the command to delete
103
+ */
70
104
  async deleteGlobalCommand(applicationId, commandId) {
71
105
  await this.rest.delete(import_v10.Routes.applicationCommand(applicationId, commandId));
72
106
  }
107
+ /**
108
+ * Overwrites global commands
109
+ *
110
+ * @see {@link https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands}
111
+ * @param applicationId - The application id to overwrite commands for
112
+ * @param data - The data to use when overwriting commands
113
+ */
73
114
  async bulkOverwriteGlobalCommands(applicationId, data) {
74
115
  return this.rest.put(import_v10.Routes.applicationCommands(applicationId), {
75
116
  body: data
76
117
  });
77
118
  }
119
+ /**
120
+ * Fetches all commands for a guild
121
+ *
122
+ * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands}
123
+ * @param applicationId - The application id to fetch commands for
124
+ * @param guildId - The guild id to fetch commands for
125
+ * @param data - The data to use when fetching commands
126
+ */
78
127
  async getGuildCommands(applicationId, guildId, data = {}) {
79
128
  return this.rest.get(import_v10.Routes.applicationGuildCommands(applicationId, guildId), {
80
129
  query: (0, import_rest.makeURLSearchParams)(data)
81
130
  });
82
131
  }
132
+ /**
133
+ * Creates a new command for a guild
134
+ *
135
+ * @see {@link https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command}
136
+ * @param applicationId - The application id to create the command for
137
+ * @param guildId - The guild id to create the command for
138
+ * @param data - The data to use when creating the command
139
+ */
83
140
  async createGuildCommand(applicationId, guildId, data) {
84
141
  return this.rest.post(import_v10.Routes.applicationGuildCommands(applicationId, guildId), {
85
142
  body: data
86
143
  });
87
144
  }
145
+ /**
146
+ * Fetches a guild command
147
+ *
148
+ * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command}
149
+ * @param applicationId - The application id to fetch the command from
150
+ * @param guildId - The guild id to fetch the command from
151
+ * @param commandId - The command id to fetch
152
+ */
88
153
  async getGuildCommand(applicationId, guildId, commandId) {
89
- return this.rest.get(
90
- import_v10.Routes.applicationGuildCommand(applicationId, guildId, commandId)
91
- );
92
- }
154
+ return this.rest.get(import_v10.Routes.applicationGuildCommand(applicationId, guildId, commandId));
155
+ }
156
+ /**
157
+ * Edits a guild command
158
+ *
159
+ * @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command}
160
+ * @param applicationId - The application id of the command
161
+ * @param guildId - The guild id of the command
162
+ * @param commandId - The command id to edit
163
+ * @param data - The data to use when editing the command
164
+ */
93
165
  async editGuildCommand(applicationId, guildId, commandId, data) {
94
166
  return this.rest.patch(import_v10.Routes.applicationGuildCommand(applicationId, guildId, commandId), {
95
167
  body: data
96
168
  });
97
169
  }
170
+ /**
171
+ * Deletes a guild command
172
+ *
173
+ * @see {@link https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command}
174
+ * @param applicationId - The application id of the command
175
+ * @param guildId - The guild id of the command
176
+ * @param commandId - The id of the command to delete
177
+ */
98
178
  async deleteGuildCommand(applicationId, guildId, commandId) {
99
179
  await this.rest.delete(import_v10.Routes.applicationGuildCommand(applicationId, guildId, commandId));
100
180
  }
181
+ /**
182
+ * Bulk overwrites guild commands
183
+ *
184
+ * @see {@link https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands}
185
+ * @param applicationId - The application id to overwrite commands for
186
+ * @param guildId - The guild id to overwrite commands for
187
+ * @param data - The data to use when overwriting commands
188
+ */
101
189
  async bulkOverwriteGuildCommands(applicationId, guildId, data) {
102
190
  return this.rest.put(import_v10.Routes.applicationGuildCommands(applicationId, guildId), {
103
191
  body: data
104
192
  });
105
193
  }
194
+ /**
195
+ * Fetches the permissions for a guild command
196
+ *
197
+ * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions}
198
+ * @param applicationId - The application id to get the permissions for
199
+ * @param guildId - The guild id of the command
200
+ * @param commandId - The command id to get the permissions for
201
+ */
106
202
  async getGuildCommandPermissions(applicationId, guildId, commandId) {
107
- return this.rest.get(
108
- import_v10.Routes.applicationCommandPermissions(applicationId, guildId, commandId)
109
- );
110
- }
203
+ return this.rest.get(import_v10.Routes.applicationCommandPermissions(applicationId, guildId, commandId));
204
+ }
205
+ /**
206
+ * Fetches all permissions for all commands in a guild
207
+ *
208
+ * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions}
209
+ * @param applicationId - The application id to get the permissions for
210
+ * @param guildId - The guild id to get the permissions for
211
+ */
111
212
  async getGuildCommandsPermissions(applicationId, guildId) {
112
- return this.rest.get(
113
- import_v10.Routes.guildApplicationCommandsPermissions(applicationId, guildId)
114
- );
115
- }
213
+ return this.rest.get(import_v10.Routes.guildApplicationCommandsPermissions(applicationId, guildId));
214
+ }
215
+ /**
216
+ * Edits the permissions for a guild command
217
+ *
218
+ * @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions}
219
+ * @param userToken - The token of the user to edit permissions on behalf of
220
+ * @param applicationId - The application id to edit the permissions for
221
+ * @param guildId - The guild id to edit the permissions for
222
+ * @param commandId - The id of the command to edit the permissions for
223
+ * @param data - The data to use when editing the permissions
224
+ */
116
225
  async editGuildCommandPermissions(userToken, applicationId, guildId, commandId, data) {
117
226
  return this.rest.put(import_v10.Routes.applicationCommandPermissions(applicationId, guildId, commandId), {
118
- headers: { Authorization: `Bearer ${userToken.replace("Bearer ", "")}` },
227
+ headers: {
228
+ Authorization: `Bearer ${userToken.replace("Bearer ", "")}`
229
+ },
119
230
  auth: false,
120
231
  body: data
121
232
  });
@@ -130,102 +241,304 @@ var ChannelsAPI = class {
130
241
  constructor(rest) {
131
242
  this.rest = rest;
132
243
  }
244
+ /**
245
+ * Sends a message in a channel
246
+ *
247
+ * @see {@link https://discord.com/developers/docs/resources/channel#create-message}
248
+ * @param channelId - The id of the channel to send the message in
249
+ * @param data - The data to use when sending the message
250
+ */
133
251
  async createMessage(channelId, { files, ...body }) {
134
252
  return this.rest.post(import_v102.Routes.channelMessages(channelId), {
135
253
  files,
136
254
  body
137
255
  });
138
256
  }
257
+ /**
258
+ * Edits a message
259
+ *
260
+ * @see {@link https://discord.com/developers/docs/resources/channel#edit-message}
261
+ * @param channelId - The id of the channel the message is in
262
+ * @param messageId - The id of the message to edit
263
+ * @param data - The data to use when editing the message
264
+ */
139
265
  async editMessage(channelId, messageId, { files, ...body }) {
140
266
  return this.rest.patch(import_v102.Routes.channelMessage(channelId, messageId), {
141
267
  files,
142
268
  body
143
269
  });
144
270
  }
271
+ /**
272
+ * Fetches the reactions for a message
273
+ *
274
+ * @see {@link https://discord.com/developers/docs/resources/channel#get-reactions}
275
+ * @param channelId - The id of the channel the message is in
276
+ * @param messageId - The id of the message to get the reactions for
277
+ * @param emoji - The emoji to get the reactions for
278
+ * @param options - The options to use when fetching the reactions
279
+ */
145
280
  async getMessageReactions(channelId, messageId, emoji, options = {}) {
146
281
  return this.rest.get(import_v102.Routes.channelMessageReaction(channelId, messageId, encodeURIComponent(emoji)), {
147
282
  query: (0, import_rest2.makeURLSearchParams)(options)
148
283
  });
149
284
  }
285
+ /**
286
+ * Deletes a reaction for the current user
287
+ *
288
+ * @see {@link https://discord.com/developers/docs/resources/channel#delete-own-reaction}
289
+ * @param channelId - The id of the channel the message is in
290
+ * @param messageId - The id of the message to delete the reaction for
291
+ * @param emoji - The emoji to delete the reaction for
292
+ */
150
293
  async deleteOwnMessageReaction(channelId, messageId, emoji) {
151
294
  await this.rest.delete(import_v102.Routes.channelMessageOwnReaction(channelId, messageId, encodeURIComponent(emoji)));
152
295
  }
296
+ /**
297
+ * Deletes a reaction for a user
298
+ *
299
+ * @see {@link https://discord.com/developers/docs/resources/channel#delete-user-reaction}
300
+ * @param channelId - The id of the channel the message is in
301
+ * @param messageId - The id of the message to delete the reaction for
302
+ * @param emoji - The emoji to delete the reaction for
303
+ * @param userId - The id of the user to delete the reaction for
304
+ */
153
305
  async deleteUserMessageReaction(channelId, messageId, emoji, userId) {
154
306
  await this.rest.delete(import_v102.Routes.channelMessageUserReaction(channelId, messageId, encodeURIComponent(emoji), userId));
155
307
  }
308
+ /**
309
+ * Deletes all reactions for a message
310
+ *
311
+ * @see {@link https://discord.com/developers/docs/resources/channel#delete-all-reactions}
312
+ * @param channelId - The id of the channel the message is in
313
+ * @param messageId - The id of the message to delete the reactions for
314
+ */
156
315
  async deleteAllMessageReactions(channelId, messageId) {
157
316
  await this.rest.delete(import_v102.Routes.channelMessageAllReactions(channelId, messageId));
158
317
  }
318
+ /**
319
+ * Deletes all reactions of an emoji for a message
320
+ *
321
+ * @see {@link https://discord.com/developers/docs/resources/channel#delete-all-reactions-for-emoji}
322
+ * @param channelId - The id of the channel the message is in
323
+ * @param messageId - The id of the message to delete the reactions for
324
+ * @param emoji - The emoji to delete the reactions for
325
+ */
159
326
  async deleteAllMessageReactionsForEmoji(channelId, messageId, emoji) {
160
327
  await this.rest.delete(import_v102.Routes.channelMessageReaction(channelId, messageId, encodeURIComponent(emoji)));
161
328
  }
329
+ /**
330
+ * Adds a reaction to a message
331
+ *
332
+ * @see {@link https://discord.com/developers/docs/resources/channel#create-reaction}
333
+ * @param channelId - The id of the channel the message is in
334
+ * @param messageId - The id of the message to add the reaction to
335
+ * @param emoji - The emoji to add the reaction with
336
+ */
162
337
  async addMessageReaction(channelId, messageId, emoji) {
163
338
  await this.rest.put(import_v102.Routes.channelMessageOwnReaction(channelId, messageId, encodeURIComponent(emoji)));
164
339
  }
340
+ /**
341
+ * Fetches a channel
342
+ *
343
+ * @see {@link https://discord.com/developers/docs/resources/channel#get-channel}
344
+ * @param channelId - The id of the channel
345
+ */
165
346
  async get(channelId) {
166
347
  return this.rest.get(import_v102.Routes.channel(channelId));
167
348
  }
349
+ /**
350
+ * Edits a channel
351
+ *
352
+ * @see {@link https://discord.com/developers/docs/resources/channel#modify-channel}
353
+ * @param channelId - The id of the channel to edit
354
+ * @param data - The new channel data
355
+ */
168
356
  async edit(channelId, data) {
169
- return this.rest.patch(import_v102.Routes.channel(channelId), { body: data });
357
+ return this.rest.patch(import_v102.Routes.channel(channelId), {
358
+ body: data
359
+ });
170
360
  }
361
+ /**
362
+ * Deletes a channel
363
+ *
364
+ * @see {@link https://discord.com/developers/docs/resources/channel#deleteclose-channel}
365
+ * @param channelId - The id of the channel to delete
366
+ */
171
367
  async delete(channelId) {
172
368
  return this.rest.delete(import_v102.Routes.channel(channelId));
173
369
  }
370
+ /**
371
+ * Fetches the messages of a channel
372
+ *
373
+ * @see {@link https://discord.com/developers/docs/resources/channel#get-channel-messages}
374
+ * @param channelId - The id of the channel to fetch messages from
375
+ * @param options - The options to use when fetching messages
376
+ */
174
377
  async getMessages(channelId, options = {}) {
175
378
  return this.rest.get(import_v102.Routes.channelMessages(channelId), {
176
379
  query: (0, import_rest2.makeURLSearchParams)(options)
177
380
  });
178
381
  }
382
+ /**
383
+ * Shows a typing indicator in a channel
384
+ *
385
+ * @see {@link https://discord.com/developers/docs/resources/channel#trigger-typing-indicator}
386
+ * @param channelId - The id of the channel to show the typing indicator in
387
+ */
179
388
  async showTyping(channelId) {
180
389
  await this.rest.post(import_v102.Routes.channelTyping(channelId));
181
390
  }
391
+ /**
392
+ * Fetches the pinned messages of a channel
393
+ *
394
+ * @see {@link https://discord.com/developers/docs/resources/channel#get-pinned-messages}
395
+ * @param channelId - The id of the channel to fetch pinned messages from
396
+ */
182
397
  async getPins(channelId) {
183
398
  return this.rest.get(import_v102.Routes.channelPins(channelId));
184
399
  }
400
+ /**
401
+ * Pins a message in a channel
402
+ *
403
+ * @see {@link https://discord.com/developers/docs/resources/channel#pin-message}
404
+ * @param channelId - The id of the channel to pin the message in
405
+ * @param messageId - The id of the message to pin
406
+ * @param reason - The reason for pinning the message
407
+ */
185
408
  async pinMessage(channelId, messageId, reason) {
186
- await this.rest.put(import_v102.Routes.channelPin(channelId, messageId), { reason });
409
+ await this.rest.put(import_v102.Routes.channelPin(channelId, messageId), {
410
+ reason
411
+ });
187
412
  }
413
+ /**
414
+ * Deletes a message
415
+ *
416
+ * @see {@link https://discord.com/developers/docs/resources/channel#delete-message}
417
+ * @param channelId - The id of the channel the message is in
418
+ * @param messageId - The id of the message to delete
419
+ * @param reason - The reason for deleting the message
420
+ */
188
421
  async deleteMessage(channelId, messageId, reason) {
189
- await this.rest.delete(import_v102.Routes.channelMessage(channelId, messageId), { reason });
422
+ await this.rest.delete(import_v102.Routes.channelMessage(channelId, messageId), {
423
+ reason
424
+ });
190
425
  }
426
+ /**
427
+ * Bulk deletes messages
428
+ *
429
+ * @see {@link https://discord.com/developers/docs/resources/channel#bulk-delete-messages}
430
+ * @param channelId - The id of the channel the messages are in
431
+ * @param messageIds - The ids of the messages to delete
432
+ */
191
433
  async bulkDeleteMessages(channelId, messageIds, reason) {
192
- await this.rest.post(import_v102.Routes.channelBulkDelete(channelId), { reason, body: { messages: messageIds } });
434
+ await this.rest.post(import_v102.Routes.channelBulkDelete(channelId), {
435
+ reason,
436
+ body: {
437
+ messages: messageIds
438
+ }
439
+ });
193
440
  }
441
+ /**
442
+ * Fetches a message
443
+ *
444
+ * @see {@link https://discord.com/developers/docs/resources/channel#get-channel-message}
445
+ * @param channelId - The id of the channel the message is in
446
+ * @param messageId - The id of the message to fetch
447
+ */
194
448
  async getMessage(channelId, messageId) {
195
449
  return this.rest.get(import_v102.Routes.channelMessage(channelId, messageId));
196
450
  }
451
+ /**
452
+ * Crossposts a message
453
+ *
454
+ * @see {@link https://discord.com/developers/docs/resources/channel#crosspost-message}
455
+ * @param channelId - The id of the channel the message is in
456
+ * @param messageId - The id of the message to crosspost
457
+ */
197
458
  async crosspostMessage(channelId, messageId) {
198
- return this.rest.post(
199
- import_v102.Routes.channelMessageCrosspost(channelId, messageId)
200
- );
201
- }
459
+ return this.rest.post(import_v102.Routes.channelMessageCrosspost(channelId, messageId));
460
+ }
461
+ /**
462
+ * Unpins a message in a channel
463
+ *
464
+ * @see {@link https://discord.com/developers/docs/resources/channel#unpin-message}
465
+ * @param channelId - The id of the channel to unpin the message in
466
+ * @param messageId - The id of the message to unpin
467
+ * @param reason - The reason for unpinning the message
468
+ */
202
469
  async unpinMessage(channelId, messageId, reason) {
203
- await this.rest.delete(import_v102.Routes.channelPin(channelId, messageId), { reason });
470
+ await this.rest.delete(import_v102.Routes.channelPin(channelId, messageId), {
471
+ reason
472
+ });
204
473
  }
474
+ /**
475
+ * Follows an announcement channel
476
+ *
477
+ * @see {@link https://discord.com/developers/docs/resources/channel#follow-announcement-channel}
478
+ * @param channelId - The id of the announcement channel to follow
479
+ * @param webhookChannelId - The id of the webhook channel to follow the announcements in
480
+ */
205
481
  async followAnnouncements(channelId, webhookChannelId) {
206
482
  return this.rest.post(import_v102.Routes.channelFollowers(channelId), {
207
- body: { webhook_channel_id: webhookChannelId }
483
+ body: {
484
+ webhook_channel_id: webhookChannelId
485
+ }
208
486
  });
209
487
  }
488
+ /**
489
+ * Creates a new invite for a channel
490
+ *
491
+ * @see {@link https://discord.com/developers/docs/resources/channel#create-channel-invite}
492
+ * @param channelId - The id of the channel to create an invite for
493
+ * @param data - The data to use when creating the invite
494
+ */
210
495
  async createInvite(channelId, data, reason) {
211
496
  return this.rest.post(import_v102.Routes.channelInvites(channelId), {
212
497
  reason,
213
498
  body: data
214
499
  });
215
500
  }
501
+ /**
502
+ * Fetches the invites of a channel
503
+ *
504
+ * @see {@link https://discord.com/developers/docs/resources/channel#get-channel-invites}
505
+ * @param channelId - The id of the channel to fetch invites from
506
+ */
216
507
  async getInvites(channelId) {
217
508
  return this.rest.get(import_v102.Routes.channelInvites(channelId));
218
509
  }
510
+ /**
511
+ * Fetches the archived threads of a channel
512
+ *
513
+ * @see {@link https://discord.com/developers/docs/resources/channel#list-public-archived-threads}
514
+ * @see {@link https://discord.com/developers/docs/resources/channel#list-private-archived-threads}
515
+ * @param channelId - The id of the channel to fetch archived threads from
516
+ * @param archivedStatus - The archived status of the threads to fetch
517
+ * @param options - The options to use when fetching archived threads
518
+ */
219
519
  async getArchivedThreads(channelId, archivedStatus, options = {}) {
220
520
  return this.rest.get(import_v102.Routes.channelThreads(channelId, archivedStatus), {
221
521
  query: (0, import_rest2.makeURLSearchParams)(options)
222
522
  });
223
523
  }
524
+ /**
525
+ * Fetches the private joined archived threads of a channel
526
+ *
527
+ * @see {@link https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads}
528
+ * @param channelId - The id of the channel to fetch joined archived threads from
529
+ * @param options - The options to use when fetching joined archived threads
530
+ */
224
531
  async getJoinedPrivateArchivedThreads(channelId, options = {}) {
225
532
  return this.rest.get(import_v102.Routes.channelJoinedArchivedThreads(channelId), {
226
533
  query: (0, import_rest2.makeURLSearchParams)(options)
227
534
  });
228
535
  }
536
+ /**
537
+ * Fetches the webhooks of a channel
538
+ *
539
+ * @see {@link https://discord.com/developers/docs/resources/webhook#get-channel-webhooks}
540
+ * @param id - The id of the channel
541
+ */
229
542
  async getWebhooks(id) {
230
543
  return this.rest.get(import_v102.Routes.channelWebhooks(id));
231
544
  }
@@ -239,275 +552,813 @@ var GuildsAPI = class {
239
552
  constructor(rest) {
240
553
  this.rest = rest;
241
554
  }
555
+ /**
556
+ * Fetches a guild
557
+ *
558
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild}
559
+ * @param guildId - The id of the guild
560
+ */
242
561
  async get(guildId) {
243
562
  return this.rest.get(import_v103.Routes.guild(guildId));
244
563
  }
564
+ /**
565
+ * Fetches a guild preview
566
+ *
567
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-preview}
568
+ * @param guildId - The id of the guild to fetch the preview from
569
+ */
245
570
  async getPreview(guildId) {
246
571
  return this.rest.get(import_v103.Routes.guildPreview(guildId));
247
572
  }
573
+ /**
574
+ * Creates a guild
575
+ *
576
+ * @see {@link https://discord.com/developers/docs/resources/guild#create-guild}
577
+ * @param data - The guild to create
578
+ */
248
579
  async create(data) {
249
- return this.rest.post(import_v103.Routes.guilds(), { body: data });
580
+ return this.rest.post(import_v103.Routes.guilds(), {
581
+ body: data
582
+ });
250
583
  }
584
+ /**
585
+ * Edits a guild
586
+ *
587
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild}
588
+ * @param guildId - The id of the guild to edit
589
+ * @param data - The new guild data
590
+ * @param reason - The reason for editing this guild
591
+ */
251
592
  async edit(guildId, data, reason) {
252
- return this.rest.patch(import_v103.Routes.guild(guildId), { reason, body: data });
593
+ return this.rest.patch(import_v103.Routes.guild(guildId), {
594
+ reason,
595
+ body: data
596
+ });
253
597
  }
598
+ /**
599
+ * Deletes a guild
600
+ *
601
+ * @see {@link https://discord.com/developers/docs/resources/guild#delete-guild}
602
+ * @param guildId - The id of the guild to delete
603
+ * @param reason - The reason for deleting this guild
604
+ */
254
605
  async delete(guildId, reason) {
255
- await this.rest.delete(import_v103.Routes.guild(guildId), { reason });
606
+ await this.rest.delete(import_v103.Routes.guild(guildId), {
607
+ reason
608
+ });
256
609
  }
610
+ /**
611
+ * Fetches all the members of a guild
612
+ *
613
+ * @see {@link https://discord.com/developers/docs/resources/guild#list-guild-members}
614
+ * @param guildId - The id of the guild
615
+ * @param options - The options to use when fetching the guild members
616
+ */
257
617
  async getMembers(guildId, options = {}) {
258
618
  return this.rest.get(import_v103.Routes.guildMembers(guildId), {
259
619
  query: (0, import_rest3.makeURLSearchParams)(options)
260
620
  });
261
621
  }
622
+ /**
623
+ * Fetches a guild's channels
624
+ *
625
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-channels}
626
+ * @param guildId - The id of the guild to fetch the channels from
627
+ */
262
628
  async getChannels(guildId) {
263
629
  return this.rest.get(import_v103.Routes.guildChannels(guildId));
264
630
  }
631
+ /**
632
+ * Creates a guild channel
633
+ *
634
+ * @see {@link https://discord.com/developers/docs/resources/guild#create-guild-channel}
635
+ * @param guildId - The id of the guild to create the channel in
636
+ * @param data - The data to create the new channel
637
+ * @param reason - The reason for creating this channel
638
+ */
265
639
  async createChannel(guildId, data, reason) {
266
640
  return this.rest.post(import_v103.Routes.guildChannels(guildId), {
267
641
  reason,
268
642
  body: data
269
643
  });
270
644
  }
645
+ /**
646
+ * Edits a guild channel's positions
647
+ *
648
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions}
649
+ * @param guildId - The id of the guild to edit the channel positions from
650
+ * @param data - The data to edit the channel positions with
651
+ * @param reason - The reason for editing the channel positions
652
+ */
271
653
  async setChannelPositions(guildId, data, reason) {
272
- await this.rest.patch(import_v103.Routes.guildChannels(guildId), { reason, body: data });
654
+ await this.rest.patch(import_v103.Routes.guildChannels(guildId), {
655
+ reason,
656
+ body: data
657
+ });
273
658
  }
659
+ /**
660
+ * Fetches the active threads in a guild
661
+ *
662
+ * @see {@link https://discord.com/developers/docs/resources/guild#list-active-guild-threads}
663
+ * @param guildId - The id of the guild to fetch the active threads from
664
+ */
274
665
  async getActiveThreads(guildId) {
275
666
  return this.rest.get(import_v103.Routes.guildActiveThreads(guildId));
276
667
  }
668
+ /**
669
+ * Fetches a guild member ban
670
+ *
671
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-bans}
672
+ * @param guildId - The id of the guild to fetch the ban from
673
+ */
277
674
  async getMemberBans(guildId) {
278
675
  return this.rest.get(import_v103.Routes.guildBans(guildId));
279
676
  }
677
+ /**
678
+ * Bans a user from a guild
679
+ *
680
+ * @see {@link https://discord.com/developers/docs/resources/guild#create-guild-ban}
681
+ * @param guildId - The id of the guild to ban the member in
682
+ * @param userId - The id of the user to ban
683
+ * @param options - Options for banning the user
684
+ * @param reason - The reason for banning the user
685
+ */
280
686
  async banUser(guildId, userId, options = {}, reason) {
281
- await this.rest.put(import_v103.Routes.guildBan(guildId, userId), { reason, body: options });
687
+ await this.rest.put(import_v103.Routes.guildBan(guildId, userId), {
688
+ reason,
689
+ body: options
690
+ });
282
691
  }
692
+ /**
693
+ * Unbans a user from a guild
694
+ *
695
+ * @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-ban}
696
+ * @param guildId - The id of the guild to unban the member in
697
+ * @param userId - The id of the user to unban
698
+ * @param reason - The reason for unbanning the user
699
+ */
283
700
  async unbanUser(guildId, userId, reason) {
284
- await this.rest.delete(import_v103.Routes.guildBan(guildId, userId), { reason });
701
+ await this.rest.delete(import_v103.Routes.guildBan(guildId, userId), {
702
+ reason
703
+ });
285
704
  }
705
+ /**
706
+ * Gets all the roles in a guild
707
+ *
708
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-roles}
709
+ * @param guildId - The id of the guild to fetch the roles from
710
+ */
286
711
  async getRoles(guildId) {
287
712
  return this.rest.get(import_v103.Routes.guildRoles(guildId));
288
713
  }
714
+ /**
715
+ * Creates a guild role
716
+ *
717
+ * @see {@link https://discord.com/developers/docs/resources/guild#create-guild-role}
718
+ * @param guildId - The id of the guild to create the role in
719
+ * @param data - The data to create the role with
720
+ * @param reason - The reason for creating the role
721
+ */
289
722
  async createRole(guildId, data, reason) {
290
- return this.rest.post(import_v103.Routes.guildRoles(guildId), { reason, body: data });
723
+ return this.rest.post(import_v103.Routes.guildRoles(guildId), {
724
+ reason,
725
+ body: data
726
+ });
291
727
  }
728
+ /**
729
+ * Sets role positions in a guild
730
+ *
731
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-role-positions}
732
+ * @param guildId - The id of the guild to set role positions for
733
+ * @param data - The data for setting a role position
734
+ * @param reason - The reason for setting the role position
735
+ */
292
736
  async setRolePositions(guildId, data, reason) {
293
737
  return this.rest.patch(import_v103.Routes.guildRoles(guildId), {
294
738
  reason,
295
739
  body: data
296
740
  });
297
741
  }
742
+ /**
743
+ * Edits a guild role
744
+ *
745
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-role}
746
+ * @param guildId - The id of the guild to edit the role in
747
+ * @param roleId - The id of the role to edit
748
+ * @param data - data for editing the role
749
+ * @param reason - The reason for editing the role
750
+ */
298
751
  async editRole(guildId, roleId, data, reason) {
299
752
  return this.rest.patch(import_v103.Routes.guildRole(guildId, roleId), {
300
753
  reason,
301
754
  body: data
302
755
  });
303
756
  }
757
+ /**
758
+ * Deletes a guild role
759
+ *
760
+ * @see {@link https://discord.com/developers/docs/resources/guild#delete-guild-role}
761
+ * @param guildId - The id of the guild to delete the role in
762
+ * @param roleId - The id of the role to delete
763
+ * @param reason - The reason for deleting the role
764
+ */
304
765
  async deleteRole(guildId, roleId, reason) {
305
- await this.rest.delete(import_v103.Routes.guildRole(guildId, roleId), { reason });
766
+ await this.rest.delete(import_v103.Routes.guildRole(guildId, roleId), {
767
+ reason
768
+ });
306
769
  }
770
+ /**
771
+ * Edits the multi-factor-authentication (MFA) level of a guild
772
+ *
773
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-mfa-level}
774
+ * @param guildId - The id of the guild to edit the MFA level for
775
+ * @param level - The new MFA level
776
+ * @param reason - The reason for editing the MFA level
777
+ */
307
778
  async editMFALevel(guildId, level, reason) {
308
779
  return this.rest.post(import_v103.Routes.guildMFA(guildId), {
309
780
  reason,
310
- body: { mfa_level: level }
781
+ body: {
782
+ mfa_level: level
783
+ }
311
784
  });
312
785
  }
786
+ /**
787
+ * Fetch the number of members that can be pruned from a guild
788
+ *
789
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-prune-count}
790
+ * @param guildId - The id of the guild to fetch the number of pruned members from
791
+ * @param options - The options for fetching the number of pruned members
792
+ */
313
793
  async getPruneCount(guildId, options = {}) {
314
794
  return this.rest.get(import_v103.Routes.guildPrune(guildId), {
315
795
  query: (0, import_rest3.makeURLSearchParams)(options)
316
796
  });
317
797
  }
798
+ /**
799
+ * Prunes members in a guild
800
+ *
801
+ * @see {@link https://discord.com/developers/docs/resources/guild#begin-guild-prune}
802
+ * @param guildId - The id of the guild to prune members in
803
+ * @param options - The options for pruning members
804
+ * @param reason - The reason for pruning members
805
+ */
318
806
  async beginPrune(guildId, options = {}, reason) {
319
807
  return this.rest.post(import_v103.Routes.guildPrune(guildId), {
320
808
  body: options,
321
809
  reason
322
810
  });
323
811
  }
812
+ /**
813
+ * Fetches voice regions for a guild
814
+ *
815
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-voice-regions}
816
+ * @param guildId - The id of the guild to fetch the voice regions from
817
+ */
324
818
  async getVoiceRegions(guildId) {
325
819
  return this.rest.get(import_v103.Routes.guildVoiceRegions(guildId));
326
820
  }
821
+ /**
822
+ * Fetches the invites for a guild
823
+ *
824
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-invites}
825
+ * @param guildId - The id of the guild to fetch the invites from
826
+ */
327
827
  async getInvites(guildId) {
328
828
  return this.rest.get(import_v103.Routes.guildInvites(guildId));
329
829
  }
830
+ /**
831
+ * Fetches the integrations for a guild
832
+ *
833
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-integrations}
834
+ * @param guildId - The id of the guild to fetch the integrations from
835
+ */
330
836
  async getIntegrations(guildId) {
331
837
  return this.rest.get(import_v103.Routes.guildIntegrations(guildId));
332
838
  }
839
+ /**
840
+ * Deletes an integration from a guild
841
+ *
842
+ * @see {@link https://discord.com/developers/docs/resources/guild#delete-guild-integration}
843
+ * @param guildId - The id of the guild to delete the integration from
844
+ * @param integrationId - The id of the integration to delete
845
+ * @param reason - The reason for deleting the integration
846
+ */
333
847
  async deleteIntegration(guildId, integrationId, reason) {
334
- await this.rest.delete(import_v103.Routes.guildIntegration(guildId, integrationId), { reason });
848
+ await this.rest.delete(import_v103.Routes.guildIntegration(guildId, integrationId), {
849
+ reason
850
+ });
335
851
  }
852
+ /**
853
+ * Fetches the widget settings for a guild
854
+ *
855
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-widget-settings}
856
+ * @param guildId - The id of the guild to fetch the widget settings from
857
+ */
336
858
  async getWidgetSettings(guildId) {
337
859
  return this.rest.get(import_v103.Routes.guildWidgetSettings(guildId));
338
860
  }
861
+ /**
862
+ * Edits the widget settings for a guild
863
+ *
864
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-widget}
865
+ * @param guildId - The id of the guild to edit the widget settings from
866
+ * @param data - The new widget settings data
867
+ * @param reason - The reason for editing the widget settings
868
+ */
339
869
  async editWidgetSettings(guildId, data, reason) {
340
870
  return this.rest.patch(import_v103.Routes.guildWidgetSettings(guildId), {
341
871
  reason,
342
872
  body: data
343
873
  });
344
874
  }
875
+ /**
876
+ * Fetches the widget for a guild
877
+ *
878
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-widget}
879
+ * @param guildId - The id of the guild to fetch the widget from
880
+ */
345
881
  async getWidget(guildId) {
346
882
  return this.rest.get(import_v103.Routes.guildWidgetJSON(guildId));
347
883
  }
884
+ /**
885
+ * Fetches the vanity url for a guild
886
+ *
887
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-vanity-url}
888
+ * @param guildId - The id of the guild to fetch the vanity url from
889
+ */
348
890
  async getVanityURL(guildId) {
349
891
  return this.rest.get(import_v103.Routes.guildVanityUrl(guildId));
350
892
  }
893
+ /**
894
+ * Fetches the widget image for a guild
895
+ *
896
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-widget-image}
897
+ * @param guildId - The id of the guild to fetch the widget image from
898
+ * @param style - The style of the widget image
899
+ */
351
900
  async getWidgetImage(guildId, style) {
352
901
  return this.rest.get(import_v103.Routes.guildWidgetImage(guildId), {
353
- query: (0, import_rest3.makeURLSearchParams)({ style })
902
+ query: (0, import_rest3.makeURLSearchParams)({
903
+ style
904
+ })
354
905
  });
355
906
  }
907
+ /**
908
+ * Fetches the welcome screen for a guild
909
+ *
910
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen}
911
+ * @param guildId - The id of the guild to fetch the welcome screen from
912
+ */
356
913
  async getWelcomeScreen(guildId) {
357
914
  return this.rest.get(import_v103.Routes.guildWelcomeScreen(guildId));
358
915
  }
916
+ /**
917
+ * Edits the welcome screen for a guild
918
+ *
919
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen}
920
+ * @param guildId - The id of the guild to edit the welcome screen for
921
+ * @param data - The new welcome screen data
922
+ * @param reason - The reason for editing the welcome screen
923
+ */
359
924
  async editWelcomeScreen(guildId, data, reason) {
360
925
  return this.rest.patch(import_v103.Routes.guildWelcomeScreen(guildId), {
361
926
  reason,
362
927
  body: data
363
928
  });
364
929
  }
930
+ /**
931
+ * Edits a user's voice state in a guild
932
+ *
933
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-user-voice-state}
934
+ * @param guildId - The id of the guild to edit the current user's voice state in
935
+ * @param userId - The id of the user to edit the voice state for
936
+ * @param data - The data for editing the voice state
937
+ * @param reason - The reason for editing the voice state
938
+ */
365
939
  async editUserVoiceState(guildId, userId, data, reason) {
366
- await this.rest.patch(import_v103.Routes.guildVoiceState(guildId, userId), { reason, body: data });
940
+ await this.rest.patch(import_v103.Routes.guildVoiceState(guildId, userId), {
941
+ reason,
942
+ body: data
943
+ });
367
944
  }
945
+ /**
946
+ * Fetches all emojis for a guild
947
+ *
948
+ * @see {@link https://discord.com/developers/docs/resources/emoji#list-guild-emojis}
949
+ * @param guildId - The id of the guild to fetch the emojis from
950
+ */
368
951
  async getEmojis(guildId) {
369
952
  return this.rest.get(import_v103.Routes.guildEmojis(guildId));
370
953
  }
954
+ /**
955
+ * Fetches an emoji for a guild
956
+ *
957
+ * @see {@link https://discord.com/developers/docs/resources/emoji#get-guild-emoji}
958
+ * @param guildId - The id of the guild to fetch the emoji from
959
+ * @param emojiId - The id of the emoji to fetch
960
+ */
371
961
  async getEmoji(guildId, emojiId) {
372
962
  return this.rest.get(import_v103.Routes.guildEmoji(guildId, emojiId));
373
963
  }
964
+ /**
965
+ * Creates a new emoji for a guild
966
+ *
967
+ * @see {@link https://discord.com/developers/docs/resources/emoji#create-guild-emoji}
968
+ * @param guildId - The id of the guild to create the emoji from
969
+ * @param data - The data for creating the emoji
970
+ * @param reason - The reason for creating the emoji
971
+ */
374
972
  async createEmoji(guildId, data, reason) {
375
973
  return this.rest.post(import_v103.Routes.guildEmojis(guildId), {
376
974
  reason,
377
975
  body: data
378
976
  });
379
977
  }
978
+ /**
979
+ * Edits an emoji for a guild
980
+ *
981
+ * @see {@link https://discord.com/developers/docs/resources/emoji#modify-guild-emoji}
982
+ * @param guildId - The id of the guild to edit the emoji from
983
+ * @param emojiId - The id of the emoji to edit
984
+ * @param data - The data for editing the emoji
985
+ * @param reason - The reason for editing the emoji
986
+ */
380
987
  async editEmoji(guildId, emojiId, data, reason) {
381
988
  return this.rest.patch(import_v103.Routes.guildEmoji(guildId, emojiId), {
382
989
  reason,
383
990
  body: data
384
991
  });
385
992
  }
993
+ /**
994
+ * Deletes an emoji for a guild
995
+ *
996
+ * @see {@link https://discord.com/developers/docs/resources/emoji#delete-guild-emoji}
997
+ * @param guildId - The id of the guild to delete the emoji from
998
+ * @param emojiId - The id of the emoji to delete
999
+ * @param reason - The reason for deleting the emoji
1000
+ */
386
1001
  async deleteEmoji(guildId, emojiId, reason) {
387
- await this.rest.delete(import_v103.Routes.guildEmoji(guildId, emojiId), { reason });
1002
+ await this.rest.delete(import_v103.Routes.guildEmoji(guildId, emojiId), {
1003
+ reason
1004
+ });
388
1005
  }
1006
+ /**
1007
+ * Fetches all scheduled events for a guild
1008
+ *
1009
+ * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild}
1010
+ * @param guildId - The id of the guild to fetch the scheduled events from
1011
+ * @param options - The options for fetching the scheduled events
1012
+ */
389
1013
  async getScheduledEvents(guildId, options = {}) {
390
1014
  return this.rest.get(import_v103.Routes.guildScheduledEvents(guildId), {
391
1015
  query: (0, import_rest3.makeURLSearchParams)(options)
392
1016
  });
393
1017
  }
1018
+ /**
1019
+ * Creates a new scheduled event for a guild
1020
+ *
1021
+ * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event}
1022
+ * @param guildId - The id of the guild to create the scheduled event from
1023
+ * @param data - The data to create the event with
1024
+ * @param reason - The reason for creating the scheduled event
1025
+ */
394
1026
  async createScheduledEvent(guildId, data, reason) {
395
1027
  return this.rest.post(import_v103.Routes.guildScheduledEvents(guildId), {
396
1028
  reason,
397
1029
  body: data
398
1030
  });
399
1031
  }
1032
+ /**
1033
+ * Fetches a scheduled event for a guild
1034
+ *
1035
+ * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event}
1036
+ * @param guildId - The id of the guild to fetch the scheduled event from
1037
+ * @param eventId - The id of the scheduled event to fetch
1038
+ * @param options - The options for fetching the scheduled event
1039
+ */
400
1040
  async getScheduledEvent(guildId, eventId, options = {}) {
401
1041
  return this.rest.get(import_v103.Routes.guildScheduledEvent(guildId, eventId), {
402
1042
  query: (0, import_rest3.makeURLSearchParams)(options)
403
1043
  });
404
1044
  }
1045
+ /**
1046
+ * Edits a scheduled event for a guild
1047
+ *
1048
+ * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event}
1049
+ * @param guildId - The id of the guild to edit the scheduled event from
1050
+ * @param eventId - The id of the scheduled event to edit
1051
+ * @param data - The new event data
1052
+ * @param reason - The reason for editing the scheduled event
1053
+ */
405
1054
  async editScheduledEvent(guildId, eventId, data, reason) {
406
1055
  return this.rest.patch(import_v103.Routes.guildScheduledEvent(guildId, eventId), {
407
1056
  reason,
408
1057
  body: data
409
1058
  });
410
1059
  }
1060
+ /**
1061
+ * Deletes a scheduled event for a guild
1062
+ *
1063
+ * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event}
1064
+ * @param guildId - The id of the guild to delete the scheduled event from
1065
+ * @param eventId - The id of the scheduled event to delete
1066
+ * @param reason - The reason for deleting the scheduled event
1067
+ */
411
1068
  async deleteScheduledEvent(guildId, eventId, reason) {
412
- await this.rest.delete(import_v103.Routes.guildScheduledEvent(guildId, eventId), { reason });
1069
+ await this.rest.delete(import_v103.Routes.guildScheduledEvent(guildId, eventId), {
1070
+ reason
1071
+ });
413
1072
  }
1073
+ /**
1074
+ * Gets all users that are interested in a scheduled event
1075
+ *
1076
+ * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users}
1077
+ * @param guildId - The id of the guild to fetch the scheduled event users from
1078
+ * @param eventId - The id of the scheduled event to fetch the users for
1079
+ * @param options - The options for fetching the scheduled event users
1080
+ */
414
1081
  async getScheduledEventUsers(guildId, eventId, options = {}) {
415
1082
  return this.rest.get(import_v103.Routes.guildScheduledEventUsers(guildId, eventId), {
416
1083
  query: (0, import_rest3.makeURLSearchParams)(options)
417
1084
  });
418
1085
  }
1086
+ /**
1087
+ * Fetches all the templates for a guild
1088
+ *
1089
+ * @see {@link https://discord.com/developers/docs/resources/guild-template#get-guild-templates}
1090
+ * @param guildId - The id of the guild to fetch the templates from
1091
+ */
419
1092
  async getTemplates(guildId) {
420
1093
  return this.rest.get(import_v103.Routes.guildTemplates(guildId));
421
1094
  }
1095
+ /**
1096
+ * Syncs a template for a guild
1097
+ *
1098
+ * @see {@link https://discord.com/developers/docs/resources/guild-template#sync-guild-template}
1099
+ * @param guildId - The id of the guild to sync the template from
1100
+ * @param templateCode - The code of the template to sync
1101
+ */
422
1102
  async syncTemplate(guildId, templateCode) {
423
1103
  return this.rest.put(import_v103.Routes.guildTemplate(guildId, templateCode));
424
1104
  }
1105
+ /**
1106
+ * Edits a template for a guild
1107
+ *
1108
+ * @see {@link https://discord.com/developers/docs/resources/guild-template#modify-guild-template}
1109
+ * @param guildId - The id of the guild to edit the template from
1110
+ * @param templateCode - The code of the template to edit
1111
+ * @param data - The data for editing the template
1112
+ */
425
1113
  async editTemplate(guildId, templateCode, data) {
426
1114
  return this.rest.patch(import_v103.Routes.guildTemplate(guildId, templateCode), {
427
1115
  body: data
428
1116
  });
429
1117
  }
1118
+ /**
1119
+ * Deletes a template for a guild
1120
+ *
1121
+ * @see {@link https://discord.com/developers/docs/resources/guild-template#delete-guild-template}
1122
+ * @param guildId - The id of the guild to delete the template from
1123
+ * @param templateCode - The code of the template to delete
1124
+ */
430
1125
  async deleteTemplate(guildId, templateCode) {
431
1126
  await this.rest.delete(import_v103.Routes.guildTemplate(guildId, templateCode));
432
1127
  }
1128
+ /**
1129
+ * Fetches all the stickers for a guild
1130
+ *
1131
+ * @see {@link https://discord.com/developers/docs/resources/sticker#list-guild-stickers}
1132
+ * @param guildId - The id of the guild to fetch the stickers from
1133
+ */
433
1134
  async getStickers(guildId) {
434
1135
  return this.rest.get(import_v103.Routes.guildStickers(guildId));
435
1136
  }
1137
+ /**
1138
+ * Fetches a sticker for a guild
1139
+ *
1140
+ * @see {@link https://discord.com/developers/docs/resources/sticker#get-guild-sticker}
1141
+ * @param guildId - The id of the guild to fetch the sticker from
1142
+ * @param stickerId - The id of the sticker to fetch
1143
+ */
436
1144
  async getSticker(guildId, stickerId) {
437
1145
  return this.rest.get(import_v103.Routes.guildSticker(guildId, stickerId));
438
1146
  }
1147
+ /**
1148
+ * Creates a sticker for a guild
1149
+ *
1150
+ * @see {@link https://discord.com/developers/docs/resources/sticker#create-guild-sticker}
1151
+ * @param guildId - The id of the guild to create the sticker for
1152
+ * @param data - The data for creating the sticker
1153
+ * @param reason - The reason for creating the sticker
1154
+ */
439
1155
  async createSticker(guildId, { file, ...body }, reason) {
440
- const fileData = { ...file, key: "file" };
1156
+ const fileData = {
1157
+ ...file,
1158
+ key: "file"
1159
+ };
441
1160
  return this.rest.post(import_v103.Routes.guildStickers(guildId), {
442
1161
  appendToFormData: true,
443
1162
  body,
444
- files: [fileData],
1163
+ files: [
1164
+ fileData
1165
+ ],
445
1166
  reason
446
1167
  });
447
1168
  }
1169
+ /**
1170
+ * Edits a sticker for a guild
1171
+ *
1172
+ * @see {@link https://discord.com/developers/docs/resources/sticker#modify-guild-sticker}
1173
+ * @param guildId - The id of the guild to edit the sticker from
1174
+ * @param stickerId - The id of the sticker to edit
1175
+ * @param data - The data for editing the sticker
1176
+ * @param reason - The reason for editing the sticker
1177
+ */
448
1178
  async editSticker(guildId, stickerId, data, reason) {
449
1179
  return this.rest.patch(import_v103.Routes.guildSticker(guildId, stickerId), {
450
1180
  reason,
451
1181
  body: data
452
1182
  });
453
1183
  }
1184
+ /**
1185
+ * Deletes a sticker for a guild
1186
+ *
1187
+ * @see {@link https://discord.com/developers/docs/resources/sticker#delete-guild-sticker}
1188
+ * @param guildId - The id of the guild to delete the sticker from
1189
+ * @param stickerId - The id of the sticker to delete
1190
+ * @param reason - The reason for deleting the sticker
1191
+ */
454
1192
  async deleteSticker(guildId, stickerId, reason) {
455
- await this.rest.delete(import_v103.Routes.guildSticker(guildId, stickerId), { reason });
1193
+ await this.rest.delete(import_v103.Routes.guildSticker(guildId, stickerId), {
1194
+ reason
1195
+ });
456
1196
  }
1197
+ /**
1198
+ * Fetches the audit logs for a guild
1199
+ *
1200
+ * @see {@link https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log}
1201
+ * @param guildId - The id of the guild to fetch the audit logs from
1202
+ * @param options - The options for fetching the audit logs
1203
+ */
457
1204
  async getAuditLogs(guildId, options = {}) {
458
1205
  return this.rest.get(import_v103.Routes.guildAuditLog(guildId), {
459
1206
  query: (0, import_rest3.makeURLSearchParams)(options)
460
1207
  });
461
1208
  }
1209
+ /**
1210
+ * Fetches all auto moderation rules for a guild
1211
+ *
1212
+ * @see {@link https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild}
1213
+ * @param guildId - The id of the guild to fetch the auto moderation rules from
1214
+ */
462
1215
  async getAutoModerationRules(guildId) {
463
1216
  return this.rest.get(import_v103.Routes.guildAutoModerationRules(guildId));
464
1217
  }
1218
+ /**
1219
+ * Fetches an auto moderation rule for a guild
1220
+ *
1221
+ * @see {@link https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule}
1222
+ * @param guildId - The id of the guild to fetch the auto moderation rule from
1223
+ * @param ruleId - The id of the auto moderation rule to fetch
1224
+ */
465
1225
  async getAutoModerationRule(guildId, ruleId) {
466
- return this.rest.get(
467
- import_v103.Routes.guildAutoModerationRule(guildId, ruleId)
468
- );
469
- }
1226
+ return this.rest.get(import_v103.Routes.guildAutoModerationRule(guildId, ruleId));
1227
+ }
1228
+ /**
1229
+ * Creates a new auto moderation rule for a guild
1230
+ *
1231
+ * @see {@link https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule}
1232
+ * @param guildId - The id of the guild to create the auto moderation rule from
1233
+ * @param data - The data for creating the auto moderation rule
1234
+ */
470
1235
  async createAutoModerationRule(guildId, data, reason) {
471
1236
  return this.rest.post(import_v103.Routes.guildAutoModerationRules(guildId), {
472
1237
  reason,
473
1238
  body: data
474
1239
  });
475
1240
  }
1241
+ /**
1242
+ * Edits an auto moderation rule for a guild
1243
+ *
1244
+ * @see {@link https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule}
1245
+ * @param guildId - The id of the guild to edit the auto moderation rule from
1246
+ * @param ruleId - The id of the auto moderation rule to edit
1247
+ * @param data - The data for editing the auto moderation rule
1248
+ * @param reason - The reason for editing the auto moderation rule
1249
+ */
476
1250
  async editAutoModerationRule(guildId, ruleId, data, reason) {
477
1251
  return this.rest.patch(import_v103.Routes.guildAutoModerationRule(guildId, ruleId), {
478
1252
  reason,
479
1253
  body: data
480
1254
  });
481
1255
  }
1256
+ /**
1257
+ * Deletes an auto moderation rule for a guild
1258
+ *
1259
+ * @see {@link https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule}
1260
+ * @param guildId - The id of the guild to delete the auto moderation rule from
1261
+ * @param ruleId - The id of the auto moderation rule to delete
1262
+ * @param reason - The reason for deleting the auto moderation rule
1263
+ */
482
1264
  async deleteAutoModerationRule(guildId, ruleId, reason) {
483
- await this.rest.delete(import_v103.Routes.guildAutoModerationRule(guildId, ruleId), { reason });
1265
+ await this.rest.delete(import_v103.Routes.guildAutoModerationRule(guildId, ruleId), {
1266
+ reason
1267
+ });
484
1268
  }
1269
+ /**
1270
+ * Fetches a guild member
1271
+ *
1272
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-member}
1273
+ * @param guildId - The id of the guild
1274
+ * @param userId - The id of the user
1275
+ */
485
1276
  async getMember(guildId, userId) {
486
1277
  return this.rest.get(import_v103.Routes.guildMember(guildId, userId));
487
1278
  }
1279
+ /**
1280
+ * Searches for guild members
1281
+ *
1282
+ * @see {@link https://discord.com/developers/docs/resources/guild#search-guild-members}
1283
+ * @param guildId - The id of the guild to search in
1284
+ * @param query - The query to search for
1285
+ * @param limit - The maximum number of members to return
1286
+ */
488
1287
  async searchForMembers(guildId, options) {
489
1288
  return this.rest.get(import_v103.Routes.guildMembersSearch(guildId), {
490
1289
  query: (0, import_rest3.makeURLSearchParams)(options)
491
1290
  });
492
1291
  }
1292
+ /**
1293
+ * Edits a guild member
1294
+ *
1295
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-member}
1296
+ * @param guildId - The id of the guild
1297
+ * @param userId - The id of the user
1298
+ * @param data - The data to use when editing the guild member
1299
+ * @param reason - The reason for editing this guild member
1300
+ */
493
1301
  async editMember(guildId, userId, data = {}, reason) {
494
1302
  return this.rest.patch(import_v103.Routes.guildMember(guildId, userId), {
495
1303
  reason,
496
1304
  body: data
497
1305
  });
498
1306
  }
1307
+ /**
1308
+ * Adds a role to a guild member
1309
+ *
1310
+ * @see {@link https://discord.com/developers/docs/resources/guild#add-guild-member-role}
1311
+ * @param guildId - The id of the guild
1312
+ * @param userId - The id of the user
1313
+ * @param roleId - The id of the role
1314
+ * @param reason - The reason for adding this role to the guild member
1315
+ */
499
1316
  async addRoleToMember(guildId, userId, roleId, reason) {
500
- await this.rest.put(import_v103.Routes.guildMemberRole(guildId, userId, roleId), { reason });
1317
+ await this.rest.put(import_v103.Routes.guildMemberRole(guildId, userId, roleId), {
1318
+ reason
1319
+ });
501
1320
  }
1321
+ /**
1322
+ * Removes a role from a guild member
1323
+ *
1324
+ * @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-member-role}
1325
+ * @param guildId - The id of the guild
1326
+ * @param userId - The id of the user
1327
+ * @param roleId - The id of the role
1328
+ * @param reason - The reason for removing this role from the guild member
1329
+ */
502
1330
  async removeRoleFromMember(guildId, userId, roleId, reason) {
503
- await this.rest.delete(import_v103.Routes.guildMemberRole(guildId, userId, roleId), { reason });
1331
+ await this.rest.delete(import_v103.Routes.guildMemberRole(guildId, userId, roleId), {
1332
+ reason
1333
+ });
504
1334
  }
1335
+ /**
1336
+ * Fetches a guild template
1337
+ *
1338
+ * @see {@link https://discord.com/developers/docs/resources/guild-template#get-guild-template}
1339
+ * @param templateCode - The code of the template
1340
+ */
505
1341
  async getTemplate(templateCode) {
506
1342
  return this.rest.get(import_v103.Routes.template(templateCode));
507
1343
  }
1344
+ /**
1345
+ * Creates a new template
1346
+ *
1347
+ * @see {@link https://discord.com/developers/docs/resources/guild-template#create-guild-template}
1348
+ * @param templateCode - The code of the template
1349
+ * @param data - The data to use when creating the template
1350
+ */
508
1351
  async createTemplate(templateCode, data) {
509
- return this.rest.post(import_v103.Routes.template(templateCode), { body: data });
1352
+ return this.rest.post(import_v103.Routes.template(templateCode), {
1353
+ body: data
1354
+ });
510
1355
  }
1356
+ /**
1357
+ * Fetches webhooks for a guild
1358
+ *
1359
+ * @see {@link https://discord.com/developers/docs/resources/webhook#get-guild-webhooks}
1360
+ * @param id - The id of the guild
1361
+ */
511
1362
  async getWebhooks(id) {
512
1363
  return this.rest.get(import_v103.Routes.guildWebhooks(id));
513
1364
  }
@@ -521,6 +1372,14 @@ var InteractionsAPI = class {
521
1372
  this.rest = rest;
522
1373
  this.webhooks = webhooks;
523
1374
  }
1375
+ /**
1376
+ * Replies to an interaction
1377
+ *
1378
+ * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1379
+ * @param interactionId - The id of the interaction
1380
+ * @param interactionToken - The token of the interaction
1381
+ * @param data - The data to use when replying
1382
+ */
524
1383
  async reply(interactionId, interactionToken, { files, ...data }) {
525
1384
  await this.rest.post(import_v104.Routes.interactionCallback(interactionId, interactionToken), {
526
1385
  files,
@@ -530,6 +1389,13 @@ var InteractionsAPI = class {
530
1389
  }
531
1390
  });
532
1391
  }
1392
+ /**
1393
+ * Defers the reply to an interaction
1394
+ *
1395
+ * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1396
+ * @param interactionId - The id of the interaction
1397
+ * @param interactionToken - The token of the interaction
1398
+ */
533
1399
  async defer(interactionId, interactionToken) {
534
1400
  await this.rest.post(import_v104.Routes.interactionCallback(interactionId, interactionToken), {
535
1401
  body: {
@@ -537,6 +1403,13 @@ var InteractionsAPI = class {
537
1403
  }
538
1404
  });
539
1405
  }
1406
+ /**
1407
+ * Defers an update from a message component interaction
1408
+ *
1409
+ * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1410
+ * @param interactionId - The id of the interaction
1411
+ * @param interactionToken - The token of the interaction
1412
+ */
540
1413
  async deferMessageUpdate(interactionId, interactionToken) {
541
1414
  await this.rest.post(import_v104.Routes.interactionCallback(interactionId, interactionToken), {
542
1415
  body: {
@@ -544,22 +1417,60 @@ var InteractionsAPI = class {
544
1417
  }
545
1418
  });
546
1419
  }
1420
+ /**
1421
+ * Reply to a deferred interaction
1422
+ *
1423
+ * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message}
1424
+ * @param applicationId - The application id of the interaction
1425
+ * @param interactionToken - The token of the interaction
1426
+ * @param data - The data to use when replying
1427
+ */
547
1428
  async followUp(applicationId, interactionToken, data) {
548
1429
  await this.webhooks.execute(applicationId, interactionToken, data);
549
1430
  }
1431
+ /**
1432
+ * Edits the initial reply to an interaction
1433
+ *
1434
+ * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#edit-original-interaction-response}
1435
+ * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#edit-followup-message}
1436
+ * @param applicationId - The application id of the interaction
1437
+ * @param interactionToken - The token of the interaction
1438
+ * @param data - The data to use when editing the reply
1439
+ * @param messageId - The id of the message to edit. If omitted, the original reply will be edited
1440
+ */
550
1441
  async editReply(applicationId, interactionToken, data, messageId) {
551
1442
  return this.webhooks.editMessage(applicationId, interactionToken, messageId ?? "@original", data);
552
1443
  }
1444
+ /**
1445
+ * Fetches the initial reply to an interaction
1446
+ *
1447
+ * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response}
1448
+ * @param applicationId - The application id of the interaction
1449
+ * @param interactionToken - The token of the interaction
1450
+ */
553
1451
  async getOriginalReply(applicationId, interactionToken) {
554
- return this.webhooks.getMessage(
555
- applicationId,
556
- interactionToken,
557
- "@original"
558
- );
559
- }
1452
+ return this.webhooks.getMessage(applicationId, interactionToken, "@original");
1453
+ }
1454
+ /**
1455
+ * Deletes the initial reply to an interaction
1456
+ *
1457
+ * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#delete-original-interaction-response}
1458
+ * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#delete-followup-message}
1459
+ * @param applicationId - The application id of the interaction
1460
+ * @param interactionToken - The token of the interaction
1461
+ * @param messageId - The id of the message to delete. If omitted, the original reply will be deleted
1462
+ */
560
1463
  async deleteReply(applicationId, interactionToken, messageId) {
561
1464
  await this.webhooks.deleteMessage(applicationId, interactionToken, messageId ?? "@original");
562
1465
  }
1466
+ /**
1467
+ * Updates the the message the component interaction was triggered on
1468
+ *
1469
+ * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1470
+ * @param interactionId - The id of the interaction
1471
+ * @param interactionToken - The token of the interaction
1472
+ * @param data - The data to use when updating the interaction
1473
+ */
563
1474
  async updateMessage(interactionId, interactionToken, { files, ...data }) {
564
1475
  await this.rest.post(import_v104.Routes.interactionCallback(interactionId, interactionToken), {
565
1476
  files,
@@ -569,6 +1480,14 @@ var InteractionsAPI = class {
569
1480
  }
570
1481
  });
571
1482
  }
1483
+ /**
1484
+ * Sends an autocomplete response to an interaction
1485
+ *
1486
+ * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1487
+ * @param interactionId - The id of the interaction
1488
+ * @param interactionToken - The token of the interaction
1489
+ * @param data - Data for the autocomplete response
1490
+ */
572
1491
  async createAutocompleteResponse(interactionId, interactionToken, data) {
573
1492
  await this.rest.post(import_v104.Routes.interactionCallback(interactionId, interactionToken), {
574
1493
  body: {
@@ -577,6 +1496,14 @@ var InteractionsAPI = class {
577
1496
  }
578
1497
  });
579
1498
  }
1499
+ /**
1500
+ * Sends a modal response to an interaction
1501
+ *
1502
+ * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1503
+ * @param interactionId - The id of the interaction
1504
+ * @param interactionToken - The token of the interaction
1505
+ * @param data - The modal to send
1506
+ */
580
1507
  async createModal(interactionId, interactionToken, data) {
581
1508
  await this.rest.post(import_v104.Routes.interactionCallback(interactionId, interactionToken), {
582
1509
  body: {
@@ -595,13 +1522,28 @@ var InvitesAPI = class {
595
1522
  constructor(rest) {
596
1523
  this.rest = rest;
597
1524
  }
1525
+ /**
1526
+ * Fetches an invite
1527
+ *
1528
+ * @see {@link https://discord.com/developers/docs/resources/invite#get-invite}
1529
+ * @param code - The invite code
1530
+ */
598
1531
  async get(code, options = {}) {
599
1532
  return this.rest.get(import_v105.Routes.invite(code), {
600
1533
  query: (0, import_rest4.makeURLSearchParams)(options)
601
1534
  });
602
1535
  }
1536
+ /**
1537
+ * Deletes an invite
1538
+ *
1539
+ * @see {@link https://discord.com/developers/docs/resources/invite#delete-invite}
1540
+ * @param code - The invite code
1541
+ * @param reason - The reason for deleting the invite
1542
+ */
603
1543
  async delete(code, reason) {
604
- await this.rest.delete(import_v105.Routes.invite(code), { reason });
1544
+ await this.rest.delete(import_v105.Routes.invite(code), {
1545
+ reason
1546
+ });
605
1547
  }
606
1548
  };
607
1549
  __name(InvitesAPI, "InvitesAPI");
@@ -614,11 +1556,23 @@ var OAuth2API = class {
614
1556
  constructor(rest) {
615
1557
  this.rest = rest;
616
1558
  }
1559
+ /**
1560
+ * Creates an OAuth2 authorization URL given the options
1561
+ *
1562
+ * @see {@link https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-authorization-url-example}
1563
+ * @param options - The options for creating the authorization URL
1564
+ */
617
1565
  generateAuthorizationURL(options) {
618
1566
  const url = new import_node_url.URL(`${import_v106.RouteBases.api}${import_v106.Routes.oauth2Authorization()}`);
619
1567
  url.search = (0, import_rest5.makeURLSearchParams)(options).toString();
620
1568
  return url.toString();
621
1569
  }
1570
+ /**
1571
+ * Performs an OAuth2 token exchange, giving you an access token
1572
+ *
1573
+ * @see {@link https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-access-token-exchange-example}
1574
+ * @param options - The options for the token exchange request
1575
+ */
622
1576
  async tokenExchange(options) {
623
1577
  return this.rest.post(import_v106.Routes.oauth2TokenExchange(), {
624
1578
  body: (0, import_rest5.makeURLSearchParams)(options),
@@ -628,6 +1582,12 @@ var OAuth2API = class {
628
1582
  }
629
1583
  });
630
1584
  }
1585
+ /**
1586
+ * Refreshes an OAuth2 access token, giving you a new one
1587
+ *
1588
+ * @see {@link https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-refresh-token-exchange-example}
1589
+ * @param options - The options for the refresh token request
1590
+ */
631
1591
  async refreshToken(options) {
632
1592
  return this.rest.post(import_v106.Routes.oauth2TokenExchange(), {
633
1593
  body: (0, import_rest5.makeURLSearchParams)(options),
@@ -637,6 +1597,14 @@ var OAuth2API = class {
637
1597
  }
638
1598
  });
639
1599
  }
1600
+ /**
1601
+ * Fetches the bearer token for the current application
1602
+ *
1603
+ * @remarks
1604
+ * This is primarily used for testing purposes
1605
+ * @see {@link https://discord.com/developers/docs/topics/oauth2#client-credentials-grant}
1606
+ * @param options - The options for the client credentials grant request
1607
+ */
640
1608
  async getToken(options) {
641
1609
  return this.rest.post(import_v106.Routes.oauth2TokenExchange(), {
642
1610
  body: (0, import_rest5.makeURLSearchParams)(options),
@@ -646,9 +1614,19 @@ var OAuth2API = class {
646
1614
  }
647
1615
  });
648
1616
  }
1617
+ /**
1618
+ * Fetches the current bot's application information
1619
+ *
1620
+ * @see {@link https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information}
1621
+ */
649
1622
  async getCurrentBotApplicationInformation() {
650
1623
  return this.rest.get(import_v106.Routes.oauth2CurrentApplication());
651
1624
  }
1625
+ /**
1626
+ * Fetches the current authorization information
1627
+ *
1628
+ * @see {@link https://discord.com/developers/docs/topics/oauth2#get-current-authorization-information}
1629
+ */
652
1630
  async getCurrentAuthorizationInformation() {
653
1631
  return this.rest.get(import_v106.Routes.oauth2CurrentAuthorization());
654
1632
  }
@@ -661,11 +1639,22 @@ var RoleConnectionsAPI = class {
661
1639
  constructor(rest) {
662
1640
  this.rest = rest;
663
1641
  }
1642
+ /**
1643
+ * Gets the role connection metadata records for the application
1644
+ *
1645
+ * @see {@link https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records}
1646
+ * @param applicationId - The id of the application to get role connection metadata records for
1647
+ */
664
1648
  async getMetadataRecords(applicationId) {
665
- return this.rest.get(
666
- import_v107.Routes.applicationRoleConnectionMetadata(applicationId)
667
- );
668
- }
1649
+ return this.rest.get(import_v107.Routes.applicationRoleConnectionMetadata(applicationId));
1650
+ }
1651
+ /**
1652
+ * Updates the role connection metadata records for the application
1653
+ *
1654
+ * @see {@link https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records}
1655
+ * @param applicationId - The id of the application to update role connection metadata records for
1656
+ * @param options - The new role connection metadata records
1657
+ */
669
1658
  async updateMetadataRecords(applicationId, options) {
670
1659
  return this.rest.put(import_v107.Routes.applicationRoleConnectionMetadata(applicationId), {
671
1660
  body: options
@@ -680,9 +1669,20 @@ var StickersAPI = class {
680
1669
  constructor(rest) {
681
1670
  this.rest = rest;
682
1671
  }
1672
+ /**
1673
+ * Fetches all of the nitro sticker packs
1674
+ *
1675
+ * @see {@link https://discord.com/developers/docs/resources/sticker#list-nitro-sticker-packs}
1676
+ */
683
1677
  async getNitroStickers() {
684
1678
  return this.rest.get(import_v108.Routes.nitroStickerPacks());
685
1679
  }
1680
+ /**
1681
+ * Fetches a sticker
1682
+ *
1683
+ * @see {@link https://discord.com/developers/docs/resources/sticker#get-sticker}
1684
+ * @param stickerId - The id of the sticker
1685
+ */
686
1686
  async get(stickerId) {
687
1687
  return this.rest.get(import_v108.Routes.sticker(stickerId));
688
1688
  }
@@ -695,35 +1695,100 @@ var ThreadsAPI = class {
695
1695
  constructor(rest) {
696
1696
  this.rest = rest;
697
1697
  }
1698
+ /**
1699
+ * Fetches a thread
1700
+ *
1701
+ * @see {@link https://discord.com/developers/docs/resources/channel#get-channel}
1702
+ * @param threadId - The id of the thread
1703
+ */
698
1704
  async get(threadId) {
699
1705
  return this.rest.get(import_v109.Routes.channel(threadId));
700
1706
  }
1707
+ /**
1708
+ * Creates a new thread
1709
+ *
1710
+ * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-from-message}
1711
+ * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-without-message}
1712
+ * @param channelId - The id of the channel to start the thread in
1713
+ * @param data - The data to use when starting the thread
1714
+ */
701
1715
  async create(channelId, { message_id, ...body }) {
702
- return this.rest.post(import_v109.Routes.threads(channelId, message_id), { body });
1716
+ return this.rest.post(import_v109.Routes.threads(channelId, message_id), {
1717
+ body
1718
+ });
703
1719
  }
1720
+ /**
1721
+ * Creates a new forum post
1722
+ *
1723
+ * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel}
1724
+ * @param channelId - The id of the forum channel to start the thread in
1725
+ * @param data - The data to use when starting the thread
1726
+ */
704
1727
  async createForumThread(channelId, { message, ...optionsBody }) {
705
1728
  const { files, ...messageBody } = message;
706
1729
  const body = {
707
1730
  ...optionsBody,
708
1731
  message: messageBody
709
1732
  };
710
- return this.rest.post(import_v109.Routes.threads(channelId), { files, body });
1733
+ return this.rest.post(import_v109.Routes.threads(channelId), {
1734
+ files,
1735
+ body
1736
+ });
711
1737
  }
1738
+ /**
1739
+ * Adds the current user to a thread
1740
+ *
1741
+ * @see {@link https://discord.com/developers/docs/resources/channel#join-thread}
1742
+ * @param threadId - The id of the thread to join
1743
+ */
712
1744
  async join(threadId) {
713
1745
  await this.rest.put(import_v109.Routes.threadMembers(threadId, "@me"));
714
1746
  }
1747
+ /**
1748
+ * Adds a member to a thread
1749
+ *
1750
+ * @see {@link https://discord.com/developers/docs/resources/channel#add-thread-member}
1751
+ * @param threadId - The id of the thread to add the member to
1752
+ * @param userId - The id of the user to add to the thread
1753
+ */
715
1754
  async addMember(threadId, userId) {
716
1755
  await this.rest.put(import_v109.Routes.threadMembers(threadId, userId));
717
1756
  }
1757
+ /**
1758
+ * Removes the current user from a thread
1759
+ *
1760
+ * @see {@link https://discord.com/developers/docs/resources/channel#leave-thread}
1761
+ * @param threadId - The id of the thread to leave
1762
+ */
718
1763
  async leave(threadId) {
719
1764
  await this.rest.delete(import_v109.Routes.threadMembers(threadId, "@me"));
720
1765
  }
1766
+ /**
1767
+ * Removes a member from a thread
1768
+ *
1769
+ * @see {@link https://discord.com/developers/docs/resources/channel#remove-thread-member}
1770
+ * @param threadId - The id of the thread to remove the member from
1771
+ * @param userId - The id of the user to remove from the thread
1772
+ */
721
1773
  async removeMember(threadId, userId) {
722
1774
  await this.rest.delete(import_v109.Routes.threadMembers(threadId, userId));
723
1775
  }
1776
+ /**
1777
+ * Fetches a member of a thread
1778
+ *
1779
+ * @see {@link https://discord.com/developers/docs/resources/channel#get-thread-member}
1780
+ * @param threadId - The id of the thread to fetch the member from
1781
+ * @param userId - The id of the user
1782
+ */
724
1783
  async getMember(threadId, userId) {
725
1784
  return this.rest.get(import_v109.Routes.threadMembers(threadId, userId));
726
1785
  }
1786
+ /**
1787
+ * Fetches all members of a thread
1788
+ *
1789
+ * @see {@link https://discord.com/developers/docs/resources/channel#list-thread-members}
1790
+ * @param threadId - The id of the thread to fetch the members from
1791
+ */
727
1792
  async getAllMembers(threadId) {
728
1793
  return this.rest.get(import_v109.Routes.threadMembers(threadId));
729
1794
  }
@@ -737,50 +1802,126 @@ var UsersAPI = class {
737
1802
  constructor(rest) {
738
1803
  this.rest = rest;
739
1804
  }
1805
+ /**
1806
+ * Fetches a user by their id
1807
+ *
1808
+ * @see {@link https://discord.com/developers/docs/resources/user#get-user}
1809
+ * @param userId - The id of the user to fetch
1810
+ */
740
1811
  async get(userId) {
741
1812
  return this.rest.get(import_v1010.Routes.user(userId));
742
1813
  }
1814
+ /**
1815
+ * Returns the user object of the requester's account
1816
+ *
1817
+ * @see {@link https://discord.com/developers/docs/resources/user#get-current-user}
1818
+ */
743
1819
  async getCurrent() {
744
1820
  return this.rest.get(import_v1010.Routes.user("@me"));
745
1821
  }
1822
+ /**
1823
+ * Returns a list of partial guild objects the current user is a member of
1824
+ *
1825
+ * @see {@link https://discord.com/developers/docs/resources/user#get-current-user-guilds}
1826
+ * @param options - The options to use when fetching the current user's guilds
1827
+ */
746
1828
  async getGuilds(options = {}) {
747
1829
  return this.rest.get(import_v1010.Routes.userGuilds(), {
748
1830
  query: (0, import_rest6.makeURLSearchParams)(options)
749
1831
  });
750
1832
  }
1833
+ /**
1834
+ * Leaves the guild with the given id
1835
+ *
1836
+ * @see {@link https://discord.com/developers/docs/resources/user#leave-guild}
1837
+ * @param guildId - The id of the guild
1838
+ */
751
1839
  async leaveGuild(guildId) {
752
1840
  await this.rest.delete(import_v1010.Routes.userGuild(guildId));
753
1841
  }
1842
+ /**
1843
+ * Edits the current user
1844
+ *
1845
+ * @see {@link https://discord.com/developers/docs/resources/user#modify-current-user}
1846
+ * @param user - The new data for the current user
1847
+ */
754
1848
  async edit(user) {
755
- return this.rest.patch(import_v1010.Routes.user("@me"), { body: user });
1849
+ return this.rest.patch(import_v1010.Routes.user("@me"), {
1850
+ body: user
1851
+ });
756
1852
  }
1853
+ /**
1854
+ * Fetches the guild member for the current user
1855
+ *
1856
+ * @see {@link https://discord.com/developers/docs/resources/user#get-current-user-guild-member}
1857
+ * @param guildId - The id of the guild
1858
+ */
757
1859
  async getGuildMember(guildId) {
758
1860
  return this.rest.get(import_v1010.Routes.userGuildMember(guildId));
759
1861
  }
1862
+ /**
1863
+ * Edits the guild member for the current user
1864
+ *
1865
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-current-member}
1866
+ * @param guildId - The id of the guild
1867
+ * @param member - The new data for the guild member
1868
+ * @param reason - The reason for editing this guild member
1869
+ */
760
1870
  async editGuildMember(guildId, member = {}, reason) {
761
1871
  return this.rest.patch(import_v1010.Routes.guildMember(guildId, "@me"), {
762
1872
  reason,
763
1873
  body: member
764
1874
  });
765
1875
  }
1876
+ /**
1877
+ * Sets the voice state for the current user
1878
+ *
1879
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state}
1880
+ * @param guildId - The id of the guild
1881
+ * @param options - The options to use when setting the voice state
1882
+ */
766
1883
  async setVoiceState(guildId, options = {}) {
767
1884
  return this.rest.patch(import_v1010.Routes.guildVoiceState(guildId, "@me"), {
768
1885
  body: options
769
1886
  });
770
1887
  }
1888
+ /**
1889
+ * Opens a new DM channel with a user
1890
+ *
1891
+ * @see {@link https://discord.com/developers/docs/resources/user#create-dm}
1892
+ * @param userId - The id of the user to open a DM channel with
1893
+ */
771
1894
  async createDM(userId) {
772
1895
  return this.rest.post(import_v1010.Routes.userChannels(), {
773
- body: { recipient_id: userId }
1896
+ body: {
1897
+ recipient_id: userId
1898
+ }
774
1899
  });
775
1900
  }
1901
+ /**
1902
+ * Gets the current user's connections
1903
+ *
1904
+ * @see {@link https://discord.com/developers/docs/resources/user#get-user-connections}
1905
+ */
776
1906
  async getConnections() {
777
1907
  return this.rest.get(import_v1010.Routes.userConnections());
778
1908
  }
1909
+ /**
1910
+ * Gets the current user's active application role connection
1911
+ *
1912
+ * @see {@link https://discord.com/developers/docs/resources/user#get-user-application-role-connection}
1913
+ * @param applicationId - The id of the application
1914
+ */
779
1915
  async getApplicationRoleConnection(applicationId) {
780
- return this.rest.get(
781
- import_v1010.Routes.userApplicationRoleConnection(applicationId)
782
- );
783
- }
1916
+ return this.rest.get(import_v1010.Routes.userApplicationRoleConnection(applicationId));
1917
+ }
1918
+ /**
1919
+ * Updates the current user's application role connection
1920
+ *
1921
+ * @see {@link https://discord.com/developers/docs/resources/user#update-user-application-role-connection}
1922
+ * @param applicationId - The id of the application
1923
+ * @param options - The options to use when updating the application role connection
1924
+ */
784
1925
  async updateApplicationRoleConnection(applicationId, options) {
785
1926
  return this.rest.put(import_v1010.Routes.userApplicationRoleConnection(applicationId), {
786
1927
  body: options
@@ -795,6 +1936,11 @@ var VoiceAPI = class {
795
1936
  constructor(rest) {
796
1937
  this.rest = rest;
797
1938
  }
1939
+ /**
1940
+ * Fetches all voice regions
1941
+ *
1942
+ * @see {@link https://discord.com/developers/docs/resources/voice#list-voice-regions}
1943
+ */
798
1944
  async getVoiceRegions() {
799
1945
  return this.rest.get(import_v1011.Routes.voiceRegions());
800
1946
  }
@@ -808,34 +1954,86 @@ var WebhooksAPI = class {
808
1954
  constructor(rest) {
809
1955
  this.rest = rest;
810
1956
  }
1957
+ /**
1958
+ * Fetches a webhook
1959
+ *
1960
+ * @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook}
1961
+ * @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook-with-token}
1962
+ * @param id - The id of the webhook
1963
+ * @param token - The token of the webhook
1964
+ */
811
1965
  async get(id, token) {
812
1966
  return this.rest.get(import_v1012.Routes.webhook(id, token));
813
1967
  }
1968
+ /**
1969
+ * Creates a new webhook
1970
+ *
1971
+ * @see {@link https://discord.com/developers/docs/resources/webhook#create-webhook}
1972
+ * @param channelId - The id of the channel to create the webhook in
1973
+ * @param data - The data to use when creating the webhook
1974
+ * @param reason - The reason for creating the webhook
1975
+ */
814
1976
  async create(channelId, data, reason) {
815
1977
  return this.rest.post(import_v1012.Routes.channelWebhooks(channelId), {
816
1978
  reason,
817
1979
  body: data
818
1980
  });
819
1981
  }
1982
+ /**
1983
+ * Edits a webhook
1984
+ *
1985
+ * @see {@link https://discord.com/developers/docs/resources/webhook#modify-webhook}
1986
+ * @see {@link https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token}
1987
+ * @param id - The id of the webhook to edit
1988
+ * @param webhook - The new webhook data
1989
+ * @param options - The options to use when editing the webhook
1990
+ */
820
1991
  async edit(id, webhook, { token, reason } = {}) {
821
- return this.rest.patch(import_v1012.Routes.webhook(id, token), { reason, body: webhook });
1992
+ return this.rest.patch(import_v1012.Routes.webhook(id, token), {
1993
+ reason,
1994
+ body: webhook
1995
+ });
822
1996
  }
1997
+ /**
1998
+ * Deletes a webhook
1999
+ *
2000
+ * @see {@link https://discord.com/developers/docs/resources/webhook#delete-webhook}
2001
+ * @see {@link https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token}
2002
+ * @param id - The id of the webhook to delete
2003
+ * @param options - The options to use when deleting the webhook
2004
+ */
823
2005
  async delete(id, { token, reason } = {}) {
824
- await this.rest.delete(import_v1012.Routes.webhook(id, token), { reason });
825
- }
826
- async execute(id, token, {
827
- wait,
828
- thread_id,
829
- files,
830
- ...body
831
- }) {
2006
+ await this.rest.delete(import_v1012.Routes.webhook(id, token), {
2007
+ reason
2008
+ });
2009
+ }
2010
+ /**
2011
+ * Executes a webhook
2012
+ *
2013
+ * @see {@link https://discord.com/developers/docs/resources/webhook#execute-webhook}
2014
+ * @param id - The id of the webhook
2015
+ * @param token - The token of the webhook
2016
+ * @param data - The data to use when executing the webhook
2017
+ */
2018
+ async execute(id, token, { wait, thread_id, files, ...body }) {
832
2019
  return this.rest.post(import_v1012.Routes.webhook(id, token), {
833
- query: (0, import_rest7.makeURLSearchParams)({ wait, thread_id }),
2020
+ query: (0, import_rest7.makeURLSearchParams)({
2021
+ wait,
2022
+ thread_id
2023
+ }),
834
2024
  files,
835
2025
  body,
836
2026
  auth: false
837
2027
  });
838
2028
  }
2029
+ /**
2030
+ * Executes a slack webhook
2031
+ *
2032
+ * @see {@link https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook}
2033
+ * @param id - The id of the webhook
2034
+ * @param token - The token of the webhook
2035
+ * @param options - The options to use when executing the webhook
2036
+ */
839
2037
  async executeSlack(id, token, body, options = {}) {
840
2038
  await this.rest.post(import_v1012.Routes.webhookPlatform(id, token, "slack"), {
841
2039
  query: (0, import_rest7.makeURLSearchParams)(options),
@@ -843,6 +2041,14 @@ var WebhooksAPI = class {
843
2041
  auth: false
844
2042
  });
845
2043
  }
2044
+ /**
2045
+ * Executes a github webhook
2046
+ *
2047
+ * @see {@link https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook}
2048
+ * @param id - The id of the webhook
2049
+ * @param token - The token of the webhook
2050
+ * @param options - The options to use when executing the webhook
2051
+ */
846
2052
  async executeGitHub(id, token, body, options = {}) {
847
2053
  await this.rest.post(import_v1012.Routes.webhookPlatform(id, token, "github"), {
848
2054
  query: (0, import_rest7.makeURLSearchParams)(options),
@@ -850,19 +2056,48 @@ var WebhooksAPI = class {
850
2056
  auth: false
851
2057
  });
852
2058
  }
2059
+ /**
2060
+ * Fetches an associated message from a webhook
2061
+ *
2062
+ * @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook-message}
2063
+ * @param id - The id of the webhook
2064
+ * @param token - The token of the webhook
2065
+ * @param messageId - The id of the message to fetch
2066
+ * @param options - The options to use when fetching the message
2067
+ */
853
2068
  async getMessage(id, token, messageId, options = {}) {
854
2069
  return this.rest.get(import_v1012.Routes.webhookMessage(id, token, messageId), {
855
2070
  query: (0, import_rest7.makeURLSearchParams)(options),
856
2071
  auth: false
857
2072
  });
858
2073
  }
2074
+ /**
2075
+ * Edits an associated message from a webhook
2076
+ *
2077
+ * @see {@link https://discord.com/developers/docs/resources/webhook#edit-webhook-message}
2078
+ * @param id - The id of the webhook
2079
+ * @param token - The token of the webhook
2080
+ * @param messageId - The id of the message to edit
2081
+ * @param data - The data to use when editing the message
2082
+ */
859
2083
  async editMessage(id, token, messageId, { thread_id, ...body }) {
860
2084
  return this.rest.patch(import_v1012.Routes.webhookMessage(id, token, messageId), {
861
- query: (0, import_rest7.makeURLSearchParams)({ thread_id }),
2085
+ query: (0, import_rest7.makeURLSearchParams)({
2086
+ thread_id
2087
+ }),
862
2088
  auth: false,
863
2089
  body
864
2090
  });
865
2091
  }
2092
+ /**
2093
+ * Deletes an associated message from a webhook
2094
+ *
2095
+ * @see {@link https://discord.com/developers/docs/resources/webhook#delete-webhook-message}
2096
+ * @param id - The id of the webhook
2097
+ * @param token - The token of the webhook
2098
+ * @param messageId - The id of the message to delete
2099
+ * @param options - The options to use when deleting the message
2100
+ */
866
2101
  async deleteMessage(id, token, messageId, options = {}) {
867
2102
  await this.rest.delete(import_v1012.Routes.webhookMessage(id, token, messageId), {
868
2103
  query: (0, import_rest7.makeURLSearchParams)(options),
@@ -889,18 +2124,6 @@ var API = class {
889
2124
  this.webhooks = new WebhooksAPI(rest);
890
2125
  this.interactions = new InteractionsAPI(rest, this.webhooks);
891
2126
  }
892
- applicationCommands;
893
- channels;
894
- guilds;
895
- interactions;
896
- invites;
897
- oauth2;
898
- roleConnections;
899
- stickers;
900
- threads;
901
- users;
902
- voice;
903
- webhooks;
904
2127
  };
905
2128
  __name(API, "API");
906
2129
 
@@ -912,9 +2135,6 @@ var import_snowflake = require("@sapphire/snowflake");
912
2135
  var import_async_event_emitter = require("@vladfrangu/async_event_emitter");
913
2136
  var import_v1013 = require("discord-api-types/v10");
914
2137
  var Client = class extends import_async_event_emitter.AsyncEventEmitter {
915
- rest;
916
- ws;
917
- api;
918
2138
  constructor({ rest, ws }) {
919
2139
  super();
920
2140
  this.rest = rest;
@@ -924,6 +2144,13 @@ var Client = class extends import_async_event_emitter.AsyncEventEmitter {
924
2144
  this.emit(dispatch.t, this.wrapIntrinsicProps(dispatch.d, shardId));
925
2145
  });
926
2146
  }
2147
+ /**
2148
+ * Requests guild members from the gateway.
2149
+ *
2150
+ * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-guild-members}
2151
+ * @param options - The options for the request
2152
+ * @param timeout - The timeout for waiting for each guild members chunk event
2153
+ */
927
2154
  async requestGuildMembers(options, timeout = 1e4) {
928
2155
  const shardId = (0, import_util.calculateShardId)(options.guild_id, await this.ws.getShardCount());
929
2156
  const nonce = options.nonce ?? import_snowflake.DiscordSnowflake.generate().toString();
@@ -946,6 +2173,7 @@ var Client = class extends import_async_event_emitter.AsyncEventEmitter {
946
2173
  });
947
2174
  await this.ws.send(shardId, {
948
2175
  op: import_v1013.GatewayOpcodes.RequestGuildMembers,
2176
+ // eslint-disable-next-line id-length
949
2177
  d: {
950
2178
  ...options,
951
2179
  nonce
@@ -953,16 +2181,30 @@ var Client = class extends import_async_event_emitter.AsyncEventEmitter {
953
2181
  });
954
2182
  return promise;
955
2183
  }
2184
+ /**
2185
+ * Updates the voice state of the bot user
2186
+ *
2187
+ * @see {@link https://discord.com/developers/docs/topics/gateway-events#update-voice-state}
2188
+ * @param options - The options for updating the voice state
2189
+ */
956
2190
  async updateVoiceState(options) {
957
2191
  const shardId = (0, import_util.calculateShardId)(options.guild_id, await this.ws.getShardCount());
958
2192
  await this.ws.send(shardId, {
959
2193
  op: import_v1013.GatewayOpcodes.VoiceStateUpdate,
2194
+ // eslint-disable-next-line id-length
960
2195
  d: options
961
2196
  });
962
2197
  }
2198
+ /**
2199
+ * Updates the presence of the bot user
2200
+ *
2201
+ * @param shardId - The id of the shard to update the presence in
2202
+ * @param options - The options for updating the presence
2203
+ */
963
2204
  async updatePresence(shardId, options) {
964
2205
  await this.ws.send(shardId, {
965
2206
  op: import_v1013.GatewayOpcodes.PresenceUpdate,
2207
+ // eslint-disable-next-line id-length
966
2208
  d: options
967
2209
  });
968
2210
  }
@@ -989,7 +2231,10 @@ function withFiles(files, options) {
989
2231
  name: file.name ?? index.toString(),
990
2232
  data: file.data
991
2233
  }));
992
- return { body, files: outputFiles };
2234
+ return {
2235
+ body,
2236
+ files: outputFiles
2237
+ };
993
2238
  }
994
2239
  __name(withFiles, "withFiles");
995
2240