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.
Files changed (54) hide show
  1. package/dist/Client.d.ts +62 -64
  2. package/dist/Client.js +17 -8
  3. package/dist/Client.js.map +1 -1
  4. package/dist/rest/REST.d.ts +10 -10
  5. package/dist/rest/REST.js.map +1 -1
  6. package/dist/rest/RequestsManager.d.ts +2 -2
  7. package/dist/rest/RequestsManager.js +5 -7
  8. package/dist/rest/RequestsManager.js.map +1 -1
  9. package/dist/structures/Application.d.ts +4 -4
  10. package/dist/structures/Application.js +10 -10
  11. package/dist/structures/Application.js.map +1 -1
  12. package/dist/structures/ApplicationCommand.d.ts +4 -4
  13. package/dist/structures/ApplicationCommand.js +16 -25
  14. package/dist/structures/ApplicationCommand.js.map +1 -1
  15. package/dist/structures/AutoModerationRule.d.ts +1 -1
  16. package/dist/structures/AutoModerationRule.js +2 -2
  17. package/dist/structures/AutoModerationRule.js.map +1 -1
  18. package/dist/structures/Base.js.map +1 -1
  19. package/dist/structures/Channel.d.ts +20 -20
  20. package/dist/structures/Channel.js +92 -77
  21. package/dist/structures/Channel.js.map +1 -1
  22. package/dist/structures/Guild.d.ts +24 -24
  23. package/dist/structures/Guild.js +186 -167
  24. package/dist/structures/Guild.js.map +1 -1
  25. package/dist/structures/GuildMember.d.ts +6 -6
  26. package/dist/structures/GuildMember.js +6 -6
  27. package/dist/structures/GuildMember.js.map +1 -1
  28. package/dist/structures/GuildScheduledEvent.d.ts +3 -3
  29. package/dist/structures/GuildScheduledEvent.js +1 -1
  30. package/dist/structures/GuildScheduledEvent.js.map +1 -1
  31. package/dist/structures/GuildTemplate.js +15 -14
  32. package/dist/structures/GuildTemplate.js.map +1 -1
  33. package/dist/structures/Integration.d.ts +1 -1
  34. package/dist/structures/Integration.js +1 -1
  35. package/dist/structures/Integration.js.map +1 -1
  36. package/dist/structures/Interaction.d.ts +4 -4
  37. package/dist/structures/Interaction.js +8 -8
  38. package/dist/structures/Interaction.js.map +1 -1
  39. package/dist/structures/Invite.js +26 -25
  40. package/dist/structures/Invite.js.map +1 -1
  41. package/dist/structures/Message.d.ts +6 -6
  42. package/dist/structures/Message.js +8 -8
  43. package/dist/structures/Message.js.map +1 -1
  44. package/dist/structures/Role.js.map +1 -1
  45. package/dist/structures/StageInstance.d.ts +1 -1
  46. package/dist/structures/StageInstance.js +1 -1
  47. package/dist/structures/StageInstance.js.map +1 -1
  48. package/dist/structures/User.d.ts +1 -1
  49. package/dist/structures/User.js +29 -25
  50. package/dist/structures/User.js.map +1 -1
  51. package/dist/structures/Webhook.d.ts +3 -3
  52. package/dist/structures/Webhook.js +3 -3
  53. package/dist/structures/Webhook.js.map +1 -1
  54. package/package.json +1 -1
@@ -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
- async deleteApplicationCommand(applicationId, commandId) {
243
- this.client.rest.put(rest_1.Endpoints.applicationGuildCommand(applicationId, this.id, commandId));
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) => response.map((data) => ({
281
- applicationCommands: data.application_commands.map((applicationCommand) => new _1.ApplicationCommand(applicationCommand, this.client)),
282
- auditLogEntries: data.audit_log_entries.map((auditLogEntry) => (0, utils_1.auditLogEntryToJSON)(auditLogEntry)),
283
- autoModerationRules: data.auto_moderation_rules.map((autoModerationRule) => new _1.AutoModerationRule(autoModerationRule, this.client)),
284
- guildScheduledEvents: data.guild_scheduled_events.map((guildScheduledEvent) => new _1.GuildScheduledEvent(guildScheduledEvent, this.client)),
285
- integrations: data.integrations.map((integration) => new _1.Integration(integration, this.client)),
286
- threads: data.threads.map((thread) => new _1.Channel(thread, this.client)),
287
- users: data.users.map((user) => new _1.User(user, this.client)),
288
- webhooks: data.webhooks.map((webhook) => new _1.Webhook(webhook, this.client)),
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
- async deleteAutoModerationRule(ruleId, reason) {
349
- this.client.rest.put(rest_1.Endpoints.guildAutoModerationRule(this.id, ruleId), {
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
- async deleteEmoji(emojiId, reason) {
386
- this.client.rest.put(rest_1.Endpoints.guildEmoji(this.id, emojiId), {
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
- const data = await this.client.rest.get(rest_1.Endpoints.guildPreview(this.id));
393
- return {
394
- id: data.id,
395
- name: data.name,
396
- icon: data.icon,
397
- splash: data.splash,
398
- discoverySplash: data.discovery_splash,
399
- emojis: data.emojis.map((emoji) => (0, utils_1.emojiToJSON)(emoji, this.client)),
400
- features: data.features,
401
- approximateMemberCount: data.approximate_member_count,
402
- approximatePresenceCount: data.approximate_presence_count,
403
- description: data.description,
404
- stickers: data.stickers?.map((sticker) => ({
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
- async delete() {
453
- this.client.rest.put(rest_1.Endpoints.guild(this.id));
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
- async modifyChannelPositions(options) {
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
- async addGuildMember(userId, options) {
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
- async modifyMember(userId, options, reason) {
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
- async modifyCurrentMember(options, reason) {
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
- async addGuildMemberRole(userId, roleId, reason) {
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
- async removeMemberRole(userId, roleId, reason) {
582
- this.client.rest.put(rest_1.Endpoints.guildMemberRole(this.id, userId, roleId), {
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
- async removeMember(userId, reason) {
588
- this.client.rest.put(rest_1.Endpoints.guildMember(this.id, userId), {
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
- const data = await this.client.rest.get(rest_1.Endpoints.guildBan(this.id, userId));
610
- return {
611
- reason: data.reason,
612
- user: new _1.User(data.user, this.client),
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
- async createBan(userId, options, reason) {
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
- async removeBan(userId, reason) {
627
- this.client.rest.put(rest_1.Endpoints.guildBan(this.id, userId), {
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 await this.client.rest.post(rest_1.Endpoints.guildMFA(this.id), {
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
- async deleteRole(roleId, reason) {
689
- this.client.rest.put(rest_1.Endpoints.guildRole(this.id, roleId), {
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 await this.client.rest.get(rest_1.Endpoints.guildPrune(this.id), {
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 await this.client.rest.post(rest_1.Endpoints.guildPrune(this.id), {
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
- const data = await this.client.rest.get(rest_1.Endpoints.guildVoiceRegions(this.id));
717
- return data.map((data) => ({
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
- async deleteIntegration(integrationId, reason) {
739
- this.client.rest.put(rest_1.Endpoints.guildIntegration(this.id, integrationId), {
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
- const data = await this.client.rest.get(rest_1.Endpoints.guildWidgetSettings(this.id));
746
- return {
747
- enabled: data.enabled,
748
- channelId: data.channel_id,
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
- const data = await this.client.rest.patch(rest_1.Endpoints.guildWidgetSettings(this.id), {
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
- return {
761
- enabled: data.enabled,
762
- channelId: data.channel_id,
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
- const data = await this.client.rest.get(rest_1.Endpoints.guildWidgetJSON(this.id));
768
- return {
769
- id: data.id,
770
- name: data.name,
771
- instantInvite: data.instant_invite,
772
- channels: data.channels.map((data) => new _1.Channel(data, this.client)),
773
- members: data.members.map((data) => new _1.User(data, this.client)),
774
- presenceCount: data.presence_count,
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 await this.client.rest.get(rest_1.Endpoints.guildWidgetImage(this.id), {
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
- const data = await this.client.rest.get(rest_1.Endpoints.guildWelcomeScreen(this.id));
792
- return {
793
- description: data.description,
794
- welcomeChannels: data.welcome_channels.map((data) => ({
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
- const data = await this.client.rest.patch(rest_1.Endpoints.guildWelcomeScreen(this.id), {
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
- return {
813
- description: data.description,
814
- welcomeChannels: data.welcome_channels.map((data) => ({
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
- const data = await this.client.rest.get(rest_1.Endpoints.guildOnboarding(this.id));
825
- return {
826
- guildId: data.guild_id,
827
- prompts: data.prompts.map((prompt) => ({
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: data.default_channel_ids,
844
- enabled: data.enabled,
845
- mode: data.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
- async modifyOnboarding(options, reason) {
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
- async modifyCurrentUserVoiceState(options) {
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
- async modifyUserVoiceState(userId, options) {
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
- async deleteScheduledEvent(scheduledEventId) {
948
- this.client.rest.put(rest_1.Endpoints.guildScheduledEvent(this.id, scheduledEventId));
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
- const data = await this.client.rest.put(rest_1.Endpoints.guildTemplate(this.id, code));
1004
- return {
1005
- code: data.code,
1006
- name: data.name,
1007
- description: data.description,
1008
- usageCount: data.usage_count,
1009
- creatorId: data.creator_id,
1010
- creator: new _1.User(data.creator, this.client),
1011
- createdAt: data.created_at,
1012
- updatedAt: data.updated_at,
1013
- sourceGuildId: data.source_guild_id,
1014
- serializedSourceGuild: new Guild(data.serialized_source_guild, this.client),
1015
- isDirty: data.is_dirty,
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
- const data = await this.client.rest.get(rest_1.Endpoints.guildSticker(this.id, stickerId));
1042
- return {
1043
- id: data.id,
1044
- packId: data.pack_id,
1045
- name: data.name,
1046
- description: data.description,
1047
- tags: data.tags,
1048
- asset: data.asset,
1049
- type: data.type,
1050
- formatType: data.format_type,
1051
- available: data.available,
1052
- guildId: data.guild_id,
1053
- user: data.user !== undefined ? new _1.User(data.user, this.client) : undefined,
1054
- sortValue: data.sort_value,
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
- const data = await this.client.rest.post(rest_1.Endpoints.guildStickers(this.id), {
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
- return {
1069
- id: data.id,
1070
- packId: data.pack_id,
1071
- name: data.name,
1072
- description: data.description,
1073
- tags: data.tags,
1074
- asset: data.asset,
1075
- type: data.type,
1076
- formatType: data.format_type,
1077
- available: data.available,
1078
- guildId: data.guild_id,
1079
- user: data.user !== undefined ? new _1.User(data.user, this.client) : undefined,
1080
- sortValue: data.sort_value,
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
- const data = await this.client.rest.patch(rest_1.Endpoints.guildSticker(this.id, stickerId), {
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
- return {
1094
- id: data.id,
1095
- packId: data.pack_id,
1096
- name: data.name,
1097
- description: data.description,
1098
- tags: data.tags,
1099
- asset: data.asset,
1100
- type: data.type,
1101
- formatType: data.format_type,
1102
- available: data.available,
1103
- guildId: data.guild_id,
1104
- user: data.user !== undefined ? new _1.User(data.user, this.client) : undefined,
1105
- sortValue: data.sort_value,
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
- async deleteSticker(stickerId, reason) {
1110
- this.client.rest.put(rest_1.Endpoints.guildSticker(this.id, stickerId), {
1128
+ deleteSticker(stickerId, reason) {
1129
+ this.client.rest.delete(rest_1.Endpoints.guildSticker(this.id, stickerId), {
1111
1130
  reason,
1112
1131
  });
1113
1132
  }