@discordjs/structures 0.2.0-dev.1769558523-b0e413c11 → 0.2.0-dev.1770422605-c460a920a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -104,6 +104,8 @@ __export(index_exports, {
104
104
  ResolvedInteractionData: () => ResolvedInteractionData,
105
105
  RoleSelectMenuComponent: () => RoleSelectMenuComponent,
106
106
  RoleSubscriptionData: () => RoleSubscriptionData,
107
+ SKU: () => SKU,
108
+ SKUFlagsBitField: () => SKUFlagsBitField,
107
109
  SectionComponent: () => SectionComponent,
108
110
  SelectMenuComponent: () => SelectMenuComponent,
109
111
  SelectMenuDefaultValue: () => SelectMenuDefaultValue,
@@ -134,6 +136,7 @@ __export(index_exports, {
134
136
  VoiceChannelMixin: () => VoiceChannelMixin,
135
137
  VoiceRegion: () => VoiceRegion,
136
138
  VoiceState: () => VoiceState,
139
+ Webhook: () => Webhook,
137
140
  dateToDiscordISOTimestamp: () => dateToDiscordISOTimestamp,
138
141
  extendTemplate: () => extendTemplate
139
142
  });
@@ -275,7 +278,9 @@ var AutoModerationAction = class extends Structure {
275
278
  super(data);
276
279
  }
277
280
  /**
278
- * The {@link https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-action-types | action type}
281
+ * The action type
282
+ *
283
+ * @see {@link https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-action-types}
279
284
  */
280
285
  get type() {
281
286
  return this[kData].type;
@@ -367,13 +372,17 @@ var AutoModerationRule = class extends Structure {
367
372
  return this[kData].creator_id;
368
373
  }
369
374
  /**
370
- * The rule {@link https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-event-types | event type}
375
+ * The rule event type
376
+ *
377
+ * @see {@link https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-event-types}
371
378
  */
372
379
  get eventType() {
373
380
  return this[kData].event_type;
374
381
  }
375
382
  /**
376
- * The rule {@link https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-types | trigger type}
383
+ * The rule trigger type
384
+ *
385
+ * @see {@link https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-types}
377
386
  */
378
387
  get triggerType() {
379
388
  return this[kData].trigger_type;
@@ -744,6 +753,21 @@ var PermissionsBitField = class extends BitField {
744
753
  }
745
754
  };
746
755
 
756
+ // src/bitfields/SKUFlagsBitField.ts
757
+ var import_v105 = require("discord-api-types/v10");
758
+ var SKUFlagsBitField = class extends BitField {
759
+ static {
760
+ __name(this, "SKUFlagsBitField");
761
+ }
762
+ /**
763
+ * Numeric SKU flags.
764
+ */
765
+ static Flags = import_v105.SKUFlags;
766
+ toJSON() {
767
+ return super.toJSON(true);
768
+ }
769
+ };
770
+
747
771
  // src/channels/mixins/AppliedTagsMixin.ts
748
772
  var AppliedTagsMixin = class {
749
773
  static {
@@ -2014,7 +2038,7 @@ var ResolvedInteractionData = class extends Structure {
2014
2038
  };
2015
2039
 
2016
2040
  // src/invites/Invite.ts
2017
- var import_v105 = require("discord-api-types/v10");
2041
+ var import_v106 = require("discord-api-types/v10");
2018
2042
  var Invite = class extends Structure {
2019
2043
  static {
2020
2044
  __name(this, "Invite");
@@ -2159,7 +2183,7 @@ var Invite = class extends Structure {
2159
2183
  * The URL to the invite
2160
2184
  */
2161
2185
  get url() {
2162
- return this.code ? `${import_v105.RouteBases.invite}/${this.code}` : null;
2186
+ return this.code ? `${import_v106.RouteBases.invite}/${this.code}` : null;
2163
2187
  }
2164
2188
  /**
2165
2189
  * When concatenated with a string, this automatically concatenates the invite's URL instead of the object.
@@ -3728,7 +3752,7 @@ var MessageComponentInteractionMetadata = class extends InteractionMetadata {
3728
3752
  };
3729
3753
 
3730
3754
  // src/messages/MessageReference.ts
3731
- var import_v106 = require("discord-api-types/v10");
3755
+ var import_v107 = require("discord-api-types/v10");
3732
3756
  var MessageReference = class extends Structure {
3733
3757
  static {
3734
3758
  __name(this, "MessageReference");
@@ -3747,7 +3771,7 @@ var MessageReference = class extends Structure {
3747
3771
  * The type of this reference
3748
3772
  */
3749
3773
  get type() {
3750
- return "type" in this[kData] ? this[kData].type : import_v106.MessageReferenceType.Default;
3774
+ return "type" in this[kData] ? this[kData].type : import_v107.MessageReferenceType.Default;
3751
3775
  }
3752
3776
  /**
3753
3777
  * The id of the referenced message
@@ -4094,6 +4118,61 @@ var PollResults = class extends Structure {
4094
4118
  }
4095
4119
  };
4096
4120
 
4121
+ // src/skus/SKU.ts
4122
+ var SKU = class extends Structure {
4123
+ static {
4124
+ __name(this, "SKU");
4125
+ }
4126
+ /**
4127
+ * The template used for removing data from the raw data stored for each SKU
4128
+ */
4129
+ static DataTemplate = {};
4130
+ /**
4131
+ * @param data - The raw data received from the API for the SKU
4132
+ */
4133
+ constructor(data) {
4134
+ super(data);
4135
+ }
4136
+ /**
4137
+ * Id of the SKU
4138
+ */
4139
+ get id() {
4140
+ return this[kData].id;
4141
+ }
4142
+ /**
4143
+ * Type of SKU
4144
+ *
4145
+ * @see {@link https://discord.com/developers/docs/resources/sku#sku-object-sku-types}
4146
+ */
4147
+ get type() {
4148
+ return this[kData].type;
4149
+ }
4150
+ /**
4151
+ * Id of the parent application
4152
+ */
4153
+ get applicationId() {
4154
+ return this[kData].application_id;
4155
+ }
4156
+ /**
4157
+ * Customer-facing name of your premium offering
4158
+ */
4159
+ get name() {
4160
+ return this[kData].name;
4161
+ }
4162
+ /**
4163
+ * System-generated URL slug based on the SKU's name
4164
+ */
4165
+ get slug() {
4166
+ return this[kData].slug;
4167
+ }
4168
+ /**
4169
+ * SKU flags combined as a bitfield
4170
+ */
4171
+ get flags() {
4172
+ return isFieldSet(this[kData], "flags", "number") ? new SKUFlagsBitField(this[kData].flags) : null;
4173
+ }
4174
+ };
4175
+
4097
4176
  // src/soundboards/SoundboardSound.ts
4098
4177
  var import_snowflake5 = require("@sapphire/snowflake");
4099
4178
  var SoundboardSound = class extends Structure {
@@ -4719,6 +4798,95 @@ var Connection = class extends Structure {
4719
4798
  }
4720
4799
  };
4721
4800
 
4801
+ // src/webhooks/Webhook.ts
4802
+ var import_snowflake11 = require("@sapphire/snowflake");
4803
+ var Webhook = class extends Structure {
4804
+ static {
4805
+ __name(this, "Webhook");
4806
+ }
4807
+ /**
4808
+ * The template used for removing data from the raw data stored for each webhook
4809
+ */
4810
+ static DataTemplate = {};
4811
+ /**
4812
+ * @param data - The raw data received from the API for the webhook
4813
+ */
4814
+ constructor(data) {
4815
+ super(data);
4816
+ }
4817
+ /**
4818
+ * The id of the webhook
4819
+ */
4820
+ get id() {
4821
+ return this[kData].id;
4822
+ }
4823
+ /**
4824
+ * The type of the webhook
4825
+ *
4826
+ * @see {@link https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types}
4827
+ */
4828
+ get type() {
4829
+ return this[kData].type;
4830
+ }
4831
+ /**
4832
+ * The guild id this webhook is for, if any
4833
+ */
4834
+ get guildId() {
4835
+ return this[kData].guild_id;
4836
+ }
4837
+ /**
4838
+ * The channel id this webhook is for, if any
4839
+ */
4840
+ get channelId() {
4841
+ return this[kData].channel_id;
4842
+ }
4843
+ /**
4844
+ * The default name of the webhook
4845
+ */
4846
+ get name() {
4847
+ return this[kData].name;
4848
+ }
4849
+ /**
4850
+ * The default user avatar hash of the webhook
4851
+ *
4852
+ * @see {@link https://discord.com/developers/docs/reference#image-formatting}
4853
+ */
4854
+ get avatar() {
4855
+ return this[kData].avatar;
4856
+ }
4857
+ /**
4858
+ * The secure token of the webhook (returned for incoming webhooks)
4859
+ */
4860
+ get token() {
4861
+ return this[kData].token;
4862
+ }
4863
+ /**
4864
+ * The id of the bot/OAuth2 application that created this webhook
4865
+ */
4866
+ get applicationId() {
4867
+ return this[kData].application_id;
4868
+ }
4869
+ /**
4870
+ * The url used for executing the webhook (returned by the webhooks OAuth2 flow)
4871
+ */
4872
+ get url() {
4873
+ return this[kData].url;
4874
+ }
4875
+ /**
4876
+ * The timestamp the webhook was created at
4877
+ */
4878
+ get createdTimestamp() {
4879
+ return isIdSet(this.id) ? import_snowflake11.DiscordSnowflake.timestampFrom(this.id) : null;
4880
+ }
4881
+ /**
4882
+ * The time the webhook was created at
4883
+ */
4884
+ get createdAt() {
4885
+ const createdTimestamp = this.createdTimestamp;
4886
+ return createdTimestamp ? new Date(createdTimestamp) : null;
4887
+ }
4888
+ };
4889
+
4722
4890
  // src/voice/VoiceState.ts
4723
4891
  var VoiceState = class extends Structure {
4724
4892
  static {
@@ -4856,7 +5024,7 @@ var VoiceRegion = class extends Structure {
4856
5024
  };
4857
5025
 
4858
5026
  // src/subscriptions/Subscription.ts
4859
- var import_snowflake11 = require("@sapphire/snowflake");
5027
+ var import_snowflake12 = require("@sapphire/snowflake");
4860
5028
  var Subscription = class extends Structure {
4861
5029
  static {
4862
5030
  __name(this, "Subscription");
@@ -4988,7 +5156,7 @@ var Subscription = class extends Structure {
4988
5156
  * The timestamp the subscription was created at
4989
5157
  */
4990
5158
  get createdTimestamp() {
4991
- return isIdSet(this.id) ? import_snowflake11.DiscordSnowflake.timestampFrom(this.id) : null;
5159
+ return isIdSet(this.id) ? import_snowflake12.DiscordSnowflake.timestampFrom(this.id) : null;
4992
5160
  }
4993
5161
  /**
4994
5162
  * The time the subscription was created at
@@ -5083,6 +5251,8 @@ var Subscription = class extends Structure {
5083
5251
  ResolvedInteractionData,
5084
5252
  RoleSelectMenuComponent,
5085
5253
  RoleSubscriptionData,
5254
+ SKU,
5255
+ SKUFlagsBitField,
5086
5256
  SectionComponent,
5087
5257
  SelectMenuComponent,
5088
5258
  SelectMenuDefaultValue,
@@ -5113,6 +5283,7 @@ var Subscription = class extends Structure {
5113
5283
  VoiceChannelMixin,
5114
5284
  VoiceRegion,
5115
5285
  VoiceState,
5286
+ Webhook,
5116
5287
  dateToDiscordISOTimestamp,
5117
5288
  extendTemplate
5118
5289
  });