disgroove 1.2.7-dev.bf64d6b → 1.2.8-dev.1745fab
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/Client.d.ts +5 -1
- package/dist/Client.js +19 -12
- package/dist/Client.js.map +1 -1
- package/dist/constants.d.ts +23 -2
- package/dist/constants.js +25 -1
- package/dist/constants.js.map +1 -1
- package/dist/gateway/Shard.js +44 -1
- package/dist/gateway/Shard.js.map +1 -1
- package/dist/rest/Endpoints.d.ts +3 -0
- package/dist/rest/Endpoints.js +7 -1
- package/dist/rest/Endpoints.js.map +1 -1
- package/dist/rest/REST.d.ts +16 -5
- package/dist/rest/REST.js +10 -10
- package/dist/rest/REST.js.map +1 -1
- package/dist/rest/RequestsManager.d.ts +3 -1
- package/dist/rest/RequestsManager.js +7 -7
- package/dist/rest/RequestsManager.js.map +1 -1
- package/dist/structures/Application.d.ts +21 -1
- package/dist/structures/Application.js +76 -9
- package/dist/structures/Application.js.map +1 -1
- package/dist/structures/ApplicationCommand.js +3 -3
- package/dist/structures/ApplicationCommand.js.map +1 -1
- package/dist/structures/AutoModerationRule.js +2 -2
- package/dist/structures/AutoModerationRule.js.map +1 -1
- package/dist/structures/Channel.d.ts +1 -1
- package/dist/structures/Channel.js +43 -31
- package/dist/structures/Channel.js.map +1 -1
- package/dist/structures/Emoji.js +2 -2
- package/dist/structures/Emoji.js.map +1 -1
- package/dist/structures/Guild.d.ts +4 -3
- package/dist/structures/Guild.js +97 -70
- package/dist/structures/Guild.js.map +1 -1
- package/dist/structures/GuildMember.js +6 -6
- package/dist/structures/GuildMember.js.map +1 -1
- package/dist/structures/GuildScheduledEvent.js +7 -5
- package/dist/structures/GuildScheduledEvent.js.map +1 -1
- package/dist/structures/GuildTemplate.js +1 -1
- package/dist/structures/GuildTemplate.js.map +1 -1
- package/dist/structures/Integration.js +1 -1
- package/dist/structures/Integration.js.map +1 -1
- package/dist/structures/Interaction.js +16 -10
- package/dist/structures/Interaction.js.map +1 -1
- package/dist/structures/Invite.js +1 -1
- package/dist/structures/Invite.js.map +1 -1
- package/dist/structures/Message.js +9 -7
- package/dist/structures/Message.js.map +1 -1
- package/dist/structures/PartialApplication.d.ts +21 -1
- package/dist/structures/PartialApplication.js +76 -9
- package/dist/structures/PartialApplication.js.map +1 -1
- package/dist/structures/Role.js +2 -2
- package/dist/structures/Role.js.map +1 -1
- package/dist/structures/StageInstance.js +2 -2
- package/dist/structures/StageInstance.js.map +1 -1
- package/dist/structures/Sticker.js +2 -2
- package/dist/structures/Sticker.js.map +1 -1
- package/dist/structures/User.js +4 -4
- package/dist/structures/User.js.map +1 -1
- package/dist/structures/Webhook.js +43 -26
- package/dist/structures/Webhook.js.map +1 -1
- package/dist/types/channel.d.ts +2 -2
- package/dist/types/entitlements.d.ts +24 -0
- package/dist/types/entitlements.js +3 -0
- package/dist/types/entitlements.js.map +1 -0
- package/dist/types/gateway-events.d.ts +4 -4
- package/dist/types/guild.d.ts +8 -2
- package/dist/types/index.d.ts +9 -7
- package/dist/types/index.js +9 -7
- package/dist/types/index.js.map +1 -1
- package/dist/types/interaction.d.ts +1 -0
- package/dist/types/message-components.d.ts +11 -0
- package/dist/types/sku.d.ts +18 -0
- package/dist/types/sku.js +3 -0
- package/dist/types/sku.js.map +1 -0
- package/dist/utils/Util.d.ts +4 -2
- package/dist/utils/Util.js +1 -0
- package/dist/utils/Util.js.map +1 -1
- package/package.json +5 -5
package/dist/structures/Guild.js
CHANGED
|
@@ -184,17 +184,19 @@ class Guild extends _1.Base {
|
|
|
184
184
|
if (data.guild_scheduled_events !== undefined)
|
|
185
185
|
this.guildScheduledEvents = data.guild_scheduled_events.map((guildScheduledEvent) => new _1.GuildScheduledEvent(guildScheduledEvent, this.client));
|
|
186
186
|
}
|
|
187
|
-
/** https://discord.com/developers/docs/interactions/application-commands#
|
|
187
|
+
/** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands */
|
|
188
188
|
async getApplicationCommands(applicationId, options) {
|
|
189
189
|
return this.client.rest
|
|
190
190
|
.get(rest_1.Endpoints.applicationGuildCommands(applicationId, this.id), {
|
|
191
|
-
|
|
191
|
+
query: {
|
|
192
|
+
with_localizations: options?.withLocalizations,
|
|
193
|
+
},
|
|
192
194
|
})
|
|
193
195
|
.then((response) => response.map((data) => new _1.ApplicationCommand(data, this.client)));
|
|
194
196
|
}
|
|
195
197
|
/** https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command */
|
|
196
198
|
async createApplicationCommand(applicationId, options) {
|
|
197
|
-
return new _1.ApplicationCommand(await this.client.rest.post(rest_1.Endpoints.applicationGuildCommands(applicationId, this.id),
|
|
199
|
+
return new _1.ApplicationCommand(await this.client.rest.post(rest_1.Endpoints.applicationGuildCommands(applicationId, this.id), {
|
|
198
200
|
json: this.client.util.applicationCommandToRaw(options),
|
|
199
201
|
}), this.client);
|
|
200
202
|
}
|
|
@@ -204,7 +206,7 @@ class Guild extends _1.Base {
|
|
|
204
206
|
}
|
|
205
207
|
/** https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command */
|
|
206
208
|
async editApplicationCommand(applicationId, commandId, options) {
|
|
207
|
-
return new _1.ApplicationCommand(await this.client.rest.patch(rest_1.Endpoints.applicationGuildCommand(applicationId, this.id, commandId),
|
|
209
|
+
return new _1.ApplicationCommand(await this.client.rest.patch(rest_1.Endpoints.applicationGuildCommand(applicationId, this.id, commandId), {
|
|
208
210
|
json: this.client.util.applicationCommandToRaw(options),
|
|
209
211
|
}), this.client);
|
|
210
212
|
}
|
|
@@ -215,7 +217,7 @@ class Guild extends _1.Base {
|
|
|
215
217
|
/** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands */
|
|
216
218
|
async bulkOverwriteApplicationCommands(applicationId, commands) {
|
|
217
219
|
return this.client.rest
|
|
218
|
-
.put(rest_1.Endpoints.applicationGuildCommands(applicationId, this.id),
|
|
220
|
+
.put(rest_1.Endpoints.applicationGuildCommands(applicationId, this.id), {
|
|
219
221
|
json: commands.map((command) => this.client.util.applicationCommandToRaw(command)),
|
|
220
222
|
})
|
|
221
223
|
.then((response) => response.map((data) => new _1.ApplicationCommand(data, this.client)));
|
|
@@ -254,11 +256,13 @@ class Guild extends _1.Base {
|
|
|
254
256
|
async getAuditLog(options) {
|
|
255
257
|
return this.client.rest
|
|
256
258
|
.get(rest_1.Endpoints.guildAuditLog(this.id), {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
259
|
+
query: {
|
|
260
|
+
user_id: options?.userId,
|
|
261
|
+
action_type: options?.actionType,
|
|
262
|
+
before: options?.before,
|
|
263
|
+
after: options?.after,
|
|
264
|
+
limit: options?.limit,
|
|
265
|
+
},
|
|
262
266
|
})
|
|
263
267
|
.then((response) => ({
|
|
264
268
|
applicationCommands: response.application_commands.map((applicationCommand) => new _1.ApplicationCommand(applicationCommand, this.client)),
|
|
@@ -309,7 +313,7 @@ class Guild extends _1.Base {
|
|
|
309
313
|
}
|
|
310
314
|
/** https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule */
|
|
311
315
|
async createAutoModerationRule(options, reason) {
|
|
312
|
-
return new _1.AutoModerationRule(await this.client.rest.post(rest_1.Endpoints.guildAutoModerationRules(this.id),
|
|
316
|
+
return new _1.AutoModerationRule(await this.client.rest.post(rest_1.Endpoints.guildAutoModerationRules(this.id), {
|
|
313
317
|
json: {
|
|
314
318
|
name: options.name,
|
|
315
319
|
event_type: options.eventType,
|
|
@@ -332,7 +336,7 @@ class Guild extends _1.Base {
|
|
|
332
336
|
}
|
|
333
337
|
/** https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule */
|
|
334
338
|
async editAutoModerationRule(ruleId, options, reason) {
|
|
335
|
-
return new _1.AutoModerationRule(await this.client.rest.patch(rest_1.Endpoints.guildAutoModerationRule(this.id, ruleId),
|
|
339
|
+
return new _1.AutoModerationRule(await this.client.rest.patch(rest_1.Endpoints.guildAutoModerationRule(this.id, ruleId), {
|
|
336
340
|
json: {
|
|
337
341
|
name: options.name,
|
|
338
342
|
event_type: options.eventType,
|
|
@@ -355,7 +359,7 @@ class Guild extends _1.Base {
|
|
|
355
359
|
}
|
|
356
360
|
/** https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule */
|
|
357
361
|
deleteAutoModerationRule(ruleId, reason) {
|
|
358
|
-
this.client.rest.delete(rest_1.Endpoints.guildAutoModerationRule(this.id, ruleId),
|
|
362
|
+
this.client.rest.delete(rest_1.Endpoints.guildAutoModerationRule(this.id, ruleId), {
|
|
359
363
|
reason,
|
|
360
364
|
});
|
|
361
365
|
}
|
|
@@ -371,7 +375,7 @@ class Guild extends _1.Base {
|
|
|
371
375
|
}
|
|
372
376
|
/** https://discord.com/developers/docs/resources/emoji#create-guild-emoji */
|
|
373
377
|
async createEmoji(options, reason) {
|
|
374
|
-
return new _1.Emoji(await this.client.rest.post(rest_1.Endpoints.guildEmojis(this.id),
|
|
378
|
+
return new _1.Emoji(await this.client.rest.post(rest_1.Endpoints.guildEmojis(this.id), {
|
|
375
379
|
json: {
|
|
376
380
|
name: options.name,
|
|
377
381
|
image: options.image,
|
|
@@ -382,7 +386,7 @@ class Guild extends _1.Base {
|
|
|
382
386
|
}
|
|
383
387
|
/** https://discord.com/developers/docs/resources/emoji#modify-guild-emoji */
|
|
384
388
|
async editEmoji(emojiId, options, reason) {
|
|
385
|
-
return new _1.Emoji(await this.client.rest.patch(rest_1.Endpoints.guildEmoji(this.id, emojiId),
|
|
389
|
+
return new _1.Emoji(await this.client.rest.patch(rest_1.Endpoints.guildEmoji(this.id, emojiId), {
|
|
386
390
|
json: {
|
|
387
391
|
name: options.name,
|
|
388
392
|
roles: options.roles,
|
|
@@ -392,7 +396,7 @@ class Guild extends _1.Base {
|
|
|
392
396
|
}
|
|
393
397
|
/** https://discord.com/developers/docs/resources/emoji#delete-guild-emoji */
|
|
394
398
|
deleteEmoji(emojiId, reason) {
|
|
395
|
-
this.client.rest.delete(rest_1.Endpoints.guildEmoji(this.id, emojiId),
|
|
399
|
+
this.client.rest.delete(rest_1.Endpoints.guildEmoji(this.id, emojiId), {
|
|
396
400
|
reason,
|
|
397
401
|
});
|
|
398
402
|
}
|
|
@@ -431,7 +435,7 @@ class Guild extends _1.Base {
|
|
|
431
435
|
}
|
|
432
436
|
/** https://discord.com/developers/docs/resources/guild#modify-guild */
|
|
433
437
|
async edit(options, reason) {
|
|
434
|
-
return new Guild(await this.client.rest.patch(rest_1.Endpoints.guild(this.id),
|
|
438
|
+
return new Guild(await this.client.rest.patch(rest_1.Endpoints.guild(this.id), {
|
|
435
439
|
json: {
|
|
436
440
|
name: options.name,
|
|
437
441
|
region: options.region,
|
|
@@ -470,7 +474,7 @@ class Guild extends _1.Base {
|
|
|
470
474
|
}
|
|
471
475
|
/** https://discord.com/developers/docs/resources/guild#create-guild-channel */
|
|
472
476
|
async createChannel(options, reason) {
|
|
473
|
-
return new _1.Channel(await this.client.rest.post(rest_1.Endpoints.guildChannels(this.id),
|
|
477
|
+
return new _1.Channel(await this.client.rest.post(rest_1.Endpoints.guildChannels(this.id), {
|
|
474
478
|
json: {
|
|
475
479
|
name: options.name,
|
|
476
480
|
type: options.type,
|
|
@@ -492,13 +496,14 @@ class Guild extends _1.Base {
|
|
|
492
496
|
available_tags: options.availableTags,
|
|
493
497
|
default_sort_order: options.defaultSortOrder,
|
|
494
498
|
default_forum_layout: options.defaultForumLayout,
|
|
499
|
+
default_thread_rate_limit_per_user: options.defaultThreadRateLimitPerUser,
|
|
495
500
|
},
|
|
496
501
|
reason,
|
|
497
502
|
}), this.client);
|
|
498
503
|
}
|
|
499
504
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions */
|
|
500
505
|
editChannelPositions(options) {
|
|
501
|
-
this.client.rest.patch(rest_1.Endpoints.guildChannels(this.id),
|
|
506
|
+
this.client.rest.patch(rest_1.Endpoints.guildChannels(this.id), {
|
|
502
507
|
json: options.map((data) => ({
|
|
503
508
|
id: data.id,
|
|
504
509
|
position: data.position,
|
|
@@ -538,15 +543,17 @@ class Guild extends _1.Base {
|
|
|
538
543
|
async searchMembers(options) {
|
|
539
544
|
return this.client.rest
|
|
540
545
|
.get(rest_1.Endpoints.guildMembersSearch(this.id), {
|
|
541
|
-
query:
|
|
542
|
-
|
|
546
|
+
query: {
|
|
547
|
+
query: options.query,
|
|
548
|
+
limit: options.limit,
|
|
549
|
+
},
|
|
543
550
|
})
|
|
544
551
|
.then((response) => response.map((data) => new _1.GuildMember(data, this.client)));
|
|
545
552
|
}
|
|
546
553
|
/** https://discord.com/developers/docs/resources/guild#add-guild-member */
|
|
547
554
|
async addMember(userId, options) {
|
|
548
555
|
return this.client.rest
|
|
549
|
-
.put(rest_1.Endpoints.guildMember(this.id, userId),
|
|
556
|
+
.put(rest_1.Endpoints.guildMember(this.id, userId), {
|
|
550
557
|
json: {
|
|
551
558
|
access_token: options.accessToken,
|
|
552
559
|
nick: options.nick,
|
|
@@ -566,7 +573,7 @@ class Guild extends _1.Base {
|
|
|
566
573
|
}
|
|
567
574
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-member */
|
|
568
575
|
async editMember(userId, options, reason) {
|
|
569
|
-
return new _1.GuildMember(await this.client.rest.patch(rest_1.Endpoints.guildMember(this.id, userId),
|
|
576
|
+
return new _1.GuildMember(await this.client.rest.patch(rest_1.Endpoints.guildMember(this.id, userId), {
|
|
570
577
|
json: {
|
|
571
578
|
nick: options.nick,
|
|
572
579
|
roles: options.roles,
|
|
@@ -581,7 +588,7 @@ class Guild extends _1.Base {
|
|
|
581
588
|
}
|
|
582
589
|
/** https://discord.com/developers/docs/resources/guild#modify-current-member */
|
|
583
590
|
async editCurrentMember(options, reason) {
|
|
584
|
-
return new _1.GuildMember(await this.client.rest.patch(rest_1.Endpoints.guildMember(this.id),
|
|
591
|
+
return new _1.GuildMember(await this.client.rest.patch(rest_1.Endpoints.guildMember(this.id), {
|
|
585
592
|
json: {
|
|
586
593
|
nick: options.nick,
|
|
587
594
|
},
|
|
@@ -590,19 +597,19 @@ class Guild extends _1.Base {
|
|
|
590
597
|
}
|
|
591
598
|
/** https://discord.com/developers/docs/resources/guild#add-guild-member-role */
|
|
592
599
|
addMemberRole(userId, roleId, reason) {
|
|
593
|
-
this.client.rest.put(rest_1.Endpoints.guildMemberRole(this.id, userId, roleId),
|
|
600
|
+
this.client.rest.put(rest_1.Endpoints.guildMemberRole(this.id, userId, roleId), {
|
|
594
601
|
reason,
|
|
595
602
|
});
|
|
596
603
|
}
|
|
597
604
|
/** https://discord.com/developers/docs/resources/guild#remove-guild-member-role */
|
|
598
605
|
removeMemberRole(userId, roleId, reason) {
|
|
599
|
-
this.client.rest.delete(rest_1.Endpoints.guildMemberRole(this.id, userId, roleId),
|
|
606
|
+
this.client.rest.delete(rest_1.Endpoints.guildMemberRole(this.id, userId, roleId), {
|
|
600
607
|
reason,
|
|
601
608
|
});
|
|
602
609
|
}
|
|
603
610
|
/** https://discord.com/developers/docs/resources/guild#remove-guild-member-role */
|
|
604
611
|
removeMember(userId, reason) {
|
|
605
|
-
this.client.rest.delete(rest_1.Endpoints.guildMember(this.id, userId),
|
|
612
|
+
this.client.rest.delete(rest_1.Endpoints.guildMember(this.id, userId), {
|
|
606
613
|
reason,
|
|
607
614
|
});
|
|
608
615
|
}
|
|
@@ -610,9 +617,11 @@ class Guild extends _1.Base {
|
|
|
610
617
|
async getBans(options) {
|
|
611
618
|
return this.client.rest
|
|
612
619
|
.get(rest_1.Endpoints.guildBans(this.id), {
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
620
|
+
query: {
|
|
621
|
+
limit: options?.limit,
|
|
622
|
+
before: options?.before,
|
|
623
|
+
after: options?.after,
|
|
624
|
+
},
|
|
616
625
|
})
|
|
617
626
|
.then((response) => response.map((data) => ({
|
|
618
627
|
reason: data.reason,
|
|
@@ -630,7 +639,7 @@ class Guild extends _1.Base {
|
|
|
630
639
|
}
|
|
631
640
|
/** https://discord.com/developers/docs/resources/guild#create-guild-ban */
|
|
632
641
|
createBan(userId, options, reason) {
|
|
633
|
-
this.client.rest.put(rest_1.Endpoints.guildBan(this.id, userId),
|
|
642
|
+
this.client.rest.put(rest_1.Endpoints.guildBan(this.id, userId), {
|
|
634
643
|
json: {
|
|
635
644
|
delete_message_days: options?.deleteMessageDays,
|
|
636
645
|
delete_message_seconds: options?.deleteMessageSeconds,
|
|
@@ -640,7 +649,7 @@ class Guild extends _1.Base {
|
|
|
640
649
|
}
|
|
641
650
|
/** https://discord.com/developers/docs/resources/guild#remove-guild-ban */
|
|
642
651
|
removeBan(userId, reason) {
|
|
643
|
-
this.client.rest.delete(rest_1.Endpoints.guildBan(this.id, userId),
|
|
652
|
+
this.client.rest.delete(rest_1.Endpoints.guildBan(this.id, userId), {
|
|
644
653
|
reason,
|
|
645
654
|
});
|
|
646
655
|
}
|
|
@@ -652,7 +661,7 @@ class Guild extends _1.Base {
|
|
|
652
661
|
}
|
|
653
662
|
/** https://discord.com/developers/docs/resources/guild#create-guild-role */
|
|
654
663
|
async createRole(options, reason) {
|
|
655
|
-
return new _1.Role(await this.client.rest.post(rest_1.Endpoints.guildRoles(this.id),
|
|
664
|
+
return new _1.Role(await this.client.rest.post(rest_1.Endpoints.guildRoles(this.id), {
|
|
656
665
|
json: {
|
|
657
666
|
name: options.name,
|
|
658
667
|
permissions: options.permissions,
|
|
@@ -668,7 +677,7 @@ class Guild extends _1.Base {
|
|
|
668
677
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-role-positions */
|
|
669
678
|
async editRolePositions(options) {
|
|
670
679
|
return this.client.rest
|
|
671
|
-
.patch(rest_1.Endpoints.guildRoles(this.id),
|
|
680
|
+
.patch(rest_1.Endpoints.guildRoles(this.id), {
|
|
672
681
|
json: options.map((data) => ({
|
|
673
682
|
id: data.id,
|
|
674
683
|
position: data.position,
|
|
@@ -678,7 +687,7 @@ class Guild extends _1.Base {
|
|
|
678
687
|
}
|
|
679
688
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-role */
|
|
680
689
|
async editRole(roleId, options, reason) {
|
|
681
|
-
return new _1.Role(await this.client.rest.patch(rest_1.Endpoints.guildRole(this.id, roleId),
|
|
690
|
+
return new _1.Role(await this.client.rest.patch(rest_1.Endpoints.guildRole(this.id, roleId), {
|
|
682
691
|
json: {
|
|
683
692
|
name: options?.name,
|
|
684
693
|
permissions: options?.permissions,
|
|
@@ -693,7 +702,7 @@ class Guild extends _1.Base {
|
|
|
693
702
|
}
|
|
694
703
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-mfa-level */
|
|
695
704
|
async editMFALevel(options, reason) {
|
|
696
|
-
return this.client.rest.post(rest_1.Endpoints.guildMFA(this.id),
|
|
705
|
+
return this.client.rest.post(rest_1.Endpoints.guildMFA(this.id), {
|
|
697
706
|
json: {
|
|
698
707
|
level: options.level,
|
|
699
708
|
},
|
|
@@ -702,20 +711,22 @@ class Guild extends _1.Base {
|
|
|
702
711
|
}
|
|
703
712
|
/** https://discord.com/developers/docs/resources/guild#delete-guild-role */
|
|
704
713
|
deleteRole(roleId, reason) {
|
|
705
|
-
this.client.rest.delete(rest_1.Endpoints.guildRole(this.id, roleId),
|
|
714
|
+
this.client.rest.delete(rest_1.Endpoints.guildRole(this.id, roleId), {
|
|
706
715
|
reason,
|
|
707
716
|
});
|
|
708
717
|
}
|
|
709
718
|
/** https://discord.com/developers/docs/resources/guild#get-guild-prune-count */
|
|
710
719
|
async getPruneCount(options) {
|
|
711
720
|
return this.client.rest.get(rest_1.Endpoints.guildPrune(this.id), {
|
|
712
|
-
|
|
713
|
-
|
|
721
|
+
query: {
|
|
722
|
+
days: options.days,
|
|
723
|
+
include_roles: options.includeRoles,
|
|
724
|
+
},
|
|
714
725
|
});
|
|
715
726
|
}
|
|
716
727
|
/** https://discord.com/developers/docs/resources/guild#begin-guild-prune */
|
|
717
728
|
async beginGuildPrune(options, reason) {
|
|
718
|
-
return this.client.rest.post(rest_1.Endpoints.guildPrune(this.id),
|
|
729
|
+
return this.client.rest.post(rest_1.Endpoints.guildPrune(this.id), {
|
|
719
730
|
json: {
|
|
720
731
|
days: options.days,
|
|
721
732
|
compute_prune_count: options.computePruneCount,
|
|
@@ -751,7 +762,7 @@ class Guild extends _1.Base {
|
|
|
751
762
|
}
|
|
752
763
|
/** https://discord.com/developers/docs/resources/guild#delete-guild-integration */
|
|
753
764
|
deleteIntegration(integrationId, reason) {
|
|
754
|
-
this.client.rest.delete(rest_1.Endpoints.guildIntegration(this.id, integrationId),
|
|
765
|
+
this.client.rest.delete(rest_1.Endpoints.guildIntegration(this.id, integrationId), {
|
|
755
766
|
reason,
|
|
756
767
|
});
|
|
757
768
|
}
|
|
@@ -767,7 +778,7 @@ class Guild extends _1.Base {
|
|
|
767
778
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-widget */
|
|
768
779
|
async editWidget(options, reason) {
|
|
769
780
|
return this.client.rest
|
|
770
|
-
.patch(rest_1.Endpoints.guildWidgetSettings(this.id),
|
|
781
|
+
.patch(rest_1.Endpoints.guildWidgetSettings(this.id), {
|
|
771
782
|
json: {
|
|
772
783
|
enabled: options.enabled,
|
|
773
784
|
channel_id: options.channelId,
|
|
@@ -799,7 +810,9 @@ class Guild extends _1.Base {
|
|
|
799
810
|
/** https://discord.com/developers/docs/resources/guild#get-guild-widget-image */
|
|
800
811
|
async getWidgetImage(options) {
|
|
801
812
|
return this.client.rest.get(rest_1.Endpoints.guildWidgetImage(this.id), {
|
|
802
|
-
|
|
813
|
+
query: {
|
|
814
|
+
style: options?.style,
|
|
815
|
+
},
|
|
803
816
|
});
|
|
804
817
|
}
|
|
805
818
|
/** https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen */
|
|
@@ -819,7 +832,7 @@ class Guild extends _1.Base {
|
|
|
819
832
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen */
|
|
820
833
|
async editWelcomeScreen(options, reason) {
|
|
821
834
|
return this.client.rest
|
|
822
|
-
.patch(rest_1.Endpoints.guildWelcomeScreen(this.id),
|
|
835
|
+
.patch(rest_1.Endpoints.guildWelcomeScreen(this.id), {
|
|
823
836
|
json: {
|
|
824
837
|
enabled: options.enabled,
|
|
825
838
|
welcome_channels: options.welcomeChannels,
|
|
@@ -850,7 +863,12 @@ class Guild extends _1.Base {
|
|
|
850
863
|
id: option.id,
|
|
851
864
|
channelIds: option.channel_ids,
|
|
852
865
|
roleIds: option.role_ids,
|
|
853
|
-
emoji:
|
|
866
|
+
emoji: option.emoji !== undefined
|
|
867
|
+
? new _1.Emoji(option.emoji, this.client)
|
|
868
|
+
: undefined,
|
|
869
|
+
emojiId: option.emoji_id,
|
|
870
|
+
emojiName: option.emoji_name,
|
|
871
|
+
emojiAnimated: option.emoji_animated,
|
|
854
872
|
title: option.title,
|
|
855
873
|
description: option.description,
|
|
856
874
|
})),
|
|
@@ -866,7 +884,7 @@ class Guild extends _1.Base {
|
|
|
866
884
|
}
|
|
867
885
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-onboarding */
|
|
868
886
|
editOnboarding(options, reason) {
|
|
869
|
-
this.client.rest.patch(rest_1.Endpoints.guildOnboarding(this.id),
|
|
887
|
+
this.client.rest.patch(rest_1.Endpoints.guildOnboarding(this.id), {
|
|
870
888
|
json: {
|
|
871
889
|
prompts: options.prompts.map((prompt) => ({
|
|
872
890
|
id: prompt.id,
|
|
@@ -875,16 +893,21 @@ class Guild extends _1.Base {
|
|
|
875
893
|
id: option.id,
|
|
876
894
|
channel_ids: option.channelIds,
|
|
877
895
|
role_ids: option.roleIds,
|
|
878
|
-
emoji:
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
896
|
+
emoji: option.emoji !== undefined
|
|
897
|
+
? {
|
|
898
|
+
id: option.emoji.id,
|
|
899
|
+
name: option.emoji.name,
|
|
900
|
+
roles: option.emoji.roles,
|
|
901
|
+
user: option.emoji.user,
|
|
902
|
+
require_colons: option.emoji.requireColons,
|
|
903
|
+
managed: option.emoji.managed,
|
|
904
|
+
animated: option.emoji.animated,
|
|
905
|
+
available: option.emoji.available,
|
|
906
|
+
}
|
|
907
|
+
: undefined,
|
|
908
|
+
emoji_id: option.emojiId,
|
|
909
|
+
emoji_name: option.emojiName,
|
|
910
|
+
emoji_animated: option.emojiAnimated,
|
|
888
911
|
title: option.title,
|
|
889
912
|
description: option.description,
|
|
890
913
|
})),
|
|
@@ -899,7 +922,7 @@ class Guild extends _1.Base {
|
|
|
899
922
|
}
|
|
900
923
|
/** https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state */
|
|
901
924
|
editCurrentUserVoiceState(options) {
|
|
902
|
-
this.client.rest.patch(rest_1.Endpoints.guildVoiceState(this.id),
|
|
925
|
+
this.client.rest.patch(rest_1.Endpoints.guildVoiceState(this.id), {
|
|
903
926
|
json: {
|
|
904
927
|
channel_id: options.channelId,
|
|
905
928
|
suppress: options.suppress,
|
|
@@ -909,7 +932,7 @@ class Guild extends _1.Base {
|
|
|
909
932
|
}
|
|
910
933
|
/** https://discord.com/developers/docs/resources/guild#modify-user-voice-state */
|
|
911
934
|
editUserVoiceState(userId, options) {
|
|
912
|
-
this.client.rest.patch(rest_1.Endpoints.guildVoiceState(this.id, userId),
|
|
935
|
+
this.client.rest.patch(rest_1.Endpoints.guildVoiceState(this.id, userId), {
|
|
913
936
|
json: {
|
|
914
937
|
channel_id: options.channelId,
|
|
915
938
|
suppress: options.suppress,
|
|
@@ -921,13 +944,15 @@ class Guild extends _1.Base {
|
|
|
921
944
|
async getScheduledEvents(options) {
|
|
922
945
|
return this.client.rest
|
|
923
946
|
.get(rest_1.Endpoints.guildScheduledEvents(this.id), {
|
|
924
|
-
|
|
947
|
+
query: {
|
|
948
|
+
with_user_count: options?.withUserCount,
|
|
949
|
+
},
|
|
925
950
|
})
|
|
926
951
|
.then((response) => response.map((data) => new _1.GuildScheduledEvent(data, this.client)));
|
|
927
952
|
}
|
|
928
953
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event */
|
|
929
954
|
async createScheduledEvent(options, reason) {
|
|
930
|
-
return new _1.GuildScheduledEvent(await this.client.rest.post(rest_1.Endpoints.guildScheduledEvents(this.id),
|
|
955
|
+
return new _1.GuildScheduledEvent(await this.client.rest.post(rest_1.Endpoints.guildScheduledEvents(this.id), {
|
|
931
956
|
json: {
|
|
932
957
|
channel_id: options.channelId,
|
|
933
958
|
entity_metadata: options.entityMetadata,
|
|
@@ -944,7 +969,7 @@ class Guild extends _1.Base {
|
|
|
944
969
|
}
|
|
945
970
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event */
|
|
946
971
|
async editScheduledEvent(scheduledEventId, options, reason) {
|
|
947
|
-
return new _1.GuildScheduledEvent(await this.client.rest.patch(rest_1.Endpoints.guildScheduledEvent(this.id, scheduledEventId),
|
|
972
|
+
return new _1.GuildScheduledEvent(await this.client.rest.patch(rest_1.Endpoints.guildScheduledEvent(this.id, scheduledEventId), {
|
|
948
973
|
json: {
|
|
949
974
|
channel_id: options.channelId,
|
|
950
975
|
entity_metadata: options.entityMetadata,
|
|
@@ -968,10 +993,12 @@ class Guild extends _1.Base {
|
|
|
968
993
|
async getScheduledEventUsers(scheduledEventId, options) {
|
|
969
994
|
return this.client.rest
|
|
970
995
|
.get(rest_1.Endpoints.guildScheduledEvent(this.id, scheduledEventId), {
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
996
|
+
query: {
|
|
997
|
+
limit: options?.limit,
|
|
998
|
+
with_member: options?.withMember,
|
|
999
|
+
before: options?.before,
|
|
1000
|
+
after: options?.after,
|
|
1001
|
+
},
|
|
975
1002
|
})
|
|
976
1003
|
.then((response) => response.map((data) => ({
|
|
977
1004
|
guildScheduledEventId: data.guild_scheduled_event_id,
|
|
@@ -993,7 +1020,7 @@ class Guild extends _1.Base {
|
|
|
993
1020
|
}
|
|
994
1021
|
/** https://discord.com/developers/docs/resources/guild-template#create-guild-template */
|
|
995
1022
|
async createTemplate(options) {
|
|
996
|
-
return new _1.GuildTemplate(await this.client.rest.post(rest_1.Endpoints.guildTemplates(this.id),
|
|
1023
|
+
return new _1.GuildTemplate(await this.client.rest.post(rest_1.Endpoints.guildTemplates(this.id), {
|
|
997
1024
|
json: {
|
|
998
1025
|
name: options.name,
|
|
999
1026
|
description: options.description,
|
|
@@ -1006,7 +1033,7 @@ class Guild extends _1.Base {
|
|
|
1006
1033
|
}
|
|
1007
1034
|
/** https://discord.com/developers/docs/resources/guild-template#modify-guild-template */
|
|
1008
1035
|
async editTemplate(code, options) {
|
|
1009
|
-
return new _1.GuildTemplate(await this.client.rest.patch(rest_1.Endpoints.guildTemplate(this.id, code),
|
|
1036
|
+
return new _1.GuildTemplate(await this.client.rest.patch(rest_1.Endpoints.guildTemplate(this.id, code), {
|
|
1010
1037
|
json: {
|
|
1011
1038
|
name: options.name,
|
|
1012
1039
|
description: options.description,
|
|
@@ -1039,7 +1066,7 @@ class Guild extends _1.Base {
|
|
|
1039
1066
|
formData.set("tags", options.tags);
|
|
1040
1067
|
formData.set("file", new undici_1.File([options.file.contents], options.file.name));
|
|
1041
1068
|
return this.client.rest
|
|
1042
|
-
.post(rest_1.Endpoints.guildStickers(this.id),
|
|
1069
|
+
.post(rest_1.Endpoints.guildStickers(this.id), {
|
|
1043
1070
|
form: formData,
|
|
1044
1071
|
reason,
|
|
1045
1072
|
})
|
|
@@ -1048,7 +1075,7 @@ class Guild extends _1.Base {
|
|
|
1048
1075
|
/** https://discord.com/developers/docs/resources/sticker#modify-guild-sticker */
|
|
1049
1076
|
async editSticker(stickerId, options, reason) {
|
|
1050
1077
|
return this.client.rest
|
|
1051
|
-
.patch(rest_1.Endpoints.guildSticker(this.id, stickerId),
|
|
1078
|
+
.patch(rest_1.Endpoints.guildSticker(this.id, stickerId), {
|
|
1052
1079
|
json: {
|
|
1053
1080
|
name: options.name,
|
|
1054
1081
|
description: options.description,
|
|
@@ -1060,7 +1087,7 @@ class Guild extends _1.Base {
|
|
|
1060
1087
|
}
|
|
1061
1088
|
/** https://discord.com/developers/docs/resources/sticker#delete-guild-sticker */
|
|
1062
1089
|
deleteSticker(stickerId, reason) {
|
|
1063
|
-
this.client.rest.delete(rest_1.Endpoints.guildSticker(this.id, stickerId),
|
|
1090
|
+
this.client.rest.delete(rest_1.Endpoints.guildSticker(this.id, stickerId), {
|
|
1064
1091
|
reason,
|
|
1065
1092
|
});
|
|
1066
1093
|
}
|