disgroove 1.1.1-dev → 1.1.1-dev.1
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 +62 -64
- package/dist/Client.js +17 -8
- package/dist/Client.js.map +1 -1
- package/dist/rest/REST.d.ts +10 -10
- package/dist/rest/REST.js.map +1 -1
- package/dist/rest/RequestsManager.d.ts +2 -2
- package/dist/rest/RequestsManager.js +5 -7
- package/dist/rest/RequestsManager.js.map +1 -1
- package/dist/structures/Application.d.ts +4 -4
- package/dist/structures/Application.js +10 -10
- package/dist/structures/Application.js.map +1 -1
- package/dist/structures/ApplicationCommand.d.ts +4 -4
- package/dist/structures/ApplicationCommand.js +16 -25
- package/dist/structures/ApplicationCommand.js.map +1 -1
- package/dist/structures/AutoModerationRule.d.ts +1 -1
- package/dist/structures/AutoModerationRule.js +2 -2
- package/dist/structures/AutoModerationRule.js.map +1 -1
- package/dist/structures/Base.js.map +1 -1
- package/dist/structures/Channel.d.ts +20 -20
- package/dist/structures/Channel.js +92 -77
- package/dist/structures/Channel.js.map +1 -1
- package/dist/structures/Guild.d.ts +24 -24
- package/dist/structures/Guild.js +186 -167
- package/dist/structures/Guild.js.map +1 -1
- package/dist/structures/GuildMember.d.ts +6 -6
- package/dist/structures/GuildMember.js +6 -6
- package/dist/structures/GuildMember.js.map +1 -1
- package/dist/structures/GuildScheduledEvent.d.ts +3 -3
- package/dist/structures/GuildScheduledEvent.js +1 -1
- package/dist/structures/GuildScheduledEvent.js.map +1 -1
- package/dist/structures/GuildTemplate.js +15 -14
- package/dist/structures/GuildTemplate.js.map +1 -1
- package/dist/structures/Integration.d.ts +1 -1
- package/dist/structures/Integration.js +1 -1
- package/dist/structures/Integration.js.map +1 -1
- package/dist/structures/Interaction.d.ts +4 -4
- package/dist/structures/Interaction.js +8 -8
- package/dist/structures/Interaction.js.map +1 -1
- package/dist/structures/Invite.js +26 -25
- package/dist/structures/Invite.js.map +1 -1
- package/dist/structures/Message.d.ts +6 -6
- package/dist/structures/Message.js +8 -8
- package/dist/structures/Message.js.map +1 -1
- package/dist/structures/Role.js.map +1 -1
- package/dist/structures/StageInstance.d.ts +1 -1
- package/dist/structures/StageInstance.js +1 -1
- package/dist/structures/StageInstance.js.map +1 -1
- package/dist/structures/User.d.ts +1 -1
- package/dist/structures/User.js +29 -25
- package/dist/structures/User.js.map +1 -1
- package/dist/structures/Webhook.d.ts +3 -3
- package/dist/structures/Webhook.js +3 -3
- package/dist/structures/Webhook.js.map +1 -1
- package/package.json +1 -1
package/dist/structures/Guild.js
CHANGED
|
@@ -239,8 +239,8 @@ class Guild extends _1.Base {
|
|
|
239
239
|
}), this.client);
|
|
240
240
|
}
|
|
241
241
|
/** https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command */
|
|
242
|
-
|
|
243
|
-
this.client.rest.
|
|
242
|
+
deleteApplicationCommand(applicationId, commandId) {
|
|
243
|
+
this.client.rest.delete(rest_1.Endpoints.applicationGuildCommand(applicationId, this.id, commandId));
|
|
244
244
|
}
|
|
245
245
|
/** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands */
|
|
246
246
|
async bulkOverwriteGuildApplicationCommands(applicationId, options) {
|
|
@@ -277,16 +277,16 @@ class Guild extends _1.Base {
|
|
|
277
277
|
limit: options?.limit,
|
|
278
278
|
},
|
|
279
279
|
})
|
|
280
|
-
.then((response) =>
|
|
281
|
-
applicationCommands:
|
|
282
|
-
auditLogEntries:
|
|
283
|
-
autoModerationRules:
|
|
284
|
-
guildScheduledEvents:
|
|
285
|
-
integrations:
|
|
286
|
-
threads:
|
|
287
|
-
users:
|
|
288
|
-
webhooks:
|
|
289
|
-
}))
|
|
280
|
+
.then((response) => ({
|
|
281
|
+
applicationCommands: response.application_commands.map((applicationCommand) => new _1.ApplicationCommand(applicationCommand, this.client)),
|
|
282
|
+
auditLogEntries: response.audit_log_entries.map((auditLogEntry) => (0, utils_1.auditLogEntryToJSON)(auditLogEntry)),
|
|
283
|
+
autoModerationRules: response.auto_moderation_rules.map((autoModerationRule) => new _1.AutoModerationRule(autoModerationRule, this.client)),
|
|
284
|
+
guildScheduledEvents: response.guild_scheduled_events.map((guildScheduledEvent) => new _1.GuildScheduledEvent(guildScheduledEvent, this.client)),
|
|
285
|
+
integrations: response.integrations.map((integration) => new _1.Integration(integration, this.client)),
|
|
286
|
+
threads: response.threads.map((thread) => new _1.Channel(thread, this.client)),
|
|
287
|
+
users: response.users.map((user) => new _1.User(user, this.client)),
|
|
288
|
+
webhooks: response.webhooks.map((webhook) => new _1.Webhook(webhook, this.client)),
|
|
289
|
+
}));
|
|
290
290
|
}
|
|
291
291
|
/** https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild */
|
|
292
292
|
async listAutoModerationRules() {
|
|
@@ -345,8 +345,8 @@ class Guild extends _1.Base {
|
|
|
345
345
|
}), this.client);
|
|
346
346
|
}
|
|
347
347
|
/** https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule */
|
|
348
|
-
|
|
349
|
-
this.client.rest.
|
|
348
|
+
deleteAutoModerationRule(ruleId, reason) {
|
|
349
|
+
this.client.rest.delete(rest_1.Endpoints.guildAutoModerationRule(this.id, ruleId), {
|
|
350
350
|
reason,
|
|
351
351
|
});
|
|
352
352
|
}
|
|
@@ -382,26 +382,27 @@ class Guild extends _1.Base {
|
|
|
382
382
|
}), this.client);
|
|
383
383
|
}
|
|
384
384
|
/** https://discord.com/developers/docs/resources/emoji#delete-guild-emoji */
|
|
385
|
-
|
|
386
|
-
this.client.rest.
|
|
385
|
+
deleteEmoji(emojiId, reason) {
|
|
386
|
+
this.client.rest.delete(rest_1.Endpoints.guildEmoji(this.id, emojiId), {
|
|
387
387
|
reason,
|
|
388
388
|
});
|
|
389
389
|
}
|
|
390
390
|
/** https://discord.com/developers/docs/resources/guild#get-guild-preview */
|
|
391
391
|
async getPreview() {
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
392
|
+
return this.client.rest
|
|
393
|
+
.get(rest_1.Endpoints.guildPreview(this.id))
|
|
394
|
+
.then((response) => ({
|
|
395
|
+
id: response.id,
|
|
396
|
+
name: response.name,
|
|
397
|
+
icon: response.icon,
|
|
398
|
+
splash: response.splash,
|
|
399
|
+
discoverySplash: response.discovery_splash,
|
|
400
|
+
emojis: response.emojis.map((emoji) => (0, utils_1.emojiToJSON)(emoji, this.client)),
|
|
401
|
+
features: response.features,
|
|
402
|
+
approximateMemberCount: response.approximate_member_count,
|
|
403
|
+
approximatePresenceCount: response.approximate_presence_count,
|
|
404
|
+
description: response.description,
|
|
405
|
+
stickers: response.stickers?.map((sticker) => ({
|
|
405
406
|
id: sticker.id,
|
|
406
407
|
packId: sticker.pack_id,
|
|
407
408
|
name: sticker.name,
|
|
@@ -417,7 +418,7 @@ class Guild extends _1.Base {
|
|
|
417
418
|
: undefined,
|
|
418
419
|
sortValue: sticker.sort_value,
|
|
419
420
|
})),
|
|
420
|
-
};
|
|
421
|
+
}));
|
|
421
422
|
}
|
|
422
423
|
/** https://discord.com/developers/docs/resources/guild#modify-guild */
|
|
423
424
|
async modify(options, reason) {
|
|
@@ -449,8 +450,8 @@ class Guild extends _1.Base {
|
|
|
449
450
|
}), this.client);
|
|
450
451
|
}
|
|
451
452
|
/** https://discord.com/developers/docs/resources/guild#delete-guild */
|
|
452
|
-
|
|
453
|
-
this.client.rest.
|
|
453
|
+
delete() {
|
|
454
|
+
this.client.rest.delete(rest_1.Endpoints.guild(this.id));
|
|
454
455
|
}
|
|
455
456
|
/** https://discord.com/developers/docs/resources/guild#get-guild-channels */
|
|
456
457
|
async getChannels() {
|
|
@@ -487,7 +488,7 @@ class Guild extends _1.Base {
|
|
|
487
488
|
}), this.client);
|
|
488
489
|
}
|
|
489
490
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions */
|
|
490
|
-
|
|
491
|
+
modifyChannelPositions(options) {
|
|
491
492
|
this.client.rest.patch(rest_1.Endpoints.guildChannels(this.id), {
|
|
492
493
|
json: options.map((data) => ({
|
|
493
494
|
id: data.id,
|
|
@@ -536,7 +537,7 @@ class Guild extends _1.Base {
|
|
|
536
537
|
.then((response) => response.map((data) => new _1.GuildMember(data, this.client)));
|
|
537
538
|
}
|
|
538
539
|
/** https://discord.com/developers/docs/resources/guild#add-guild-member */
|
|
539
|
-
|
|
540
|
+
addGuildMember(userId, options) {
|
|
540
541
|
this.client.rest.put(rest_1.Endpoints.guildMember(this.id, userId), {
|
|
541
542
|
json: {
|
|
542
543
|
access_token: options.accessToken,
|
|
@@ -548,7 +549,7 @@ class Guild extends _1.Base {
|
|
|
548
549
|
});
|
|
549
550
|
}
|
|
550
551
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-member */
|
|
551
|
-
|
|
552
|
+
modifyMember(userId, options, reason) {
|
|
552
553
|
this.client.rest.patch(rest_1.Endpoints.guildMember(this.id, userId), {
|
|
553
554
|
json: {
|
|
554
555
|
nick: options.nick,
|
|
@@ -563,7 +564,7 @@ class Guild extends _1.Base {
|
|
|
563
564
|
});
|
|
564
565
|
}
|
|
565
566
|
/** https://discord.com/developers/docs/resources/guild#modify-current-member */
|
|
566
|
-
|
|
567
|
+
modifyCurrentMember(options, reason) {
|
|
567
568
|
this.client.rest.patch(rest_1.Endpoints.guildMember(this.id), {
|
|
568
569
|
json: {
|
|
569
570
|
nick: options.nick,
|
|
@@ -572,20 +573,20 @@ class Guild extends _1.Base {
|
|
|
572
573
|
});
|
|
573
574
|
}
|
|
574
575
|
/** https://discord.com/developers/docs/resources/guild#add-guild-member-role */
|
|
575
|
-
|
|
576
|
+
addGuildMemberRole(userId, roleId, reason) {
|
|
576
577
|
this.client.rest.put(rest_1.Endpoints.guildMemberRole(this.id, userId, roleId), {
|
|
577
578
|
reason,
|
|
578
579
|
});
|
|
579
580
|
}
|
|
580
581
|
/** https://discord.com/developers/docs/resources/guild#remove-guild-member-role */
|
|
581
|
-
|
|
582
|
-
this.client.rest.
|
|
582
|
+
removeMemberRole(userId, roleId, reason) {
|
|
583
|
+
this.client.rest.delete(rest_1.Endpoints.guildMemberRole(this.id, userId, roleId), {
|
|
583
584
|
reason,
|
|
584
585
|
});
|
|
585
586
|
}
|
|
586
587
|
/** https://discord.com/developers/docs/resources/guild#remove-guild-member-role */
|
|
587
|
-
|
|
588
|
-
this.client.rest.
|
|
588
|
+
removeMember(userId, reason) {
|
|
589
|
+
this.client.rest.delete(rest_1.Endpoints.guildMember(this.id, userId), {
|
|
589
590
|
reason,
|
|
590
591
|
});
|
|
591
592
|
}
|
|
@@ -606,14 +607,15 @@ class Guild extends _1.Base {
|
|
|
606
607
|
}
|
|
607
608
|
/** https://discord.com/developers/docs/resources/guild#get-guild-ban */
|
|
608
609
|
async getBan(userId) {
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
610
|
+
return this.client.rest
|
|
611
|
+
.get(rest_1.Endpoints.guildBan(this.id, userId))
|
|
612
|
+
.then((response) => ({
|
|
613
|
+
reason: response.reason,
|
|
614
|
+
user: new _1.User(response.user, this.client),
|
|
615
|
+
}));
|
|
614
616
|
}
|
|
615
617
|
/** https://discord.com/developers/docs/resources/guild#create-guild-ban */
|
|
616
|
-
|
|
618
|
+
createBan(userId, options, reason) {
|
|
617
619
|
this.client.rest.put(rest_1.Endpoints.guildBan(this.id, userId), {
|
|
618
620
|
json: {
|
|
619
621
|
delete_message_days: options?.deleteMessageDays,
|
|
@@ -623,8 +625,8 @@ class Guild extends _1.Base {
|
|
|
623
625
|
});
|
|
624
626
|
}
|
|
625
627
|
/** https://discord.com/developers/docs/resources/guild#remove-guild-ban */
|
|
626
|
-
|
|
627
|
-
this.client.rest.
|
|
628
|
+
removeBan(userId, reason) {
|
|
629
|
+
this.client.rest.delete(rest_1.Endpoints.guildBan(this.id, userId), {
|
|
628
630
|
reason,
|
|
629
631
|
});
|
|
630
632
|
}
|
|
@@ -677,7 +679,7 @@ class Guild extends _1.Base {
|
|
|
677
679
|
}
|
|
678
680
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-mfa-level */
|
|
679
681
|
async modifyMFALevel(options, reason) {
|
|
680
|
-
return
|
|
682
|
+
return this.client.rest.post(rest_1.Endpoints.guildMFA(this.id), {
|
|
681
683
|
json: {
|
|
682
684
|
level: options.level,
|
|
683
685
|
},
|
|
@@ -685,14 +687,14 @@ class Guild extends _1.Base {
|
|
|
685
687
|
});
|
|
686
688
|
}
|
|
687
689
|
/** https://discord.com/developers/docs/resources/guild#delete-guild-role */
|
|
688
|
-
|
|
689
|
-
this.client.rest.
|
|
690
|
+
deleteRole(roleId, reason) {
|
|
691
|
+
this.client.rest.delete(rest_1.Endpoints.guildRole(this.id, roleId), {
|
|
690
692
|
reason,
|
|
691
693
|
});
|
|
692
694
|
}
|
|
693
695
|
/** https://discord.com/developers/docs/resources/guild#get-guild-prune-count */
|
|
694
696
|
async getPruneCount(options) {
|
|
695
|
-
return
|
|
697
|
+
return this.client.rest.get(rest_1.Endpoints.guildPrune(this.id), {
|
|
696
698
|
query: {
|
|
697
699
|
days: options.days,
|
|
698
700
|
include_roles: options.includeRoles,
|
|
@@ -701,7 +703,7 @@ class Guild extends _1.Base {
|
|
|
701
703
|
}
|
|
702
704
|
/** https://discord.com/developers/docs/resources/guild#begin-guild-prune */
|
|
703
705
|
async beginGuildPrune(options, reason) {
|
|
704
|
-
return
|
|
706
|
+
return this.client.rest.post(rest_1.Endpoints.guildPrune(this.id), {
|
|
705
707
|
json: {
|
|
706
708
|
days: options.days,
|
|
707
709
|
compute_prune_count: options.computePruneCount,
|
|
@@ -713,14 +715,15 @@ class Guild extends _1.Base {
|
|
|
713
715
|
}
|
|
714
716
|
/** https://discord.com/developers/docs/resources/guild#get-guild-voice-regions */
|
|
715
717
|
async getVoiceRegions() {
|
|
716
|
-
|
|
717
|
-
|
|
718
|
+
return this.client.rest
|
|
719
|
+
.get(rest_1.Endpoints.guildVoiceRegions(this.id))
|
|
720
|
+
.then((response) => response.map((data) => ({
|
|
718
721
|
id: data.id,
|
|
719
722
|
name: data.name,
|
|
720
723
|
optimal: data.optimal,
|
|
721
724
|
deprecated: data.deprecated,
|
|
722
725
|
custom: data.custom,
|
|
723
|
-
}));
|
|
726
|
+
})));
|
|
724
727
|
}
|
|
725
728
|
/** https://discord.com/developers/docs/resources/guild#get-guild-invites */
|
|
726
729
|
async getInvites() {
|
|
@@ -735,44 +738,47 @@ class Guild extends _1.Base {
|
|
|
735
738
|
.then((response) => response.map((data) => new _1.Integration(data, this.client)));
|
|
736
739
|
}
|
|
737
740
|
/** https://discord.com/developers/docs/resources/guild#delete-guild-integration */
|
|
738
|
-
|
|
739
|
-
this.client.rest.
|
|
741
|
+
deleteIntegration(integrationId, reason) {
|
|
742
|
+
this.client.rest.delete(rest_1.Endpoints.guildIntegration(this.id, integrationId), {
|
|
740
743
|
reason,
|
|
741
744
|
});
|
|
742
745
|
}
|
|
743
746
|
/** https://discord.com/developers/docs/resources/guild#get-guild-widget-settings */
|
|
744
747
|
async getWidgetSettings() {
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
748
|
+
return this.client.rest
|
|
749
|
+
.get(rest_1.Endpoints.guildWidgetSettings(this.id))
|
|
750
|
+
.then((response) => ({
|
|
751
|
+
enabled: response.enabled,
|
|
752
|
+
channelId: response.channel_id,
|
|
753
|
+
}));
|
|
750
754
|
}
|
|
751
755
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-widget */
|
|
752
756
|
async modifyWidget(options, reason) {
|
|
753
|
-
|
|
757
|
+
return this.client.rest
|
|
758
|
+
.patch(rest_1.Endpoints.guildWidgetSettings(this.id), {
|
|
754
759
|
json: {
|
|
755
760
|
enabled: options.enabled,
|
|
756
761
|
channel_id: options.channelId,
|
|
757
762
|
},
|
|
758
763
|
reason,
|
|
759
|
-
})
|
|
760
|
-
|
|
761
|
-
enabled:
|
|
762
|
-
channelId:
|
|
763
|
-
};
|
|
764
|
+
})
|
|
765
|
+
.then((response) => ({
|
|
766
|
+
enabled: response.enabled,
|
|
767
|
+
channelId: response.channel_id,
|
|
768
|
+
}));
|
|
764
769
|
}
|
|
765
770
|
/** https://discord.com/developers/docs/resources/guild#get-guild-widget */
|
|
766
771
|
async getWidget() {
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
772
|
+
return this.client.rest
|
|
773
|
+
.get(rest_1.Endpoints.guildWidgetJSON(this.id))
|
|
774
|
+
.then((response) => ({
|
|
775
|
+
id: response.id,
|
|
776
|
+
name: response.name,
|
|
777
|
+
instantInvite: response.instant_invite,
|
|
778
|
+
channels: response.channels.map((data) => new _1.Channel(data, this.client)),
|
|
779
|
+
members: response.members.map((data) => new _1.User(data, this.client)),
|
|
780
|
+
presenceCount: response.presence_count,
|
|
781
|
+
}));
|
|
776
782
|
}
|
|
777
783
|
/** https://discord.com/developers/docs/resources/guild#get-guild-vanity-url */
|
|
778
784
|
async getVanityURL() {
|
|
@@ -780,7 +786,7 @@ class Guild extends _1.Base {
|
|
|
780
786
|
}
|
|
781
787
|
/** https://discord.com/developers/docs/resources/guild#get-guild-widget-image */
|
|
782
788
|
async getWidgetImage(options) {
|
|
783
|
-
return
|
|
789
|
+
return this.client.rest.get(rest_1.Endpoints.guildWidgetImage(this.id), {
|
|
784
790
|
query: {
|
|
785
791
|
style: options?.style,
|
|
786
792
|
},
|
|
@@ -788,43 +794,46 @@ class Guild extends _1.Base {
|
|
|
788
794
|
}
|
|
789
795
|
/** https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen */
|
|
790
796
|
async getWelcomeScreen() {
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
797
|
+
return this.client.rest
|
|
798
|
+
.get(rest_1.Endpoints.guildWelcomeScreen(this.id))
|
|
799
|
+
.then((response) => ({
|
|
800
|
+
description: response.description,
|
|
801
|
+
welcomeChannels: response.welcome_channels.map((data) => ({
|
|
795
802
|
channelId: data.channel_id,
|
|
796
803
|
description: data.description,
|
|
797
804
|
emojiId: data.emoji_id,
|
|
798
805
|
emojiName: data.emoji_name,
|
|
799
806
|
})),
|
|
800
|
-
};
|
|
807
|
+
}));
|
|
801
808
|
}
|
|
802
809
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen */
|
|
803
810
|
async modifyWelcomeScreen(options, reason) {
|
|
804
|
-
|
|
811
|
+
return this.client.rest
|
|
812
|
+
.patch(rest_1.Endpoints.guildWelcomeScreen(this.id), {
|
|
805
813
|
json: {
|
|
806
814
|
enabled: options.enabled,
|
|
807
815
|
welcome_channels: options.welcomeChannels,
|
|
808
816
|
description: options.description,
|
|
809
817
|
},
|
|
810
818
|
reason,
|
|
811
|
-
})
|
|
812
|
-
|
|
813
|
-
description:
|
|
814
|
-
welcomeChannels:
|
|
819
|
+
})
|
|
820
|
+
.then((response) => ({
|
|
821
|
+
description: response.description,
|
|
822
|
+
welcomeChannels: response.welcome_channels.map((data) => ({
|
|
815
823
|
channelId: data.channel_id,
|
|
816
824
|
description: data.description,
|
|
817
825
|
emojiId: data.emoji_id,
|
|
818
826
|
emojiName: data.emoji_name,
|
|
819
827
|
})),
|
|
820
|
-
};
|
|
828
|
+
}));
|
|
821
829
|
}
|
|
822
830
|
/** https://discord.com/developers/docs/resources/guild#get-guild-onboarding */
|
|
823
831
|
async getOnboarding() {
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
832
|
+
return this.client.rest
|
|
833
|
+
.get(rest_1.Endpoints.guildOnboarding(this.id))
|
|
834
|
+
.then((response) => ({
|
|
835
|
+
guildId: response.guild_id,
|
|
836
|
+
prompts: response.prompts.map((prompt) => ({
|
|
828
837
|
id: prompt.id,
|
|
829
838
|
type: prompt.type,
|
|
830
839
|
options: prompt.options.map((option) => ({
|
|
@@ -840,13 +849,13 @@ class Guild extends _1.Base {
|
|
|
840
849
|
required: prompt.required,
|
|
841
850
|
inOnboarding: prompt.in_onboarding,
|
|
842
851
|
})),
|
|
843
|
-
defaultChannelIds:
|
|
844
|
-
enabled:
|
|
845
|
-
mode:
|
|
846
|
-
};
|
|
852
|
+
defaultChannelIds: response.default_channel_ids,
|
|
853
|
+
enabled: response.enabled,
|
|
854
|
+
mode: response.mode,
|
|
855
|
+
}));
|
|
847
856
|
}
|
|
848
857
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-onboarding */
|
|
849
|
-
|
|
858
|
+
modifyOnboarding(options, reason) {
|
|
850
859
|
this.client.rest.patch(rest_1.Endpoints.guildOnboarding(this.id), {
|
|
851
860
|
json: {
|
|
852
861
|
prompts: options.prompts.map((prompt) => ({
|
|
@@ -879,7 +888,7 @@ class Guild extends _1.Base {
|
|
|
879
888
|
});
|
|
880
889
|
}
|
|
881
890
|
/** https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state */
|
|
882
|
-
|
|
891
|
+
modifyCurrentUserVoiceState(options) {
|
|
883
892
|
this.client.rest.patch(rest_1.Endpoints.guildVoiceState(this.id), {
|
|
884
893
|
json: {
|
|
885
894
|
channel_id: options.channelId,
|
|
@@ -889,7 +898,7 @@ class Guild extends _1.Base {
|
|
|
889
898
|
});
|
|
890
899
|
}
|
|
891
900
|
/** https://discord.com/developers/docs/resources/guild#modify-user-voice-state */
|
|
892
|
-
|
|
901
|
+
modifyUserVoiceState(userId, options) {
|
|
893
902
|
this.client.rest.patch(rest_1.Endpoints.guildVoiceState(this.id, userId), {
|
|
894
903
|
json: {
|
|
895
904
|
channel_id: options.channelId,
|
|
@@ -944,8 +953,8 @@ class Guild extends _1.Base {
|
|
|
944
953
|
}), this.client);
|
|
945
954
|
}
|
|
946
955
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event */
|
|
947
|
-
|
|
948
|
-
this.client.rest.
|
|
956
|
+
deleteScheduledEvent(scheduledEventId) {
|
|
957
|
+
this.client.rest.delete(rest_1.Endpoints.guildScheduledEvent(this.id, scheduledEventId));
|
|
949
958
|
}
|
|
950
959
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users */
|
|
951
960
|
async getScheduledEventUsers(scheduledEventId, options) {
|
|
@@ -1000,20 +1009,21 @@ class Guild extends _1.Base {
|
|
|
1000
1009
|
}
|
|
1001
1010
|
/** https://discord.com/developers/docs/resources/guild-template#delete-guild-template */
|
|
1002
1011
|
async deleteTemplate(code) {
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1012
|
+
return this.client.rest
|
|
1013
|
+
.delete(rest_1.Endpoints.guildTemplate(this.id, code))
|
|
1014
|
+
.then((response) => ({
|
|
1015
|
+
code: response.code,
|
|
1016
|
+
name: response.name,
|
|
1017
|
+
description: response.description,
|
|
1018
|
+
usageCount: response.usage_count,
|
|
1019
|
+
creatorId: response.creator_id,
|
|
1020
|
+
creator: new _1.User(response.creator, this.client),
|
|
1021
|
+
createdAt: response.created_at,
|
|
1022
|
+
updatedAt: response.updated_at,
|
|
1023
|
+
sourceGuildId: response.source_guild_id,
|
|
1024
|
+
serializedSourceGuild: new Guild(response.serialized_source_guild, this.client),
|
|
1025
|
+
isDirty: response.is_dirty,
|
|
1026
|
+
}));
|
|
1017
1027
|
}
|
|
1018
1028
|
/** https://discord.com/developers/docs/resources/sticker#list-guild-stickers */
|
|
1019
1029
|
async listStickers() {
|
|
@@ -1038,25 +1048,29 @@ class Guild extends _1.Base {
|
|
|
1038
1048
|
}
|
|
1039
1049
|
/** https://discord.com/developers/docs/resources/sticker#get-guild-sticker */
|
|
1040
1050
|
async getSticker(stickerId) {
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1051
|
+
return this.client.rest
|
|
1052
|
+
.get(rest_1.Endpoints.guildSticker(this.id, stickerId))
|
|
1053
|
+
.then((response) => ({
|
|
1054
|
+
id: response.id,
|
|
1055
|
+
packId: response.pack_id,
|
|
1056
|
+
name: response.name,
|
|
1057
|
+
description: response.description,
|
|
1058
|
+
tags: response.tags,
|
|
1059
|
+
asset: response.asset,
|
|
1060
|
+
type: response.type,
|
|
1061
|
+
formatType: response.format_type,
|
|
1062
|
+
available: response.available,
|
|
1063
|
+
guildId: response.guild_id,
|
|
1064
|
+
user: response.user !== undefined
|
|
1065
|
+
? new _1.User(response.user, this.client)
|
|
1066
|
+
: undefined,
|
|
1067
|
+
sortValue: response.sort_value,
|
|
1068
|
+
}));
|
|
1056
1069
|
}
|
|
1057
1070
|
/** https://discord.com/developers/docs/resources/sticker#create-guild-sticker */
|
|
1058
1071
|
async createSticker(options, reason) {
|
|
1059
|
-
|
|
1072
|
+
return this.client.rest
|
|
1073
|
+
.post(rest_1.Endpoints.guildStickers(this.id), {
|
|
1060
1074
|
json: {
|
|
1061
1075
|
name: options.name,
|
|
1062
1076
|
description: options.description,
|
|
@@ -1064,50 +1078,55 @@ class Guild extends _1.Base {
|
|
|
1064
1078
|
},
|
|
1065
1079
|
files: [options.file],
|
|
1066
1080
|
reason,
|
|
1067
|
-
})
|
|
1068
|
-
|
|
1069
|
-
id:
|
|
1070
|
-
packId:
|
|
1071
|
-
name:
|
|
1072
|
-
description:
|
|
1073
|
-
tags:
|
|
1074
|
-
asset:
|
|
1075
|
-
type:
|
|
1076
|
-
formatType:
|
|
1077
|
-
available:
|
|
1078
|
-
guildId:
|
|
1079
|
-
user:
|
|
1080
|
-
|
|
1081
|
-
|
|
1081
|
+
})
|
|
1082
|
+
.then((response) => ({
|
|
1083
|
+
id: response.id,
|
|
1084
|
+
packId: response.pack_id,
|
|
1085
|
+
name: response.name,
|
|
1086
|
+
description: response.description,
|
|
1087
|
+
tags: response.tags,
|
|
1088
|
+
asset: response.asset,
|
|
1089
|
+
type: response.type,
|
|
1090
|
+
formatType: response.format_type,
|
|
1091
|
+
available: response.available,
|
|
1092
|
+
guildId: response.guild_id,
|
|
1093
|
+
user: response.user !== undefined
|
|
1094
|
+
? new _1.User(response.user, this.client)
|
|
1095
|
+
: undefined,
|
|
1096
|
+
sortValue: response.sort_value,
|
|
1097
|
+
}));
|
|
1082
1098
|
}
|
|
1083
1099
|
/** https://discord.com/developers/docs/resources/sticker#modify-guild-sticker */
|
|
1084
1100
|
async modifySticker(stickerId, options, reason) {
|
|
1085
|
-
|
|
1101
|
+
return this.client.rest
|
|
1102
|
+
.patch(rest_1.Endpoints.guildSticker(this.id, stickerId), {
|
|
1086
1103
|
json: {
|
|
1087
1104
|
name: options.name,
|
|
1088
1105
|
description: options.description,
|
|
1089
1106
|
tags: options.tags,
|
|
1090
1107
|
},
|
|
1091
1108
|
reason,
|
|
1092
|
-
})
|
|
1093
|
-
|
|
1094
|
-
id:
|
|
1095
|
-
packId:
|
|
1096
|
-
name:
|
|
1097
|
-
description:
|
|
1098
|
-
tags:
|
|
1099
|
-
asset:
|
|
1100
|
-
type:
|
|
1101
|
-
formatType:
|
|
1102
|
-
available:
|
|
1103
|
-
guildId:
|
|
1104
|
-
user:
|
|
1105
|
-
|
|
1106
|
-
|
|
1109
|
+
})
|
|
1110
|
+
.then((response) => ({
|
|
1111
|
+
id: response.id,
|
|
1112
|
+
packId: response.pack_id,
|
|
1113
|
+
name: response.name,
|
|
1114
|
+
description: response.description,
|
|
1115
|
+
tags: response.tags,
|
|
1116
|
+
asset: response.asset,
|
|
1117
|
+
type: response.type,
|
|
1118
|
+
formatType: response.format_type,
|
|
1119
|
+
available: response.available,
|
|
1120
|
+
guildId: response.guild_id,
|
|
1121
|
+
user: response.user !== undefined
|
|
1122
|
+
? new _1.User(response.user, this.client)
|
|
1123
|
+
: undefined,
|
|
1124
|
+
sortValue: response.sort_value,
|
|
1125
|
+
}));
|
|
1107
1126
|
}
|
|
1108
1127
|
/** https://discord.com/developers/docs/resources/sticker#delete-guild-sticker */
|
|
1109
|
-
|
|
1110
|
-
this.client.rest.
|
|
1128
|
+
deleteSticker(stickerId, reason) {
|
|
1129
|
+
this.client.rest.delete(rest_1.Endpoints.guildSticker(this.id, stickerId), {
|
|
1111
1130
|
reason,
|
|
1112
1131
|
});
|
|
1113
1132
|
}
|