@discordjs/structures 0.2.0-dev.1769601701-c71228aab → 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.d.mts +67 -2
- package/dist/index.d.ts +67 -2
- package/dist/index.js +93 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +92 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -4657,6 +4657,95 @@ var Connection = class extends Structure {
|
|
|
4657
4657
|
}
|
|
4658
4658
|
};
|
|
4659
4659
|
|
|
4660
|
+
// src/webhooks/Webhook.ts
|
|
4661
|
+
import { DiscordSnowflake as DiscordSnowflake11 } from "@sapphire/snowflake";
|
|
4662
|
+
var Webhook = class extends Structure {
|
|
4663
|
+
static {
|
|
4664
|
+
__name(this, "Webhook");
|
|
4665
|
+
}
|
|
4666
|
+
/**
|
|
4667
|
+
* The template used for removing data from the raw data stored for each webhook
|
|
4668
|
+
*/
|
|
4669
|
+
static DataTemplate = {};
|
|
4670
|
+
/**
|
|
4671
|
+
* @param data - The raw data received from the API for the webhook
|
|
4672
|
+
*/
|
|
4673
|
+
constructor(data) {
|
|
4674
|
+
super(data);
|
|
4675
|
+
}
|
|
4676
|
+
/**
|
|
4677
|
+
* The id of the webhook
|
|
4678
|
+
*/
|
|
4679
|
+
get id() {
|
|
4680
|
+
return this[kData].id;
|
|
4681
|
+
}
|
|
4682
|
+
/**
|
|
4683
|
+
* The type of the webhook
|
|
4684
|
+
*
|
|
4685
|
+
* @see {@link https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types}
|
|
4686
|
+
*/
|
|
4687
|
+
get type() {
|
|
4688
|
+
return this[kData].type;
|
|
4689
|
+
}
|
|
4690
|
+
/**
|
|
4691
|
+
* The guild id this webhook is for, if any
|
|
4692
|
+
*/
|
|
4693
|
+
get guildId() {
|
|
4694
|
+
return this[kData].guild_id;
|
|
4695
|
+
}
|
|
4696
|
+
/**
|
|
4697
|
+
* The channel id this webhook is for, if any
|
|
4698
|
+
*/
|
|
4699
|
+
get channelId() {
|
|
4700
|
+
return this[kData].channel_id;
|
|
4701
|
+
}
|
|
4702
|
+
/**
|
|
4703
|
+
* The default name of the webhook
|
|
4704
|
+
*/
|
|
4705
|
+
get name() {
|
|
4706
|
+
return this[kData].name;
|
|
4707
|
+
}
|
|
4708
|
+
/**
|
|
4709
|
+
* The default user avatar hash of the webhook
|
|
4710
|
+
*
|
|
4711
|
+
* @see {@link https://discord.com/developers/docs/reference#image-formatting}
|
|
4712
|
+
*/
|
|
4713
|
+
get avatar() {
|
|
4714
|
+
return this[kData].avatar;
|
|
4715
|
+
}
|
|
4716
|
+
/**
|
|
4717
|
+
* The secure token of the webhook (returned for incoming webhooks)
|
|
4718
|
+
*/
|
|
4719
|
+
get token() {
|
|
4720
|
+
return this[kData].token;
|
|
4721
|
+
}
|
|
4722
|
+
/**
|
|
4723
|
+
* The id of the bot/OAuth2 application that created this webhook
|
|
4724
|
+
*/
|
|
4725
|
+
get applicationId() {
|
|
4726
|
+
return this[kData].application_id;
|
|
4727
|
+
}
|
|
4728
|
+
/**
|
|
4729
|
+
* The url used for executing the webhook (returned by the webhooks OAuth2 flow)
|
|
4730
|
+
*/
|
|
4731
|
+
get url() {
|
|
4732
|
+
return this[kData].url;
|
|
4733
|
+
}
|
|
4734
|
+
/**
|
|
4735
|
+
* The timestamp the webhook was created at
|
|
4736
|
+
*/
|
|
4737
|
+
get createdTimestamp() {
|
|
4738
|
+
return isIdSet(this.id) ? DiscordSnowflake11.timestampFrom(this.id) : null;
|
|
4739
|
+
}
|
|
4740
|
+
/**
|
|
4741
|
+
* The time the webhook was created at
|
|
4742
|
+
*/
|
|
4743
|
+
get createdAt() {
|
|
4744
|
+
const createdTimestamp = this.createdTimestamp;
|
|
4745
|
+
return createdTimestamp ? new Date(createdTimestamp) : null;
|
|
4746
|
+
}
|
|
4747
|
+
};
|
|
4748
|
+
|
|
4660
4749
|
// src/voice/VoiceState.ts
|
|
4661
4750
|
var VoiceState = class extends Structure {
|
|
4662
4751
|
static {
|
|
@@ -4794,7 +4883,7 @@ var VoiceRegion = class extends Structure {
|
|
|
4794
4883
|
};
|
|
4795
4884
|
|
|
4796
4885
|
// src/subscriptions/Subscription.ts
|
|
4797
|
-
import { DiscordSnowflake as
|
|
4886
|
+
import { DiscordSnowflake as DiscordSnowflake12 } from "@sapphire/snowflake";
|
|
4798
4887
|
var Subscription = class extends Structure {
|
|
4799
4888
|
static {
|
|
4800
4889
|
__name(this, "Subscription");
|
|
@@ -4926,7 +5015,7 @@ var Subscription = class extends Structure {
|
|
|
4926
5015
|
* The timestamp the subscription was created at
|
|
4927
5016
|
*/
|
|
4928
5017
|
get createdTimestamp() {
|
|
4929
|
-
return isIdSet(this.id) ?
|
|
5018
|
+
return isIdSet(this.id) ? DiscordSnowflake12.timestampFrom(this.id) : null;
|
|
4930
5019
|
}
|
|
4931
5020
|
/**
|
|
4932
5021
|
* The time the subscription was created at
|
|
@@ -5052,6 +5141,7 @@ export {
|
|
|
5052
5141
|
VoiceChannelMixin,
|
|
5053
5142
|
VoiceRegion,
|
|
5054
5143
|
VoiceState,
|
|
5144
|
+
Webhook,
|
|
5055
5145
|
dateToDiscordISOTimestamp,
|
|
5056
5146
|
extendTemplate
|
|
5057
5147
|
};
|