disgroove 1.2.9 → 1.3.0-dev.3af784e

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.
Files changed (108) hide show
  1. package/dist/Client.d.ts +43 -43
  2. package/dist/Client.js +76 -76
  3. package/dist/Client.js.map +1 -1
  4. package/dist/gateway/Shard.js +32 -36
  5. package/dist/gateway/Shard.js.map +1 -1
  6. package/dist/index.d.ts +1 -0
  7. package/dist/index.js +1 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/rest/Endpoints.d.ts +1 -1
  10. package/dist/rest/Endpoints.js +3 -3
  11. package/dist/rest/RequestsManager.js +1 -1
  12. package/dist/rest/RequestsManager.js.map +1 -1
  13. package/dist/structures/Application.d.ts +72 -72
  14. package/dist/structures/Application.js +128 -155
  15. package/dist/structures/Application.js.map +1 -1
  16. package/dist/structures/ApplicationCommand.d.ts +4 -4
  17. package/dist/structures/ApplicationCommand.js +19 -19
  18. package/dist/structures/ApplicationCommand.js.map +1 -1
  19. package/dist/structures/AuditLog.d.ts +20 -0
  20. package/dist/structures/AuditLog.js +76 -0
  21. package/dist/structures/AuditLog.js.map +1 -0
  22. package/dist/structures/AutoModerationRule.d.ts +7 -7
  23. package/dist/structures/AutoModerationRule.js +7 -7
  24. package/dist/structures/AutoModerationRule.js.map +1 -1
  25. package/dist/structures/Channel.d.ts +134 -134
  26. package/dist/structures/Channel.js +263 -263
  27. package/dist/structures/Channel.js.map +1 -1
  28. package/dist/structures/ClientApplication.d.ts +324 -0
  29. package/dist/structures/ClientApplication.js +241 -0
  30. package/dist/structures/ClientApplication.js.map +1 -0
  31. package/dist/structures/Emoji.d.ts +2 -2
  32. package/dist/structures/Emoji.js +9 -9
  33. package/dist/structures/Emoji.js.map +1 -1
  34. package/dist/structures/Entitlement.d.ts +24 -0
  35. package/dist/structures/Entitlement.js +68 -0
  36. package/dist/structures/Entitlement.js.map +1 -0
  37. package/dist/structures/Guild.d.ts +311 -311
  38. package/dist/structures/Guild.js +615 -661
  39. package/dist/structures/Guild.js.map +1 -1
  40. package/dist/structures/GuildMember.d.ts +10 -10
  41. package/dist/structures/GuildMember.js +30 -30
  42. package/dist/structures/GuildMember.js.map +1 -1
  43. package/dist/structures/GuildScheduledEvent.d.ts +2 -2
  44. package/dist/structures/GuildScheduledEvent.js +7 -7
  45. package/dist/structures/GuildScheduledEvent.js.map +1 -1
  46. package/dist/structures/GuildTemplate.d.ts +4 -4
  47. package/dist/structures/GuildTemplate.js +7 -9
  48. package/dist/structures/GuildTemplate.js.map +1 -1
  49. package/dist/structures/Integration.d.ts +1 -1
  50. package/dist/structures/Integration.js +2 -2
  51. package/dist/structures/Integration.js.map +1 -1
  52. package/dist/structures/Interaction.d.ts +27 -42
  53. package/dist/structures/Interaction.js +97 -130
  54. package/dist/structures/Interaction.js.map +1 -1
  55. package/dist/structures/Invite.d.ts +2 -1
  56. package/dist/structures/Invite.js +1 -1
  57. package/dist/structures/Invite.js.map +1 -1
  58. package/dist/structures/Message.d.ts +23 -20
  59. package/dist/structures/Message.js +71 -206
  60. package/dist/structures/Message.js.map +1 -1
  61. package/dist/structures/PartialApplication.d.ts +70 -70
  62. package/dist/structures/PartialApplication.js +128 -155
  63. package/dist/structures/PartialApplication.js.map +1 -1
  64. package/dist/structures/Role.d.ts +2 -2
  65. package/dist/structures/Role.js +7 -7
  66. package/dist/structures/Role.js.map +1 -1
  67. package/dist/structures/SKU.d.ts +23 -0
  68. package/dist/structures/SKU.js +63 -0
  69. package/dist/structures/SKU.js.map +1 -0
  70. package/dist/structures/StageInstance.d.ts +3 -3
  71. package/dist/structures/StageInstance.js +7 -7
  72. package/dist/structures/StageInstance.js.map +1 -1
  73. package/dist/structures/Sticker.d.ts +2 -2
  74. package/dist/structures/Sticker.js +9 -9
  75. package/dist/structures/Sticker.js.map +1 -1
  76. package/dist/structures/Team.js +2 -2
  77. package/dist/structures/Team.js.map +1 -1
  78. package/dist/structures/TestEntitlement.d.ts +23 -0
  79. package/dist/structures/TestEntitlement.js +61 -0
  80. package/dist/structures/TestEntitlement.js.map +1 -0
  81. package/dist/structures/UnavailableGuild.d.ts +2 -487
  82. package/dist/structures/UnavailableGuild.js +1 -917
  83. package/dist/structures/UnavailableGuild.js.map +1 -1
  84. package/dist/structures/User.d.ts +13 -13
  85. package/dist/structures/User.js +35 -34
  86. package/dist/structures/User.js.map +1 -1
  87. package/dist/structures/Webhook.d.ts +26 -26
  88. package/dist/structures/Webhook.js +116 -148
  89. package/dist/structures/Webhook.js.map +1 -1
  90. package/dist/structures/index.d.ts +5 -1
  91. package/dist/structures/index.js +5 -1
  92. package/dist/structures/index.js.map +1 -1
  93. package/dist/types/application.d.ts +3 -3
  94. package/dist/types/auto-moderation.d.ts +3 -3
  95. package/dist/types/channel.d.ts +36 -21
  96. package/dist/types/gateway-events.d.ts +12 -12
  97. package/dist/types/guild.d.ts +5 -5
  98. package/dist/types/interaction.d.ts +57 -40
  99. package/dist/types/invite.d.ts +3 -2
  100. package/dist/types/message-components.d.ts +4 -4
  101. package/dist/types/sku.d.ts +1 -1
  102. package/dist/types/stage-instance.d.ts +3 -2
  103. package/dist/types/team.d.ts +1 -1
  104. package/dist/types/user.d.ts +3 -3
  105. package/dist/utils/Util.d.ts +11 -482
  106. package/dist/utils/Util.js +329 -151
  107. package/dist/utils/Util.js.map +1 -1
  108. package/package.json +1 -1
@@ -122,11 +122,11 @@ class Guild extends _1.Base {
122
122
  if (data.welcome_screen !== undefined)
123
123
  this.welcomeScreen = {
124
124
  description: data.welcome_screen.description,
125
- welcomeChannels: data.welcome_screen.welcome_channels.map((data) => ({
126
- channelId: data.channel_id,
127
- description: data.description,
128
- emojiId: data.emoji_id,
129
- emojiName: data.emoji_name,
125
+ welcomeChannels: data.welcome_screen.welcome_channels.map((welcomeChannel) => ({
126
+ channelId: welcomeChannel.channel_id,
127
+ description: welcomeChannel.description,
128
+ emojiId: welcomeChannel.emoji_id,
129
+ emojiName: welcomeChannel.emoji_name,
130
130
  })),
131
131
  };
132
132
  if (data.stickers !== undefined)
@@ -171,149 +171,66 @@ class Guild extends _1.Base {
171
171
  secrets: activity.secrets,
172
172
  instance: activity.instance,
173
173
  flags: activity.flags,
174
- buttons: activity.buttons?.map((button) => ({
175
- label: button.label,
176
- url: button.url,
177
- })),
174
+ buttons: activity.buttons,
178
175
  })),
179
- clientStatus: {
180
- desktop: presence.client_status.desktop,
181
- mobile: presence.client_status.mobile,
182
- web: presence.client_status.web,
183
- },
176
+ clientStatus: presence.client_status,
184
177
  }));
185
178
  if (data.stage_instances !== undefined)
186
179
  this.stageInstances = data.stage_instances.map((stageIntance) => new _1.StageInstance(stageIntance, this.client));
187
180
  if (data.guild_scheduled_events !== undefined)
188
181
  this.guildScheduledEvents = data.guild_scheduled_events.map((guildScheduledEvent) => new _1.GuildScheduledEvent(guildScheduledEvent, this.client));
189
182
  }
190
- /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands */
191
- async getApplicationCommands(applicationId, options) {
183
+ /** https://discord.com/developers/docs/resources/guild#add-guild-member */
184
+ async addMember(userId, options) {
192
185
  return this.client.rest
193
- .get(rest_1.Endpoints.applicationGuildCommands(applicationId, this.id), {
194
- query: {
195
- with_localizations: options?.withLocalizations,
186
+ .put(rest_1.Endpoints.guildMember(this.id, userId), {
187
+ json: {
188
+ access_token: options.accessToken,
189
+ nick: options.nick,
190
+ roles: options.roles,
191
+ mute: options.mute,
192
+ deaf: options.deaf,
196
193
  },
197
194
  })
198
- .then((response) => response.map((data) => new _1.ApplicationCommand(data, this.client)));
199
- }
200
- /** https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command */
201
- async createApplicationCommand(applicationId, options) {
202
- return new _1.ApplicationCommand(await this.client.rest.post(rest_1.Endpoints.applicationGuildCommands(applicationId, this.id), {
203
- json: this.client.util.applicationCommandToRaw(options),
204
- }), this.client);
205
- }
206
- /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command */
207
- async getApplicationCommand(applicationId, commandId) {
208
- return new _1.ApplicationCommand(await this.client.rest.get(rest_1.Endpoints.applicationGuildCommand(applicationId, this.id, commandId)), this.client);
209
- }
210
- /** https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command */
211
- async editApplicationCommand(applicationId, commandId, options) {
212
- return new _1.ApplicationCommand(await this.client.rest.patch(rest_1.Endpoints.applicationGuildCommand(applicationId, this.id, commandId), {
213
- json: this.client.util.applicationCommandToRaw(options),
214
- }), this.client);
195
+ .then((response) => {
196
+ if (response !== null) {
197
+ return new _1.GuildMember(response, this.client);
198
+ }
199
+ else
200
+ return null;
201
+ });
215
202
  }
216
- /** https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command */
217
- deleteApplicationCommand(applicationId, commandId) {
218
- this.client.rest.delete(rest_1.Endpoints.applicationGuildCommand(applicationId, this.id, commandId));
203
+ /** https://discord.com/developers/docs/resources/guild#add-guild-member-role */
204
+ addMemberRole(userId, roleId, reason) {
205
+ this.client.rest.put(rest_1.Endpoints.guildMemberRole(this.id, userId, roleId), {
206
+ reason,
207
+ });
219
208
  }
220
209
  /** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands */
221
- async bulkOverwriteApplicationCommands(applicationId, commands) {
210
+ async bulkEditApplicationCommands(applicationId, commands) {
222
211
  return this.client.rest
223
212
  .put(rest_1.Endpoints.applicationGuildCommands(applicationId, this.id), {
224
213
  json: commands.map((command) => this.client.util.applicationCommandToRaw(command)),
225
214
  })
226
215
  .then((response) => response.map((data) => new _1.ApplicationCommand(data, this.client)));
227
216
  }
228
- /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions */
229
- async getApplicationCommandsPermissions(applicationId) {
230
- return this.client.rest
231
- .get(rest_1.Endpoints.guildApplicationCommandsPermissions(applicationId, this.id))
232
- .then((response) => response.map((permissions) => ({
233
- id: permissions.id,
234
- applicationId: permissions.application_id,
235
- guildId: permissions.guild_id,
236
- permissions: permissions.permissions.map((permission) => ({
237
- id: permission.id,
238
- type: permission.type,
239
- permission: permission.permission,
240
- })),
241
- })));
242
- }
243
- /** https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions */
244
- async getApplicationCommandPermissions(applicationId, commandId) {
245
- return this.client.rest
246
- .get(rest_1.Endpoints.applicationCommandPermissions(applicationId, this.id, commandId))
247
- .then((response) => response.map((permissions) => ({
248
- id: permissions.id,
249
- applicationId: permissions.application_id,
250
- guildId: permissions.guild_id,
251
- permissions: permissions.permissions.map((permission) => ({
252
- id: permission.id,
253
- type: permission.type,
254
- permission: permission.permission,
255
- })),
256
- })));
257
- }
258
- /** https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log */
259
- async getAuditLog(options) {
260
- return this.client.rest
261
- .get(rest_1.Endpoints.guildAuditLog(this.id), {
262
- query: {
263
- user_id: options?.userId,
264
- action_type: options?.actionType,
265
- before: options?.before,
266
- after: options?.after,
267
- limit: options?.limit,
217
+ /** https://discord.com/developers/docs/resources/guild#begin-guild-prune */
218
+ async beginGuildPrune(options, reason) {
219
+ return this.client.rest.post(rest_1.Endpoints.guildPrune(this.id), {
220
+ json: {
221
+ days: options.days,
222
+ compute_prune_count: options.computePruneCount,
223
+ include_roles: options.includeRoles,
224
+ reason: options.reason,
268
225
  },
269
- })
270
- .then((response) => ({
271
- applicationCommands: response.application_commands.map((applicationCommand) => new _1.ApplicationCommand(applicationCommand, this.client)),
272
- auditLogEntries: response.audit_log_entries.map((auditLogEntry) => ({
273
- targetId: auditLogEntry.target_id,
274
- changes: auditLogEntry.changes?.map((change) => ({
275
- newValue: change.new_value,
276
- oldValue: change.old_value,
277
- key: change.key,
278
- })),
279
- userId: auditLogEntry.user_id,
280
- id: auditLogEntry.id,
281
- actionType: auditLogEntry.action_type,
282
- options: auditLogEntry.options !== undefined
283
- ? {
284
- applicationId: auditLogEntry.options.application_id,
285
- autoModerationRuleName: auditLogEntry.options.auto_moderation_rule_name,
286
- autoModerationRuleTriggerType: auditLogEntry.options.auto_moderation_rule_trigger_type,
287
- channelId: auditLogEntry.options.channel_id,
288
- count: auditLogEntry.options.count,
289
- deleteMemberDays: auditLogEntry.options.delete_member_days,
290
- id: auditLogEntry.options.id,
291
- membersRemoved: auditLogEntry.options.members_removed,
292
- messageId: auditLogEntry.options.message_id,
293
- roleName: auditLogEntry.options.role_name,
294
- type: auditLogEntry.options.type,
295
- integrationType: auditLogEntry.options.integration_type,
296
- }
297
- : undefined,
298
- reason: auditLogEntry.reason,
299
- })),
300
- autoModerationRules: response.auto_moderation_rules.map((autoModerationRule) => new _1.AutoModerationRule(autoModerationRule, this.client)),
301
- guildScheduledEvents: response.guild_scheduled_events.map((guildScheduledEvent) => new _1.GuildScheduledEvent(guildScheduledEvent, this.client)),
302
- integrations: response.integrations.map((integration) => new _1.Integration(integration, this.client)),
303
- threads: response.threads.map((thread) => new _1.Channel(thread, this.client)),
304
- users: response.users.map((user) => new _1.User(user, this.client)),
305
- webhooks: response.webhooks.map((webhook) => new _1.Webhook(webhook, this.client)),
306
- }));
307
- }
308
- /** https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild */
309
- async getAutoModerationRules() {
310
- return this.client.rest
311
- .get(rest_1.Endpoints.guildAutoModerationRules(this.id))
312
- .then((response) => response.map((data) => new _1.AutoModerationRule(data, this.client)));
226
+ reason,
227
+ });
313
228
  }
314
- /** https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule */
315
- async getAutoModerationRule(ruleId) {
316
- return new _1.AutoModerationRule(await this.client.rest.get(rest_1.Endpoints.guildAutoModerationRule(this.id, ruleId)), this.client);
229
+ /** https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command */
230
+ async createApplicationCommand(applicationId, options) {
231
+ return new _1.ApplicationCommand(await this.client.rest.post(rest_1.Endpoints.applicationGuildCommands(applicationId, this.id), {
232
+ json: this.client.util.applicationCommandToRaw(options),
233
+ }), this.client);
317
234
  }
318
235
  /** https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule */
319
236
  async createAutoModerationRule(options, reason) {
@@ -338,144 +255,16 @@ class Guild extends _1.Base {
338
255
  reason,
339
256
  }), this.client);
340
257
  }
341
- /** https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule */
342
- async editAutoModerationRule(ruleId, options, reason) {
343
- return new _1.AutoModerationRule(await this.client.rest.patch(rest_1.Endpoints.guildAutoModerationRule(this.id, ruleId), {
344
- json: {
345
- name: options.name,
346
- event_type: options.eventType,
347
- trigger_type: options.triggerType,
348
- trigger_metadata: options.triggerMetadata,
349
- actions: options.actions?.map((action) => ({
350
- type: action.type,
351
- metadata: {
352
- channel_id: action.metadata.channelId,
353
- duration_seconds: action.metadata.durationSeconds,
354
- custom_message: action.metadata.customMessage,
355
- },
356
- })),
357
- enabled: options.enabled,
358
- exempt_roles: options.exemptRoles,
359
- exempt_channels: options.exemptChannels,
360
- },
361
- reason,
362
- }), this.client);
363
- }
364
- /** https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule */
365
- deleteAutoModerationRule(ruleId, reason) {
366
- this.client.rest.delete(rest_1.Endpoints.guildAutoModerationRule(this.id, ruleId), {
367
- reason,
368
- });
369
- }
370
- /** https://discord.com/developers/docs/resources/emoji#list-guild-emojis */
371
- async getEmojis() {
372
- return this.client.rest
373
- .get(rest_1.Endpoints.guildEmojis(this.id))
374
- .then((response) => response.map((data) => new _1.Emoji(data, this.client)));
375
- }
376
- /** https://discord.com/developers/docs/resources/emoji#get-guild-emoji */
377
- async getEmoji(emojiId) {
378
- return new _1.Emoji(await this.client.rest.get(rest_1.Endpoints.guildEmoji(this.id, emojiId)), this.client);
379
- }
380
- /** https://discord.com/developers/docs/resources/emoji#create-guild-emoji */
381
- async createEmoji(options, reason) {
382
- return new _1.Emoji(await this.client.rest.post(rest_1.Endpoints.guildEmojis(this.id), {
383
- json: {
384
- name: options.name,
385
- image: options.image,
386
- roles: options.roles,
387
- },
388
- reason,
389
- }), this.client);
390
- }
391
- /** https://discord.com/developers/docs/resources/emoji#modify-guild-emoji */
392
- async editEmoji(emojiId, options, reason) {
393
- return new _1.Emoji(await this.client.rest.patch(rest_1.Endpoints.guildEmoji(this.id, emojiId), {
258
+ /** https://discord.com/developers/docs/resources/guild#create-guild-ban */
259
+ createBan(userId, options, reason) {
260
+ this.client.rest.put(rest_1.Endpoints.guildBan(this.id, userId), {
394
261
  json: {
395
- name: options.name,
396
- roles: options.roles,
262
+ delete_message_days: options?.deleteMessageDays,
263
+ delete_message_seconds: options?.deleteMessageSeconds,
397
264
  },
398
265
  reason,
399
- }), this.client);
400
- }
401
- /** https://discord.com/developers/docs/resources/emoji#delete-guild-emoji */
402
- deleteEmoji(emojiId, reason) {
403
- this.client.rest.delete(rest_1.Endpoints.guildEmoji(this.id, emojiId), {
404
- reason,
405
266
  });
406
267
  }
407
- /** https://discord.com/developers/docs/resources/guild#get-guild-preview */
408
- async getPreview() {
409
- return this.client.rest
410
- .get(rest_1.Endpoints.guildPreview(this.id))
411
- .then((response) => ({
412
- id: response.id,
413
- name: response.name,
414
- icon: response.icon,
415
- splash: response.splash,
416
- discoverySplash: response.discovery_splash,
417
- emojis: response.emojis.map((emoji) => new _1.Emoji(emoji, this.client)),
418
- features: response.features,
419
- approximateMemberCount: response.approximate_member_count,
420
- approximatePresenceCount: response.approximate_presence_count,
421
- description: response.description,
422
- stickers: response.stickers?.map((sticker) => ({
423
- id: sticker.id,
424
- packId: sticker.pack_id,
425
- name: sticker.name,
426
- description: sticker.description,
427
- tags: sticker.tags,
428
- asset: sticker.asset,
429
- type: sticker.type,
430
- formatType: sticker.format_type,
431
- available: sticker.available,
432
- guildId: sticker.guild_id,
433
- user: sticker.user !== undefined
434
- ? new _1.User(sticker.user, this.client)
435
- : undefined,
436
- sortValue: sticker.sort_value,
437
- })),
438
- }));
439
- }
440
- /** https://discord.com/developers/docs/resources/guild#modify-guild */
441
- async edit(options, reason) {
442
- return new Guild(await this.client.rest.patch(rest_1.Endpoints.guild(this.id), {
443
- json: {
444
- name: options.name,
445
- region: options.region,
446
- verification_level: options.verificationLevel,
447
- default_message_notifications: options.defaultMessageNotifications,
448
- explicit_content_filter: options.explicitContentFilter,
449
- afk_channel_id: options.afkChannelId,
450
- afk_timeout: options.afkTimeout,
451
- icon: options.icon,
452
- owner_id: options.ownerId,
453
- splash: options.splash,
454
- discovery_splash: options.discoverySplash,
455
- banner: options.banner,
456
- system_channel_id: options.systemChannelId,
457
- system_channel_flags: options.systemChannelFlags,
458
- rules_channel_id: options.rulesChannelId,
459
- public_updates_channel_id: options.publicUpdatesChannelId,
460
- preferred_locale: options.preferredLocale,
461
- features: options.features,
462
- description: options.description,
463
- premium_progress_bar_enabled: options.premiumProgressBarEnabled,
464
- safety_alerts_channel_id: options.safetyAlertsChannelId,
465
- },
466
- reason,
467
- }), this.client);
468
- }
469
- /** https://discord.com/developers/docs/resources/guild#delete-guild */
470
- delete() {
471
- this.client.rest.delete(rest_1.Endpoints.guild(this.id));
472
- }
473
- /** https://discord.com/developers/docs/resources/guild#get-guild-channels */
474
- async getChannels() {
475
- return this.client.rest
476
- .get(rest_1.Endpoints.guildChannels(this.id))
477
- .then((response) => response.map((data) => new _1.Channel(data, this.client)));
478
- }
479
268
  /** https://discord.com/developers/docs/resources/guild#create-guild-channel */
480
269
  async createChannel(options, reason) {
481
270
  return new _1.Channel(await this.client.rest.post(rest_1.Endpoints.guildChannels(this.id), {
@@ -505,201 +294,229 @@ class Guild extends _1.Base {
505
294
  reason,
506
295
  }), this.client);
507
296
  }
508
- /** https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions */
509
- editChannelPositions(options) {
510
- this.client.rest.patch(rest_1.Endpoints.guildChannels(this.id), {
511
- json: options.map((data) => ({
512
- id: data.id,
513
- position: data.position,
514
- lock_permissions: data.lockPermissions,
515
- parent_id: data.parentId,
516
- })),
517
- });
518
- }
519
- /** https://discord.com/developers/docs/resources/guild#list-active-guild-threads */
520
- async getActiveThreads() {
521
- return this.client.rest
522
- .get(rest_1.Endpoints.guildActiveThreads(this.id))
523
- .then((response) => response.map((data) => ({
524
- threads: data.threads.map((data) => new _1.Channel(data, this.client)),
525
- members: data.members.map((data) => ({
526
- id: data.id,
527
- userId: data.user_id,
528
- joinTimestamp: data.join_timestamp,
529
- flags: data.flags,
530
- member: data.member !== undefined
531
- ? new _1.GuildMember(data.member, this.client)
532
- : undefined,
533
- })),
534
- })));
535
- }
536
- /** https://discord.com/developers/docs/resources/guild#get-guild-member */
537
- async getMember(userId) {
538
- return new _1.GuildMember(await this.client.rest.get(rest_1.Endpoints.guildMember(this.id, userId)), this.client);
539
- }
540
- /** https://discord.com/developers/docs/resources/guild#list-guild-members */
541
- async getMembers() {
542
- return this.client.rest
543
- .get(rest_1.Endpoints.guildMembers(this.id))
544
- .then((response) => response.map((data) => new _1.GuildMember(data, this.client)));
545
- }
546
- /** https://discord.com/developers/docs/resources/guild#search-guild-members */
547
- async searchMembers(options) {
548
- return this.client.rest
549
- .get(rest_1.Endpoints.guildMembersSearch(this.id), {
550
- query: {
551
- query: options.query,
552
- limit: options.limit,
297
+ /** https://discord.com/developers/docs/resources/emoji#create-guild-emoji */
298
+ async createEmoji(options, reason) {
299
+ return new _1.Emoji(await this.client.rest.post(rest_1.Endpoints.guildEmojis(this.id), {
300
+ json: {
301
+ name: options.name,
302
+ image: options.image,
303
+ roles: options.roles,
553
304
  },
554
- })
555
- .then((response) => response.map((data) => new _1.GuildMember(data, this.client)));
305
+ reason,
306
+ }), this.client);
556
307
  }
557
- /** https://discord.com/developers/docs/resources/guild#add-guild-member */
558
- async addMember(userId, options) {
559
- return this.client.rest
560
- .put(rest_1.Endpoints.guildMember(this.id, userId), {
308
+ /** https://discord.com/developers/docs/resources/guild#create-guild-role */
309
+ async createRole(options, reason) {
310
+ return new _1.Role(await this.client.rest.post(rest_1.Endpoints.guildRoles(this.id), {
561
311
  json: {
562
- access_token: options.accessToken,
563
- nick: options.nick,
564
- roles: options.roles,
565
- mute: options.mute,
566
- deaf: options.deaf,
312
+ name: options.name,
313
+ permissions: options.permissions,
314
+ color: options.color,
315
+ hoist: options.hoist,
316
+ icon: options.icon,
317
+ unicode_emoji: options.unicodeEmoji,
318
+ mentionable: options.mentionable,
567
319
  },
568
- })
569
- .then((response) => {
570
- if (response !== null) {
571
- return new _1.GuildMember(response, this.client);
572
- }
573
- else {
574
- return null;
575
- }
576
- });
320
+ reason,
321
+ }), this.client);
577
322
  }
578
- /** https://discord.com/developers/docs/resources/guild#modify-guild-member */
579
- async editMember(userId, options, reason) {
580
- return new _1.GuildMember(await this.client.rest.patch(rest_1.Endpoints.guildMember(this.id, userId), {
323
+ /** https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event */
324
+ async createScheduledEvent(options, reason) {
325
+ return new _1.GuildScheduledEvent(await this.client.rest.post(rest_1.Endpoints.guildScheduledEvents(this.id), {
581
326
  json: {
582
- nick: options.nick,
583
- roles: options.roles,
584
- mute: options.mute,
585
- deaf: options.deaf,
586
327
  channel_id: options.channelId,
587
- communication_disabled_until: options.communicationDisabledUntil,
588
- flags: options.flags,
328
+ entity_metadata: options.entityMetadata,
329
+ name: options.name,
330
+ privacy_level: options.privacyLevel,
331
+ scheduled_start_time: options.scheduledEndTime,
332
+ scheduled_end_time: options.scheduledEndTime,
333
+ description: options.description,
334
+ entity_type: options.entityType,
335
+ image: options.image,
589
336
  },
590
337
  reason,
591
338
  }), this.client);
592
339
  }
593
- /** https://discord.com/developers/docs/resources/guild#modify-current-member */
594
- async editCurrentMember(options, reason) {
595
- return new _1.GuildMember(await this.client.rest.patch(rest_1.Endpoints.guildMember(this.id), {
340
+ /** https://discord.com/developers/docs/resources/sticker#create-guild-sticker */
341
+ async createSticker(options, reason) {
342
+ const formData = new undici_1.FormData();
343
+ formData.set("name", options.name);
344
+ formData.set("description", options.description);
345
+ formData.set("tags", options.tags);
346
+ formData.set("file", new undici_1.File([options.file.contents], options.file.name));
347
+ return this.client.rest
348
+ .post(rest_1.Endpoints.guildStickers(this.id), {
349
+ form: formData,
350
+ reason,
351
+ })
352
+ .then((response) => new _1.Sticker(response, this.client));
353
+ }
354
+ /** https://discord.com/developers/docs/resources/guild-template#create-guild-template */
355
+ async createTemplate(options) {
356
+ return new _1.GuildTemplate(await this.client.rest.post(rest_1.Endpoints.guildTemplates(this.id), {
596
357
  json: {
597
- nick: options.nick,
358
+ name: options.name,
359
+ description: options.description,
598
360
  },
599
- reason,
600
361
  }), this.client);
601
362
  }
602
- /** https://discord.com/developers/docs/resources/guild#add-guild-member-role */
603
- addMemberRole(userId, roleId, reason) {
604
- this.client.rest.put(rest_1.Endpoints.guildMemberRole(this.id, userId, roleId), {
363
+ /** https://discord.com/developers/docs/resources/guild#delete-guild */
364
+ delete() {
365
+ this.client.rest.delete(rest_1.Endpoints.guild(this.id));
366
+ }
367
+ /** https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command */
368
+ deleteApplicationCommand(applicationId, commandId) {
369
+ this.client.rest.delete(rest_1.Endpoints.applicationGuildCommand(applicationId, this.id, commandId));
370
+ }
371
+ /** https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule */
372
+ deleteAutoModerationRule(ruleId, reason) {
373
+ this.client.rest.delete(rest_1.Endpoints.guildAutoModerationRule(this.id, ruleId), {
605
374
  reason,
606
375
  });
607
376
  }
608
- /** https://discord.com/developers/docs/resources/guild#remove-guild-member-role */
609
- removeMemberRole(userId, roleId, reason) {
610
- this.client.rest.delete(rest_1.Endpoints.guildMemberRole(this.id, userId, roleId), {
377
+ /** https://discord.com/developers/docs/resources/emoji#delete-guild-emoji */
378
+ deleteEmoji(emojiId, reason) {
379
+ this.client.rest.delete(rest_1.Endpoints.guildEmoji(this.id, emojiId), {
611
380
  reason,
612
381
  });
613
382
  }
614
- /** https://discord.com/developers/docs/resources/guild#remove-guild-member-role */
615
- removeMember(userId, reason) {
616
- this.client.rest.delete(rest_1.Endpoints.guildMember(this.id, userId), {
383
+ /** https://discord.com/developers/docs/resources/guild#delete-guild-integration */
384
+ deleteIntegration(integrationId, reason) {
385
+ this.client.rest.delete(rest_1.Endpoints.guildIntegration(this.id, integrationId), {
617
386
  reason,
618
387
  });
619
388
  }
620
- /** https://discord.com/developers/docs/resources/guild#get-guild-bans */
621
- async getBans(options) {
622
- return this.client.rest
623
- .get(rest_1.Endpoints.guildBans(this.id), {
624
- query: {
625
- limit: options?.limit,
626
- before: options?.before,
627
- after: options?.after,
628
- },
629
- })
630
- .then((response) => response.map((data) => ({
631
- reason: data.reason,
632
- user: new _1.User(data.user, this.client),
633
- })));
634
- }
635
- /** https://discord.com/developers/docs/resources/guild#get-guild-ban */
636
- async getBan(userId) {
637
- return this.client.rest
638
- .get(rest_1.Endpoints.guildBan(this.id, userId))
639
- .then((response) => ({
640
- reason: response.reason,
641
- user: new _1.User(response.user, this.client),
642
- }));
643
- }
644
- /** https://discord.com/developers/docs/resources/guild#create-guild-ban */
645
- createBan(userId, options, reason) {
646
- this.client.rest.put(rest_1.Endpoints.guildBan(this.id, userId), {
647
- json: {
648
- delete_message_days: options?.deleteMessageDays,
649
- delete_message_seconds: options?.deleteMessageSeconds,
650
- },
389
+ /** https://discord.com/developers/docs/resources/guild#delete-guild-role */
390
+ deleteRole(roleId, reason) {
391
+ this.client.rest.delete(rest_1.Endpoints.guildRole(this.id, roleId), {
651
392
  reason,
652
393
  });
653
394
  }
654
- /** https://discord.com/developers/docs/resources/guild#remove-guild-ban */
655
- removeBan(userId, reason) {
656
- this.client.rest.delete(rest_1.Endpoints.guildBan(this.id, userId), {
395
+ /** https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event */
396
+ deleteScheduledEvent(scheduledEventId) {
397
+ this.client.rest.delete(rest_1.Endpoints.guildScheduledEvent(this.id, scheduledEventId));
398
+ }
399
+ /** https://discord.com/developers/docs/resources/sticker#delete-guild-sticker */
400
+ deleteSticker(stickerId, reason) {
401
+ this.client.rest.delete(rest_1.Endpoints.guildSticker(this.id, stickerId), {
657
402
  reason,
658
403
  });
659
404
  }
660
- /** https://discord.com/developers/docs/resources/guild#get-guild-roles */
661
- async getRoles() {
405
+ /** https://discord.com/developers/docs/resources/guild-template#delete-guild-template */
406
+ async deleteTemplate(code) {
662
407
  return this.client.rest
663
- .get(rest_1.Endpoints.guildRoles(this.id))
664
- .then((response) => response.map((data) => new _1.Role(data, this.client)));
408
+ .delete(rest_1.Endpoints.guildTemplate(this.id, code))
409
+ .then((response) => new _1.GuildTemplate(response, this.client).toJSON());
665
410
  }
666
- /** https://discord.com/developers/docs/resources/guild#create-guild-role */
667
- async createRole(options, reason) {
668
- return new _1.Role(await this.client.rest.post(rest_1.Endpoints.guildRoles(this.id), {
411
+ /** https://discord.com/developers/docs/resources/guild#modify-guild */
412
+ async edit(options, reason) {
413
+ return new Guild(await this.client.rest.patch(rest_1.Endpoints.guild(this.id), {
669
414
  json: {
670
415
  name: options.name,
671
- permissions: options.permissions,
672
- color: options.color,
673
- hoist: options.hoist,
416
+ region: options.region,
417
+ verification_level: options.verificationLevel,
418
+ default_message_notifications: options.defaultMessageNotifications,
419
+ explicit_content_filter: options.explicitContentFilter,
420
+ afk_channel_id: options.afkChannelId,
421
+ afk_timeout: options.afkTimeout,
674
422
  icon: options.icon,
675
- unicode_emoji: options.unicodeEmoji,
676
- mentionable: options.mentionable,
423
+ owner_id: options.ownerId,
424
+ splash: options.splash,
425
+ discovery_splash: options.discoverySplash,
426
+ banner: options.banner,
427
+ system_channel_id: options.systemChannelId,
428
+ system_channel_flags: options.systemChannelFlags,
429
+ rules_channel_id: options.rulesChannelId,
430
+ public_updates_channel_id: options.publicUpdatesChannelId,
431
+ preferred_locale: options.preferredLocale,
432
+ features: options.features,
433
+ description: options.description,
434
+ premium_progress_bar_enabled: options.premiumProgressBarEnabled,
435
+ safety_alerts_channel_id: options.safetyAlertsChannelId,
677
436
  },
678
437
  reason,
679
438
  }), this.client);
680
439
  }
681
- /** https://discord.com/developers/docs/resources/guild#modify-guild-role-positions */
682
- async editRolePositions(options) {
683
- return this.client.rest
684
- .patch(rest_1.Endpoints.guildRoles(this.id), {
440
+ /** https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command */
441
+ async editApplicationCommand(applicationId, commandId, options) {
442
+ return new _1.ApplicationCommand(await this.client.rest.patch(rest_1.Endpoints.applicationGuildCommand(applicationId, this.id, commandId), {
443
+ json: this.client.util.applicationCommandToRaw(options),
444
+ }), this.client);
445
+ }
446
+ /** https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule */
447
+ async editAutoModerationRule(ruleId, options, reason) {
448
+ return new _1.AutoModerationRule(await this.client.rest.patch(rest_1.Endpoints.guildAutoModerationRule(this.id, ruleId), {
449
+ json: {
450
+ name: options.name,
451
+ event_type: options.eventType,
452
+ trigger_type: options.triggerType,
453
+ trigger_metadata: options.triggerMetadata,
454
+ actions: options.actions?.map((action) => ({
455
+ type: action.type,
456
+ metadata: {
457
+ channel_id: action.metadata.channelId,
458
+ duration_seconds: action.metadata.durationSeconds,
459
+ custom_message: action.metadata.customMessage,
460
+ },
461
+ })),
462
+ enabled: options.enabled,
463
+ exempt_roles: options.exemptRoles,
464
+ exempt_channels: options.exemptChannels,
465
+ },
466
+ reason,
467
+ }), this.client);
468
+ }
469
+ /** https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions */
470
+ editChannelPositions(options) {
471
+ this.client.rest.patch(rest_1.Endpoints.guildChannels(this.id), {
685
472
  json: options.map((data) => ({
686
473
  id: data.id,
687
474
  position: data.position,
475
+ lock_permissions: data.lockPermissions,
476
+ parent_id: data.parentId,
688
477
  })),
689
- })
690
- .then((response) => response.map((data) => new _1.Role(data, this.client)));
478
+ });
691
479
  }
692
- /** https://discord.com/developers/docs/resources/guild#modify-guild-role */
693
- async editRole(roleId, options, reason) {
694
- return new _1.Role(await this.client.rest.patch(rest_1.Endpoints.guildRole(this.id, roleId), {
480
+ /** https://discord.com/developers/docs/resources/guild#modify-current-member */
481
+ async editCurrentMember(options, reason) {
482
+ return new _1.GuildMember(await this.client.rest.patch(rest_1.Endpoints.guildMember(this.id), {
695
483
  json: {
696
- name: options?.name,
697
- permissions: options?.permissions,
698
- color: options?.color,
699
- hoist: options?.hoist,
700
- icon: options?.icon,
701
- unicode_emoji: options?.unicodeEmoji,
702
- mentionable: options?.mentionable,
484
+ nick: options.nick,
485
+ },
486
+ reason,
487
+ }), this.client);
488
+ }
489
+ /** https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state */
490
+ editCurrentUserVoiceState(options) {
491
+ this.client.rest.patch(rest_1.Endpoints.guildVoiceState(this.id), {
492
+ json: {
493
+ channel_id: options.channelId,
494
+ suppress: options.suppress,
495
+ requestToSpeakTimestamp: options.requestToSpeakTimestamp,
496
+ },
497
+ });
498
+ }
499
+ /** https://discord.com/developers/docs/resources/emoji#modify-guild-emoji */
500
+ async editEmoji(emojiId, options, reason) {
501
+ return new _1.Emoji(await this.client.rest.patch(rest_1.Endpoints.guildEmoji(this.id, emojiId), {
502
+ json: {
503
+ name: options.name,
504
+ roles: options.roles,
505
+ },
506
+ reason,
507
+ }), this.client);
508
+ }
509
+ /** https://discord.com/developers/docs/resources/guild#modify-guild-member */
510
+ async editMember(userId, options, reason) {
511
+ return new _1.GuildMember(await this.client.rest.patch(rest_1.Endpoints.guildMember(this.id, userId), {
512
+ json: {
513
+ nick: options.nick,
514
+ roles: options.roles,
515
+ mute: options.mute,
516
+ deaf: options.deaf,
517
+ channel_id: options.channelId,
518
+ communication_disabled_until: options.communicationDisabledUntil,
519
+ flags: options.flags,
703
520
  },
704
521
  reason,
705
522
  }), this.client);
@@ -713,70 +530,139 @@ class Guild extends _1.Base {
713
530
  reason,
714
531
  });
715
532
  }
716
- /** https://discord.com/developers/docs/resources/guild#delete-guild-role */
717
- deleteRole(roleId, reason) {
718
- this.client.rest.delete(rest_1.Endpoints.guildRole(this.id, roleId), {
719
- reason,
720
- });
721
- }
722
- /** https://discord.com/developers/docs/resources/guild#get-guild-prune-count */
723
- async getPruneCount(options) {
724
- return this.client.rest.get(rest_1.Endpoints.guildPrune(this.id), {
725
- query: {
726
- days: options.days,
727
- include_roles: options.includeRoles,
533
+ /** https://discord.com/developers/docs/resources/guild#modify-guild-onboarding */
534
+ editOnboarding(options, reason) {
535
+ this.client.rest.patch(rest_1.Endpoints.guildOnboarding(this.id), {
536
+ json: {
537
+ prompts: options.prompts.map((prompt) => ({
538
+ id: prompt.id,
539
+ type: prompt.type,
540
+ options: prompt.options.map((option) => ({
541
+ id: option.id,
542
+ channel_ids: option.channelIds,
543
+ role_ids: option.roleIds,
544
+ emoji: option.emoji !== undefined
545
+ ? {
546
+ id: option.emoji.id,
547
+ name: option.emoji.name,
548
+ roles: option.emoji.roles,
549
+ user: option.emoji.user,
550
+ require_colons: option.emoji.requireColons,
551
+ managed: option.emoji.managed,
552
+ animated: option.emoji.animated,
553
+ available: option.emoji.available,
554
+ }
555
+ : undefined,
556
+ emoji_id: option.emojiId,
557
+ emoji_name: option.emojiName,
558
+ emoji_animated: option.emojiAnimated,
559
+ title: option.title,
560
+ description: option.description,
561
+ })),
562
+ title: prompt.title,
563
+ single_select: prompt.singleSelect,
564
+ required: prompt.required,
565
+ in_onboarding: prompt.inOnboarding,
566
+ })),
728
567
  },
568
+ reason,
729
569
  });
730
570
  }
731
- /** https://discord.com/developers/docs/resources/guild#begin-guild-prune */
732
- async beginGuildPrune(options, reason) {
733
- return this.client.rest.post(rest_1.Endpoints.guildPrune(this.id), {
571
+ /** https://discord.com/developers/docs/resources/guild#modify-guild-role */
572
+ async editRole(roleId, options, reason) {
573
+ return new _1.Role(await this.client.rest.patch(rest_1.Endpoints.guildRole(this.id, roleId), {
734
574
  json: {
735
- days: options.days,
736
- compute_prune_count: options.computePruneCount,
737
- include_roles: options.includeRoles,
738
- reason: options.reason,
575
+ name: options?.name,
576
+ permissions: options?.permissions,
577
+ color: options?.color,
578
+ hoist: options?.hoist,
579
+ icon: options?.icon,
580
+ unicode_emoji: options?.unicodeEmoji,
581
+ mentionable: options?.mentionable,
739
582
  },
740
583
  reason,
741
- });
584
+ }), this.client);
742
585
  }
743
- /** https://discord.com/developers/docs/resources/guild#get-guild-voice-regions */
744
- async getVoiceRegions() {
586
+ /** https://discord.com/developers/docs/resources/guild#modify-guild-role-positions */
587
+ async editRolePositions(options) {
745
588
  return this.client.rest
746
- .get(rest_1.Endpoints.guildVoiceRegions(this.id))
747
- .then((response) => response.map((data) => ({
748
- id: data.id,
749
- name: data.name,
750
- optimal: data.optimal,
751
- deprecated: data.deprecated,
752
- custom: data.custom,
753
- })));
589
+ .patch(rest_1.Endpoints.guildRoles(this.id), {
590
+ json: options.map((data) => ({
591
+ id: data.id,
592
+ position: data.position,
593
+ })),
594
+ })
595
+ .then((response) => response.map((data) => new _1.Role(data, this.client)));
754
596
  }
755
- /** https://discord.com/developers/docs/resources/guild#get-guild-invites */
756
- async getInvites() {
597
+ /** https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event */
598
+ async editScheduledEvent(scheduledEventId, options, reason) {
599
+ return new _1.GuildScheduledEvent(await this.client.rest.patch(rest_1.Endpoints.guildScheduledEvent(this.id, scheduledEventId), {
600
+ json: {
601
+ channel_id: options.channelId,
602
+ entity_metadata: options.entityMetadata,
603
+ name: options.name,
604
+ privacy_level: options.privacyLevel,
605
+ scheduled_start_time: options.scheduledStartTime,
606
+ scheduled_end_time: options.scheduledEndTime,
607
+ description: options.description,
608
+ entityType: options.entityType,
609
+ status: options.status,
610
+ image: options.image,
611
+ },
612
+ reason,
613
+ }), this.client);
614
+ }
615
+ /** https://discord.com/developers/docs/resources/sticker#modify-guild-sticker */
616
+ async editSticker(stickerId, options, reason) {
757
617
  return this.client.rest
758
- .get(rest_1.Endpoints.guildInvites(this.id))
759
- .then((response) => response.map((data) => new _1.Invite(data, this.client)));
618
+ .patch(rest_1.Endpoints.guildSticker(this.id, stickerId), {
619
+ json: {
620
+ name: options.name,
621
+ description: options.description,
622
+ tags: options.tags,
623
+ },
624
+ reason,
625
+ })
626
+ .then((response) => new _1.Sticker(response, this.client));
760
627
  }
761
- /** https://discord.com/developers/docs/resources/guild#get-guild-integrations */
762
- async getIntegrations() {
763
- return this.client.rest
764
- .get(rest_1.Endpoints.guildIntegrations(this.id))
765
- .then((response) => response.map((data) => new _1.Integration(data, this.client)));
628
+ /** https://discord.com/developers/docs/resources/guild-template#modify-guild-template */
629
+ async editTemplate(code, options) {
630
+ return new _1.GuildTemplate(await this.client.rest.patch(rest_1.Endpoints.guildTemplate(this.id, code), {
631
+ json: {
632
+ name: options.name,
633
+ description: options.description,
634
+ },
635
+ }), this.client);
766
636
  }
767
- /** https://discord.com/developers/docs/resources/guild#delete-guild-integration */
768
- deleteIntegration(integrationId, reason) {
769
- this.client.rest.delete(rest_1.Endpoints.guildIntegration(this.id, integrationId), {
770
- reason,
637
+ /** https://discord.com/developers/docs/resources/guild#modify-user-voice-state */
638
+ editUserVoiceState(userId, options) {
639
+ this.client.rest.patch(rest_1.Endpoints.guildVoiceState(this.id, userId), {
640
+ json: {
641
+ channel_id: options.channelId,
642
+ suppress: options.suppress,
643
+ requestToSpeakTimestamp: options.requestToSpeakTimestamp,
644
+ },
771
645
  });
772
646
  }
773
- /** https://discord.com/developers/docs/resources/guild#get-guild-widget-settings */
774
- async getWidgetSettings() {
647
+ /** https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen */
648
+ async editWelcomeScreen(options, reason) {
775
649
  return this.client.rest
776
- .get(rest_1.Endpoints.guildWidgetSettings(this.id))
650
+ .patch(rest_1.Endpoints.guildWelcomeScreen(this.id), {
651
+ json: {
652
+ enabled: options.enabled,
653
+ welcome_channels: options.welcomeChannels,
654
+ description: options.description,
655
+ },
656
+ reason,
657
+ })
777
658
  .then((response) => ({
778
- enabled: response.enabled,
779
- channelId: response.channel_id,
659
+ description: response.description,
660
+ welcomeChannels: response.welcome_channels.map((data) => ({
661
+ channelId: data.channel_id,
662
+ description: data.description,
663
+ emojiId: data.emoji_id,
664
+ emojiName: data.emoji_name,
665
+ })),
780
666
  }));
781
667
  }
782
668
  /** https://discord.com/developers/docs/resources/guild#modify-guild-widget */
@@ -794,66 +680,151 @@ class Guild extends _1.Base {
794
680
  channelId: response.channel_id,
795
681
  }));
796
682
  }
797
- /** https://discord.com/developers/docs/resources/guild#get-guild-widget */
798
- async getWidget() {
683
+ /** https://discord.com/developers/docs/resources/guild#list-active-guild-threads */
684
+ async getActiveThreads() {
799
685
  return this.client.rest
800
- .get(rest_1.Endpoints.guildWidgetJSON(this.id))
801
- .then((response) => ({
802
- id: response.id,
803
- name: response.name,
804
- instantInvite: response.instant_invite,
805
- channels: response.channels.map((data) => new _1.Channel(data, this.client)),
806
- members: response.members.map((data) => new _1.User(data, this.client)),
807
- presenceCount: response.presence_count,
808
- }));
686
+ .get(rest_1.Endpoints.guildActiveThreads(this.id))
687
+ .then((response) => response.map((data) => ({
688
+ threads: data.threads.map((data) => new _1.Channel(data, this.client)),
689
+ members: data.members.map((data) => ({
690
+ id: data.id,
691
+ userId: data.user_id,
692
+ joinTimestamp: data.join_timestamp,
693
+ flags: data.flags,
694
+ member: data.member !== undefined
695
+ ? new _1.GuildMember(data.member, this.client)
696
+ : undefined,
697
+ })),
698
+ })));
809
699
  }
810
- /** https://discord.com/developers/docs/resources/guild#get-guild-vanity-url */
811
- getVanityURL() {
812
- return this.client.rest.get(rest_1.Endpoints.guildVanityUrl(this.id));
700
+ /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command */
701
+ async getApplicationCommand(applicationId, commandId) {
702
+ return new _1.ApplicationCommand(await this.client.rest.get(rest_1.Endpoints.applicationGuildCommand(applicationId, this.id, commandId)), this.client);
813
703
  }
814
- /** https://discord.com/developers/docs/resources/guild#get-guild-widget-image */
815
- async getWidgetImage(options) {
816
- return this.client.rest.get(rest_1.Endpoints.guildWidgetImage(this.id), {
704
+ /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands */
705
+ async getApplicationCommands(applicationId, options) {
706
+ return this.client.rest
707
+ .get(rest_1.Endpoints.applicationGuildCommands(applicationId, this.id), {
817
708
  query: {
818
- style: options?.style,
709
+ with_localizations: options?.withLocalizations,
819
710
  },
820
- });
711
+ })
712
+ .then((response) => response.map((data) => new _1.ApplicationCommand(data, this.client)));
821
713
  }
822
- /** https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen */
823
- async getWelcomeScreen() {
714
+ /** https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions */
715
+ async getApplicationCommandPermissions(applicationId, commandId) {
824
716
  return this.client.rest
825
- .get(rest_1.Endpoints.guildWelcomeScreen(this.id))
826
- .then((response) => ({
827
- description: response.description,
828
- welcomeChannels: response.welcome_channels.map((data) => ({
829
- channelId: data.channel_id,
830
- description: data.description,
831
- emojiId: data.emoji_id,
832
- emojiName: data.emoji_name,
717
+ .get(rest_1.Endpoints.applicationCommandPermissions(applicationId, this.id, commandId))
718
+ .then((response) => response.map((permissions) => ({
719
+ id: permissions.id,
720
+ applicationId: permissions.application_id,
721
+ guildId: permissions.guild_id,
722
+ permissions: permissions.permissions.map((permission) => ({
723
+ id: permission.id,
724
+ type: permission.type,
725
+ permission: permission.permission,
833
726
  })),
834
- }));
727
+ })));
835
728
  }
836
- /** https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen */
837
- async editWelcomeScreen(options, reason) {
729
+ /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions */
730
+ async getApplicationCommandsPermissions(applicationId) {
838
731
  return this.client.rest
839
- .patch(rest_1.Endpoints.guildWelcomeScreen(this.id), {
840
- json: {
841
- enabled: options.enabled,
842
- welcome_channels: options.welcomeChannels,
843
- description: options.description,
732
+ .get(rest_1.Endpoints.guildApplicationCommandsPermissions(applicationId, this.id))
733
+ .then((response) => response.map((permissions) => ({
734
+ id: permissions.id,
735
+ applicationId: permissions.application_id,
736
+ guildId: permissions.guild_id,
737
+ permissions: permissions.permissions.map((permission) => ({
738
+ id: permission.id,
739
+ type: permission.type,
740
+ permission: permission.permission,
741
+ })),
742
+ })));
743
+ }
744
+ /** https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log */
745
+ async getAuditLog(options) {
746
+ return new _1.AuditLog(await this.client.rest.get(rest_1.Endpoints.guildAuditLog(this.id), {
747
+ query: {
748
+ user_id: options?.userId,
749
+ action_type: options?.actionType,
750
+ before: options?.before,
751
+ after: options?.after,
752
+ limit: options?.limit,
844
753
  },
845
- reason,
846
- })
754
+ }), this.client);
755
+ }
756
+ /** https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule */
757
+ async getAutoModerationRule(ruleId) {
758
+ return new _1.AutoModerationRule(await this.client.rest.get(rest_1.Endpoints.guildAutoModerationRule(this.id, ruleId)), this.client);
759
+ }
760
+ /** https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild */
761
+ async getAutoModerationRules() {
762
+ return this.client.rest
763
+ .get(rest_1.Endpoints.guildAutoModerationRules(this.id))
764
+ .then((response) => response.map((data) => new _1.AutoModerationRule(data, this.client)));
765
+ }
766
+ /** https://discord.com/developers/docs/resources/guild#get-guild-ban */
767
+ async getBan(userId) {
768
+ return this.client.rest
769
+ .get(rest_1.Endpoints.guildBan(this.id, userId))
847
770
  .then((response) => ({
848
- description: response.description,
849
- welcomeChannels: response.welcome_channels.map((data) => ({
850
- channelId: data.channel_id,
851
- description: data.description,
852
- emojiId: data.emoji_id,
853
- emojiName: data.emoji_name,
854
- })),
771
+ reason: response.reason,
772
+ user: new _1.User(response.user, this.client),
855
773
  }));
856
774
  }
775
+ /** https://discord.com/developers/docs/resources/guild#get-guild-bans */
776
+ async getBans(options) {
777
+ return this.client.rest
778
+ .get(rest_1.Endpoints.guildBans(this.id), {
779
+ query: {
780
+ limit: options?.limit,
781
+ before: options?.before,
782
+ after: options?.after,
783
+ },
784
+ })
785
+ .then((response) => response.map((data) => ({
786
+ reason: data.reason,
787
+ user: new _1.User(data.user, this.client).toJSON(),
788
+ })));
789
+ }
790
+ /** https://discord.com/developers/docs/resources/guild#get-guild-channels */
791
+ async getChannels() {
792
+ return this.client.rest
793
+ .get(rest_1.Endpoints.guildChannels(this.id))
794
+ .then((response) => response.map((data) => new _1.Channel(data, this.client)));
795
+ }
796
+ /** https://discord.com/developers/docs/resources/emoji#get-guild-emoji */
797
+ async getEmoji(emojiId) {
798
+ return new _1.Emoji(await this.client.rest.get(rest_1.Endpoints.guildEmoji(this.id, emojiId)), this.client);
799
+ }
800
+ /** https://discord.com/developers/docs/resources/emoji#list-guild-emojis */
801
+ async getEmojis() {
802
+ return this.client.rest
803
+ .get(rest_1.Endpoints.guildEmojis(this.id))
804
+ .then((response) => response.map((data) => new _1.Emoji(data, this.client)));
805
+ }
806
+ /** https://discord.com/developers/docs/resources/guild#get-guild-integrations */
807
+ async getIntegrations() {
808
+ return this.client.rest
809
+ .get(rest_1.Endpoints.guildIntegrations(this.id))
810
+ .then((response) => response.map((data) => new _1.Integration(data, this.client)));
811
+ }
812
+ /** https://discord.com/developers/docs/resources/guild#get-guild-invites */
813
+ async getInvites() {
814
+ return this.client.rest
815
+ .get(rest_1.Endpoints.guildInvites(this.id))
816
+ .then((response) => response.map((data) => new _1.Invite(data, this.client)));
817
+ }
818
+ /** https://discord.com/developers/docs/resources/guild#get-guild-member */
819
+ async getMember(userId) {
820
+ return new _1.GuildMember(await this.client.rest.get(rest_1.Endpoints.guildMember(this.id, userId)), this.client);
821
+ }
822
+ /** https://discord.com/developers/docs/resources/guild#list-guild-members */
823
+ async getMembers() {
824
+ return this.client.rest
825
+ .get(rest_1.Endpoints.guildMembers(this.id))
826
+ .then((response) => response.map((data) => new _1.GuildMember(data, this.client)));
827
+ }
857
828
  /** https://discord.com/developers/docs/resources/guild#get-guild-onboarding */
858
829
  async getOnboarding() {
859
830
  return this.client.rest
@@ -886,63 +857,53 @@ class Guild extends _1.Base {
886
857
  mode: response.mode,
887
858
  }));
888
859
  }
889
- /** https://discord.com/developers/docs/resources/guild#modify-guild-onboarding */
890
- editOnboarding(options, reason) {
891
- this.client.rest.patch(rest_1.Endpoints.guildOnboarding(this.id), {
892
- json: {
893
- prompts: options.prompts.map((prompt) => ({
894
- id: prompt.id,
895
- type: prompt.type,
896
- options: prompt.options.map((option) => ({
897
- id: option.id,
898
- channel_ids: option.channelIds,
899
- role_ids: option.roleIds,
900
- emoji: option.emoji !== undefined
901
- ? {
902
- id: option.emoji.id,
903
- name: option.emoji.name,
904
- roles: option.emoji.roles,
905
- user: option.emoji.user,
906
- require_colons: option.emoji.requireColons,
907
- managed: option.emoji.managed,
908
- animated: option.emoji.animated,
909
- available: option.emoji.available,
910
- }
911
- : undefined,
912
- emoji_id: option.emojiId,
913
- emoji_name: option.emojiName,
914
- emoji_animated: option.emojiAnimated,
915
- title: option.title,
916
- description: option.description,
917
- })),
918
- title: prompt.title,
919
- single_select: prompt.singleSelect,
920
- required: prompt.required,
921
- in_onboarding: prompt.inOnboarding,
922
- })),
923
- },
924
- reason,
925
- });
926
- }
927
- /** https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state */
928
- editCurrentUserVoiceState(options) {
929
- this.client.rest.patch(rest_1.Endpoints.guildVoiceState(this.id), {
930
- json: {
931
- channel_id: options.channelId,
932
- suppress: options.suppress,
933
- requestToSpeakTimestamp: options.requestToSpeakTimestamp,
860
+ /** https://discord.com/developers/docs/resources/guild#get-guild-preview */
861
+ async getPreview() {
862
+ return this.client.rest
863
+ .get(rest_1.Endpoints.guildPreview(this.id))
864
+ .then((response) => ({
865
+ id: response.id,
866
+ name: response.name,
867
+ icon: response.icon,
868
+ splash: response.splash,
869
+ discoverySplash: response.discovery_splash,
870
+ emojis: response.emojis.map((emoji) => new _1.Emoji(emoji, this.client)),
871
+ features: response.features,
872
+ approximateMemberCount: response.approximate_member_count,
873
+ approximatePresenceCount: response.approximate_presence_count,
874
+ description: response.description,
875
+ stickers: response.stickers?.map((sticker) => ({
876
+ id: sticker.id,
877
+ packId: sticker.pack_id,
878
+ name: sticker.name,
879
+ description: sticker.description,
880
+ tags: sticker.tags,
881
+ asset: sticker.asset,
882
+ type: sticker.type,
883
+ formatType: sticker.format_type,
884
+ available: sticker.available,
885
+ guildId: sticker.guild_id,
886
+ user: sticker.user !== undefined
887
+ ? new _1.User(sticker.user, this.client)
888
+ : undefined,
889
+ sortValue: sticker.sort_value,
890
+ })),
891
+ }));
892
+ }
893
+ /** https://discord.com/developers/docs/resources/guild#get-guild-prune-count */
894
+ async getPruneCount(options) {
895
+ return this.client.rest.get(rest_1.Endpoints.guildPrune(this.id), {
896
+ query: {
897
+ days: options.days,
898
+ include_roles: options.includeRoles,
934
899
  },
935
900
  });
936
901
  }
937
- /** https://discord.com/developers/docs/resources/guild#modify-user-voice-state */
938
- editUserVoiceState(userId, options) {
939
- this.client.rest.patch(rest_1.Endpoints.guildVoiceState(this.id, userId), {
940
- json: {
941
- channel_id: options.channelId,
942
- suppress: options.suppress,
943
- requestToSpeakTimestamp: options.requestToSpeakTimestamp,
944
- },
945
- });
902
+ /** https://discord.com/developers/docs/resources/guild#get-guild-roles */
903
+ async getRoles() {
904
+ return this.client.rest
905
+ .get(rest_1.Endpoints.guildRoles(this.id))
906
+ .then((response) => response.map((data) => new _1.Role(data, this.client)));
946
907
  }
947
908
  /** https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild */
948
909
  async getScheduledEvents(options) {
@@ -954,45 +915,6 @@ class Guild extends _1.Base {
954
915
  })
955
916
  .then((response) => response.map((data) => new _1.GuildScheduledEvent(data, this.client)));
956
917
  }
957
- /** https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event */
958
- async createScheduledEvent(options, reason) {
959
- return new _1.GuildScheduledEvent(await this.client.rest.post(rest_1.Endpoints.guildScheduledEvents(this.id), {
960
- json: {
961
- channel_id: options.channelId,
962
- entity_metadata: options.entityMetadata,
963
- name: options.name,
964
- privacy_level: options.privacyLevel,
965
- scheduled_start_time: options.scheduledEndTime,
966
- scheduled_end_time: options.scheduledEndTime,
967
- description: options.description,
968
- entity_type: options.entityType,
969
- image: options.image,
970
- },
971
- reason,
972
- }), this.client);
973
- }
974
- /** https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event */
975
- async editScheduledEvent(scheduledEventId, options, reason) {
976
- return new _1.GuildScheduledEvent(await this.client.rest.patch(rest_1.Endpoints.guildScheduledEvent(this.id, scheduledEventId), {
977
- json: {
978
- channel_id: options.channelId,
979
- entity_metadata: options.entityMetadata,
980
- name: options.name,
981
- privacy_level: options.privacyLevel,
982
- scheduled_start_time: options.scheduledStartTime,
983
- scheduled_end_time: options.scheduledEndTime,
984
- description: options.description,
985
- entityType: options.entityType,
986
- status: options.status,
987
- image: options.image,
988
- },
989
- reason,
990
- }), this.client);
991
- }
992
- /** https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event */
993
- deleteScheduledEvent(scheduledEventId) {
994
- this.client.rest.delete(rest_1.Endpoints.guildScheduledEvent(this.id, scheduledEventId));
995
- }
996
918
  /** https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users */
997
919
  async getScheduledEventUsers(scheduledEventId, options) {
998
920
  return this.client.rest
@@ -1006,12 +928,24 @@ class Guild extends _1.Base {
1006
928
  })
1007
929
  .then((response) => response.map((data) => ({
1008
930
  guildScheduledEventId: data.guild_scheduled_event_id,
1009
- user: new _1.User(data.user, this.client),
931
+ user: new _1.User(data.user, this.client).toJSON(),
1010
932
  member: data.member !== undefined
1011
- ? new _1.GuildMember(data.member, this.client)
933
+ ? new _1.GuildMember(data.member, this.client).toJSON()
1012
934
  : undefined,
1013
935
  })));
1014
936
  }
937
+ /** https://discord.com/developers/docs/resources/sticker#get-guild-sticker */
938
+ async getSticker(stickerId) {
939
+ return this.client.rest
940
+ .get(rest_1.Endpoints.guildSticker(this.id, stickerId))
941
+ .then((response) => new _1.Sticker(response, this.client));
942
+ }
943
+ /** https://discord.com/developers/docs/resources/sticker#list-guild-stickers */
944
+ async getStickers() {
945
+ return this.client.rest
946
+ .get(rest_1.Endpoints.guildStickers(this.id))
947
+ .then((response) => response.map((data) => new _1.Sticker(data, this.client)));
948
+ }
1015
949
  /** https://discord.com/developers/docs/resources/guild-template#get-guild-template */
1016
950
  async getTemplate(code) {
1017
951
  return new _1.GuildTemplate(await this.client.rest.get(rest_1.Endpoints.guildTemplate(this.id, code)), this.client);
@@ -1022,91 +956,111 @@ class Guild extends _1.Base {
1022
956
  .get(rest_1.Endpoints.guildTemplates(this.id))
1023
957
  .then((response) => response.map((data) => new _1.GuildTemplate(data, this.client)));
1024
958
  }
1025
- /** https://discord.com/developers/docs/resources/guild-template#create-guild-template */
1026
- async createTemplate(options) {
1027
- return new _1.GuildTemplate(await this.client.rest.post(rest_1.Endpoints.guildTemplates(this.id), {
1028
- json: {
1029
- name: options.name,
1030
- description: options.description,
1031
- },
1032
- }), this.client);
1033
- }
1034
- /** https://discord.com/developers/docs/resources/guild-template#sync-guild-template */
1035
- async syncTemplate(code) {
1036
- return new _1.GuildTemplate(await this.client.rest.put(rest_1.Endpoints.guildTemplate(this.id, code)), this.client);
959
+ /** https://discord.com/developers/docs/resources/guild#get-guild-vanity-url */
960
+ getVanityURL() {
961
+ return this.client.rest.get(rest_1.Endpoints.guildVanityURL(this.id));
1037
962
  }
1038
- /** https://discord.com/developers/docs/resources/guild-template#modify-guild-template */
1039
- async editTemplate(code, options) {
1040
- return new _1.GuildTemplate(await this.client.rest.patch(rest_1.Endpoints.guildTemplate(this.id, code), {
1041
- json: {
1042
- name: options.name,
1043
- description: options.description,
1044
- },
1045
- }), this.client);
963
+ /** https://discord.com/developers/docs/resources/guild#get-guild-voice-regions */
964
+ async getVoiceRegions() {
965
+ return this.client.rest
966
+ .get(rest_1.Endpoints.guildVoiceRegions(this.id))
967
+ .then((response) => response.map((data) => ({
968
+ id: data.id,
969
+ name: data.name,
970
+ optimal: data.optimal,
971
+ deprecated: data.deprecated,
972
+ custom: data.custom,
973
+ })));
1046
974
  }
1047
- /** https://discord.com/developers/docs/resources/guild-template#delete-guild-template */
1048
- async deleteTemplate(code) {
975
+ /** https://discord.com/developers/docs/resources/webhook#get-guild-webhooks */
976
+ async getWebhooks() {
1049
977
  return this.client.rest
1050
- .delete(rest_1.Endpoints.guildTemplate(this.id, code))
1051
- .then((response) => new _1.GuildTemplate(response, this.client).toJSON());
978
+ .get(rest_1.Endpoints.guildWebhooks(this.id))
979
+ .then((response) => response.map((data) => new _1.Webhook(data, this.client)));
1052
980
  }
1053
- /** https://discord.com/developers/docs/resources/sticker#list-guild-stickers */
1054
- async getStickers() {
981
+ /** https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen */
982
+ async getWelcomeScreen() {
1055
983
  return this.client.rest
1056
- .get(rest_1.Endpoints.guildStickers(this.id))
1057
- .then((response) => response.map((data) => new _1.Sticker(data, this.client)));
984
+ .get(rest_1.Endpoints.guildWelcomeScreen(this.id))
985
+ .then((response) => ({
986
+ description: response.description,
987
+ welcomeChannels: response.welcome_channels.map((data) => ({
988
+ channelId: data.channel_id,
989
+ description: data.description,
990
+ emojiId: data.emoji_id,
991
+ emojiName: data.emoji_name,
992
+ })),
993
+ }));
1058
994
  }
1059
- /** https://discord.com/developers/docs/resources/sticker#get-guild-sticker */
1060
- async getSticker(stickerId) {
995
+ /** https://discord.com/developers/docs/resources/guild#get-guild-widget */
996
+ async getWidget() {
1061
997
  return this.client.rest
1062
- .get(rest_1.Endpoints.guildSticker(this.id, stickerId))
1063
- .then((response) => new _1.Sticker(response, this.client));
998
+ .get(rest_1.Endpoints.guildWidgetJSON(this.id))
999
+ .then((response) => ({
1000
+ id: response.id,
1001
+ name: response.name,
1002
+ instantInvite: response.instant_invite,
1003
+ channels: response.channels.map((data) => new _1.Channel(data, this.client)),
1004
+ members: response.members.map((data) => new _1.User(data, this.client)),
1005
+ presenceCount: response.presence_count,
1006
+ }));
1064
1007
  }
1065
- /** https://discord.com/developers/docs/resources/sticker#create-guild-sticker */
1066
- async createSticker(options, reason) {
1067
- const formData = new undici_1.FormData();
1068
- formData.set("name", options.name);
1069
- formData.set("description", options.description);
1070
- formData.set("tags", options.tags);
1071
- formData.set("file", new undici_1.File([options.file.contents], options.file.name));
1008
+ /** https://discord.com/developers/docs/resources/guild#get-guild-widget-image */
1009
+ async getWidgetImage(options) {
1010
+ return this.client.rest.get(rest_1.Endpoints.guildWidgetImage(this.id), {
1011
+ query: {
1012
+ style: options?.style,
1013
+ },
1014
+ });
1015
+ }
1016
+ /** https://discord.com/developers/docs/resources/guild#get-guild-widget-settings */
1017
+ async getWidgetSettings() {
1072
1018
  return this.client.rest
1073
- .post(rest_1.Endpoints.guildStickers(this.id), {
1074
- form: formData,
1019
+ .get(rest_1.Endpoints.guildWidgetSettings(this.id))
1020
+ .then((response) => ({
1021
+ enabled: response.enabled,
1022
+ channelId: response.channel_id,
1023
+ }));
1024
+ }
1025
+ /** https://discord.com/developers/docs/resources/guild#remove-guild-ban */
1026
+ removeBan(userId, reason) {
1027
+ this.client.rest.delete(rest_1.Endpoints.guildBan(this.id, userId), {
1075
1028
  reason,
1076
- })
1077
- .then((response) => new _1.Sticker(response, this.client));
1029
+ });
1078
1030
  }
1079
- /** https://discord.com/developers/docs/resources/sticker#modify-guild-sticker */
1080
- async editSticker(stickerId, options, reason) {
1081
- return this.client.rest
1082
- .patch(rest_1.Endpoints.guildSticker(this.id, stickerId), {
1083
- json: {
1084
- name: options.name,
1085
- description: options.description,
1086
- tags: options.tags,
1087
- },
1031
+ /** https://discord.com/developers/docs/resources/guild#remove-guild-member */
1032
+ removeMember(userId, reason) {
1033
+ this.client.rest.delete(rest_1.Endpoints.guildMember(this.id, userId), {
1088
1034
  reason,
1089
- })
1090
- .then((response) => new _1.Sticker(response, this.client));
1035
+ });
1091
1036
  }
1092
- /** https://discord.com/developers/docs/resources/sticker#delete-guild-sticker */
1093
- deleteSticker(stickerId, reason) {
1094
- this.client.rest.delete(rest_1.Endpoints.guildSticker(this.id, stickerId), {
1037
+ /** https://discord.com/developers/docs/resources/guild#remove-guild-member-role */
1038
+ removeMemberRole(userId, roleId, reason) {
1039
+ this.client.rest.delete(rest_1.Endpoints.guildMemberRole(this.id, userId, roleId), {
1095
1040
  reason,
1096
1041
  });
1097
1042
  }
1098
- /** https://discord.com/developers/docs/resources/webhook#get-guild-webhooks */
1099
- async getWebhooks() {
1043
+ /** https://discord.com/developers/docs/resources/guild#search-guild-members */
1044
+ async searchMembers(options) {
1100
1045
  return this.client.rest
1101
- .get(rest_1.Endpoints.guildWebhooks(this.id))
1102
- .then((response) => response.map((data) => new _1.Webhook(data, this.client)));
1046
+ .get(rest_1.Endpoints.guildMembersSearch(this.id), {
1047
+ query: {
1048
+ query: options.query,
1049
+ limit: options.limit,
1050
+ },
1051
+ })
1052
+ .then((response) => response.map((data) => new _1.GuildMember(data, this.client)));
1053
+ }
1054
+ /** https://discord.com/developers/docs/resources/guild-template#sync-guild-template */
1055
+ async syncTemplate(code) {
1056
+ return new _1.GuildTemplate(await this.client.rest.put(rest_1.Endpoints.guildTemplate(this.id, code)), this.client);
1103
1057
  }
1104
1058
  toRaw() {
1105
1059
  return this.raw;
1106
1060
  }
1107
1061
  toJSON() {
1108
1062
  return {
1109
- id: this.id,
1063
+ ...super.toJSON(),
1110
1064
  name: this.name,
1111
1065
  icon: this.icon,
1112
1066
  iconHash: this.iconHash,