@discordjs/structures 0.2.0-dev.1769299319-3550b497f → 0.2.0-dev.1769558523-b0e413c11
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 +431 -2
- package/dist/index.d.ts +431 -2
- package/dist/index.js +633 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +625 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -12,6 +12,9 @@ var kEditedTimestamp = /* @__PURE__ */ Symbol.for("djs.structures.editedTimestam
|
|
|
12
12
|
var kArchiveTimestamp = /* @__PURE__ */ Symbol.for("djs.structures.archiveTimestamp");
|
|
13
13
|
var kStartsTimestamp = /* @__PURE__ */ Symbol.for("djs.structures.startsTimestamp");
|
|
14
14
|
var kEndsTimestamp = /* @__PURE__ */ Symbol.for("djs.structures.endsTimestamp");
|
|
15
|
+
var kCurrentPeriodStartTimestamp = /* @__PURE__ */ Symbol.for("djs.structures.currentPeriodStartTimestamp");
|
|
16
|
+
var kCurrentPeriodEndTimestamp = /* @__PURE__ */ Symbol.for("djs.structures.currentPeriodEndTimestamp");
|
|
17
|
+
var kCanceledTimestamp = /* @__PURE__ */ Symbol.for("djs.structures.canceledTimestamp");
|
|
15
18
|
var kAllow = /* @__PURE__ */ Symbol.for("djs.structures.allow");
|
|
16
19
|
var kDeny = /* @__PURE__ */ Symbol.for("djs.structures.deny");
|
|
17
20
|
var kBurstColors = /* @__PURE__ */ Symbol.for("djs.structures.burstColors");
|
|
@@ -1187,6 +1190,14 @@ function isIdSet(id) {
|
|
|
1187
1190
|
return typeof id === "string" || typeof id === "bigint";
|
|
1188
1191
|
}
|
|
1189
1192
|
__name(isIdSet, "isIdSet");
|
|
1193
|
+
function hasProperty(data, fieldName) {
|
|
1194
|
+
return fieldName in data;
|
|
1195
|
+
}
|
|
1196
|
+
__name(hasProperty, "hasProperty");
|
|
1197
|
+
function isFieldSet(data, fieldName, type) {
|
|
1198
|
+
return hasProperty(data, fieldName) && typeof data[fieldName] === type;
|
|
1199
|
+
}
|
|
1200
|
+
__name(isFieldSet, "isFieldSet");
|
|
1190
1201
|
|
|
1191
1202
|
// src/channels/Channel.ts
|
|
1192
1203
|
var Channel = class extends Structure {
|
|
@@ -1234,8 +1245,7 @@ var Channel = class extends Structure {
|
|
|
1234
1245
|
* to null, respecting Omit behaviors
|
|
1235
1246
|
*/
|
|
1236
1247
|
get flags() {
|
|
1237
|
-
|
|
1238
|
-
return flags ? new ChannelFlagsBitField(flags) : null;
|
|
1248
|
+
return isFieldSet(this[kData], "flags", "number") ? new ChannelFlagsBitField(this[kData].flags) : null;
|
|
1239
1249
|
}
|
|
1240
1250
|
/**
|
|
1241
1251
|
* The timestamp the channel was created at
|
|
@@ -3283,8 +3293,7 @@ var Attachment = class extends Structure {
|
|
|
3283
3293
|
* Attachment flags combined as a bitfield
|
|
3284
3294
|
*/
|
|
3285
3295
|
get flags() {
|
|
3286
|
-
|
|
3287
|
-
return flags ? new AttachmentFlagsBitField(this[kData].flags) : null;
|
|
3296
|
+
return isFieldSet(this[kData], "flags", "number") ? new AttachmentFlagsBitField(this[kData].flags) : null;
|
|
3288
3297
|
}
|
|
3289
3298
|
};
|
|
3290
3299
|
|
|
@@ -3416,8 +3425,7 @@ var Message = class extends Structure {
|
|
|
3416
3425
|
* The flags of this message as a bit field
|
|
3417
3426
|
*/
|
|
3418
3427
|
get flags() {
|
|
3419
|
-
|
|
3420
|
-
return flags ? new MessageFlagsBitField(this[kData].flags) : null;
|
|
3428
|
+
return isFieldSet(this[kData], "flags", "number") ? new MessageFlagsBitField(this[kData].flags) : null;
|
|
3421
3429
|
}
|
|
3422
3430
|
/**
|
|
3423
3431
|
* The nonce used when sending this message.
|
|
@@ -3948,7 +3956,152 @@ var PollResults = class extends Structure {
|
|
|
3948
3956
|
}
|
|
3949
3957
|
};
|
|
3950
3958
|
|
|
3959
|
+
// src/soundboards/SoundboardSound.ts
|
|
3960
|
+
import { DiscordSnowflake as DiscordSnowflake5 } from "@sapphire/snowflake";
|
|
3961
|
+
var SoundboardSound = class extends Structure {
|
|
3962
|
+
static {
|
|
3963
|
+
__name(this, "SoundboardSound");
|
|
3964
|
+
}
|
|
3965
|
+
/**
|
|
3966
|
+
* The template used for removing data from the raw data stored for each soundboard sound.
|
|
3967
|
+
*/
|
|
3968
|
+
static DataTemplate = {};
|
|
3969
|
+
/**
|
|
3970
|
+
* @param data - The raw data received from the API for the soundboard sound
|
|
3971
|
+
*/
|
|
3972
|
+
constructor(data) {
|
|
3973
|
+
super(data);
|
|
3974
|
+
}
|
|
3975
|
+
/**
|
|
3976
|
+
* The name of this sound
|
|
3977
|
+
*/
|
|
3978
|
+
get name() {
|
|
3979
|
+
return this[kData].name;
|
|
3980
|
+
}
|
|
3981
|
+
/**
|
|
3982
|
+
* The id of this sound
|
|
3983
|
+
*/
|
|
3984
|
+
get soundId() {
|
|
3985
|
+
return this[kData].sound_id;
|
|
3986
|
+
}
|
|
3987
|
+
/**
|
|
3988
|
+
* The volume of this sound, from 0 to 1
|
|
3989
|
+
*/
|
|
3990
|
+
get volume() {
|
|
3991
|
+
return this[kData].volume;
|
|
3992
|
+
}
|
|
3993
|
+
/**
|
|
3994
|
+
* The id of this sound's custom emoji
|
|
3995
|
+
*/
|
|
3996
|
+
get emojiId() {
|
|
3997
|
+
return this[kData].emoji_id;
|
|
3998
|
+
}
|
|
3999
|
+
/**
|
|
4000
|
+
* The unicode character of this sound's standard emoji
|
|
4001
|
+
*/
|
|
4002
|
+
get emojiName() {
|
|
4003
|
+
return this[kData].emoji_name;
|
|
4004
|
+
}
|
|
4005
|
+
/**
|
|
4006
|
+
* The id of the guild this sound is in
|
|
4007
|
+
*/
|
|
4008
|
+
get guildId() {
|
|
4009
|
+
return this[kData].guild_id;
|
|
4010
|
+
}
|
|
4011
|
+
/**
|
|
4012
|
+
* Whether this sound can be used, may be false due to loss of server boosts
|
|
4013
|
+
*/
|
|
4014
|
+
get available() {
|
|
4015
|
+
return this[kData].available;
|
|
4016
|
+
}
|
|
4017
|
+
/**
|
|
4018
|
+
* The timestamp this sound was created at
|
|
4019
|
+
*
|
|
4020
|
+
* @remarks only available for guild soundboard sounds
|
|
4021
|
+
*/
|
|
4022
|
+
get createdTimestamp() {
|
|
4023
|
+
return isIdSet(this[kData].sound_id) && isIdSet(this[kData].guild_id) ? DiscordSnowflake5.timestampFrom(this[kData].sound_id) : null;
|
|
4024
|
+
}
|
|
4025
|
+
/**
|
|
4026
|
+
* The time this sound was created at
|
|
4027
|
+
*
|
|
4028
|
+
* @remarks only available for guild soundboard sounds
|
|
4029
|
+
*/
|
|
4030
|
+
get createdAt() {
|
|
4031
|
+
const createdTimestamp = this.createdTimestamp;
|
|
4032
|
+
return createdTimestamp ? new Date(createdTimestamp) : null;
|
|
4033
|
+
}
|
|
4034
|
+
};
|
|
4035
|
+
|
|
4036
|
+
// src/stageInstances/StageInstance.ts
|
|
4037
|
+
import { DiscordSnowflake as DiscordSnowflake6 } from "@sapphire/snowflake";
|
|
4038
|
+
var StageInstance = class extends Structure {
|
|
4039
|
+
static {
|
|
4040
|
+
__name(this, "StageInstance");
|
|
4041
|
+
}
|
|
4042
|
+
/**
|
|
4043
|
+
* The template used for removing data from the raw data stored for each stage instance
|
|
4044
|
+
*/
|
|
4045
|
+
static DataTemplate = {};
|
|
4046
|
+
/**
|
|
4047
|
+
* @param data - The raw data received from the API for the stage instance
|
|
4048
|
+
*/
|
|
4049
|
+
constructor(data) {
|
|
4050
|
+
super(data);
|
|
4051
|
+
}
|
|
4052
|
+
/**
|
|
4053
|
+
* The stage instance's id
|
|
4054
|
+
*/
|
|
4055
|
+
get id() {
|
|
4056
|
+
return this[kData].id;
|
|
4057
|
+
}
|
|
4058
|
+
/**
|
|
4059
|
+
* The guild id of the associated stage channel
|
|
4060
|
+
*/
|
|
4061
|
+
get guildId() {
|
|
4062
|
+
return this[kData].guild_id;
|
|
4063
|
+
}
|
|
4064
|
+
/**
|
|
4065
|
+
* The id of the associated stage channel
|
|
4066
|
+
*/
|
|
4067
|
+
get channelId() {
|
|
4068
|
+
return this[kData].channel_id;
|
|
4069
|
+
}
|
|
4070
|
+
/**
|
|
4071
|
+
* The topic of the stage instance (1-120 characters)
|
|
4072
|
+
*/
|
|
4073
|
+
get topic() {
|
|
4074
|
+
return this[kData].topic;
|
|
4075
|
+
}
|
|
4076
|
+
/**
|
|
4077
|
+
* The privacy level of the stage instance
|
|
4078
|
+
*/
|
|
4079
|
+
get privacyLevel() {
|
|
4080
|
+
return this[kData].privacy_level;
|
|
4081
|
+
}
|
|
4082
|
+
/**
|
|
4083
|
+
* The id of the scheduled event for this stage instance
|
|
4084
|
+
*/
|
|
4085
|
+
get guildScheduledEventId() {
|
|
4086
|
+
return this[kData].guild_scheduled_event_id;
|
|
4087
|
+
}
|
|
4088
|
+
/**
|
|
4089
|
+
* The timestamp the stage instance was created at
|
|
4090
|
+
*/
|
|
4091
|
+
get createdTimestamp() {
|
|
4092
|
+
return isIdSet(this.id) ? DiscordSnowflake6.timestampFrom(this.id) : null;
|
|
4093
|
+
}
|
|
4094
|
+
/**
|
|
4095
|
+
* The time the stage instance was created at
|
|
4096
|
+
*/
|
|
4097
|
+
get createdAt() {
|
|
4098
|
+
const createdTimestamp = this.createdTimestamp;
|
|
4099
|
+
return createdTimestamp ? new Date(createdTimestamp) : null;
|
|
4100
|
+
}
|
|
4101
|
+
};
|
|
4102
|
+
|
|
3951
4103
|
// src/stickers/Sticker.ts
|
|
4104
|
+
import { DiscordSnowflake as DiscordSnowflake7 } from "@sapphire/snowflake";
|
|
3952
4105
|
var Sticker = class extends Structure {
|
|
3953
4106
|
static {
|
|
3954
4107
|
__name(this, "Sticker");
|
|
@@ -4005,6 +4158,182 @@ var Sticker = class extends Structure {
|
|
|
4005
4158
|
get type() {
|
|
4006
4159
|
return this[kData].type;
|
|
4007
4160
|
}
|
|
4161
|
+
/**
|
|
4162
|
+
* The timestamp the sticker was created at
|
|
4163
|
+
*/
|
|
4164
|
+
get createdTimestamp() {
|
|
4165
|
+
return isIdSet(this.id) ? DiscordSnowflake7.timestampFrom(this.id) : null;
|
|
4166
|
+
}
|
|
4167
|
+
/**
|
|
4168
|
+
* The time the sticker was created at
|
|
4169
|
+
*/
|
|
4170
|
+
get createdAt() {
|
|
4171
|
+
const createdTimestamp = this.createdTimestamp;
|
|
4172
|
+
return createdTimestamp ? new Date(createdTimestamp) : null;
|
|
4173
|
+
}
|
|
4174
|
+
};
|
|
4175
|
+
|
|
4176
|
+
// src/stickers/StickerPack.ts
|
|
4177
|
+
import { DiscordSnowflake as DiscordSnowflake8 } from "@sapphire/snowflake";
|
|
4178
|
+
var StickerPack = class extends Structure {
|
|
4179
|
+
static {
|
|
4180
|
+
__name(this, "StickerPack");
|
|
4181
|
+
}
|
|
4182
|
+
/**
|
|
4183
|
+
* The template used for removing data from the raw data stored for each sticker pack
|
|
4184
|
+
*/
|
|
4185
|
+
static DataTemplate = {};
|
|
4186
|
+
/**
|
|
4187
|
+
* @param data - The raw data received from the API for the sticker pack
|
|
4188
|
+
*/
|
|
4189
|
+
constructor(data) {
|
|
4190
|
+
super(data);
|
|
4191
|
+
}
|
|
4192
|
+
/**
|
|
4193
|
+
* The id of the sticker pack
|
|
4194
|
+
*/
|
|
4195
|
+
get id() {
|
|
4196
|
+
return this[kData].id;
|
|
4197
|
+
}
|
|
4198
|
+
/**
|
|
4199
|
+
* The name of the sticker pack
|
|
4200
|
+
*/
|
|
4201
|
+
get name() {
|
|
4202
|
+
return this[kData].name;
|
|
4203
|
+
}
|
|
4204
|
+
/**
|
|
4205
|
+
* The id of the pack's SKU
|
|
4206
|
+
*/
|
|
4207
|
+
get skuId() {
|
|
4208
|
+
return this[kData].sku_id;
|
|
4209
|
+
}
|
|
4210
|
+
/**
|
|
4211
|
+
* The id of a sticker in the pack which is shown as the pack's icon
|
|
4212
|
+
*/
|
|
4213
|
+
get coverStickerId() {
|
|
4214
|
+
return this[kData].cover_sticker_id;
|
|
4215
|
+
}
|
|
4216
|
+
/**
|
|
4217
|
+
* The description of the sticker pack
|
|
4218
|
+
*/
|
|
4219
|
+
get description() {
|
|
4220
|
+
return this[kData].description;
|
|
4221
|
+
}
|
|
4222
|
+
/**
|
|
4223
|
+
* The id of the sticker pack's banner image
|
|
4224
|
+
*
|
|
4225
|
+
* @see {@link https://discord.com/developers/docs/reference#image-formatting}
|
|
4226
|
+
*/
|
|
4227
|
+
get bannerAssetId() {
|
|
4228
|
+
return this[kData].banner_asset_id;
|
|
4229
|
+
}
|
|
4230
|
+
/**
|
|
4231
|
+
* The timestamp the sticker pack was created at
|
|
4232
|
+
*/
|
|
4233
|
+
get createdTimestamp() {
|
|
4234
|
+
return isIdSet(this.id) ? DiscordSnowflake8.timestampFrom(this.id) : null;
|
|
4235
|
+
}
|
|
4236
|
+
/**
|
|
4237
|
+
* The time the sticker pack was created at
|
|
4238
|
+
*/
|
|
4239
|
+
get createdAt() {
|
|
4240
|
+
const createdTimestamp = this.createdTimestamp;
|
|
4241
|
+
return createdTimestamp ? new Date(createdTimestamp) : null;
|
|
4242
|
+
}
|
|
4243
|
+
};
|
|
4244
|
+
|
|
4245
|
+
// src/teams/Team.ts
|
|
4246
|
+
import { DiscordSnowflake as DiscordSnowflake9 } from "@sapphire/snowflake";
|
|
4247
|
+
var Team = class extends Structure {
|
|
4248
|
+
static {
|
|
4249
|
+
__name(this, "Team");
|
|
4250
|
+
}
|
|
4251
|
+
/**
|
|
4252
|
+
* The template used for removing data from the raw data stored for each team.
|
|
4253
|
+
*/
|
|
4254
|
+
static DataTemplate = {};
|
|
4255
|
+
/**
|
|
4256
|
+
* @param data - The raw data received from the API for the team.
|
|
4257
|
+
*/
|
|
4258
|
+
constructor(data) {
|
|
4259
|
+
super(data);
|
|
4260
|
+
}
|
|
4261
|
+
/**
|
|
4262
|
+
* Hash of the image of the team's icon
|
|
4263
|
+
*/
|
|
4264
|
+
get icon() {
|
|
4265
|
+
return this[kData].icon;
|
|
4266
|
+
}
|
|
4267
|
+
/**
|
|
4268
|
+
* The unique id of the team
|
|
4269
|
+
*/
|
|
4270
|
+
get id() {
|
|
4271
|
+
return this[kData].id;
|
|
4272
|
+
}
|
|
4273
|
+
/**
|
|
4274
|
+
* Name of the team
|
|
4275
|
+
*/
|
|
4276
|
+
get name() {
|
|
4277
|
+
return this[kData].name;
|
|
4278
|
+
}
|
|
4279
|
+
/**
|
|
4280
|
+
* User ID of the current team owner
|
|
4281
|
+
*/
|
|
4282
|
+
get ownerUserId() {
|
|
4283
|
+
return this[kData].owner_user_id;
|
|
4284
|
+
}
|
|
4285
|
+
/**
|
|
4286
|
+
* The timestamp the team was created at
|
|
4287
|
+
*/
|
|
4288
|
+
get createdTimestamp() {
|
|
4289
|
+
return isIdSet(this.id) ? DiscordSnowflake9.timestampFrom(this.id) : null;
|
|
4290
|
+
}
|
|
4291
|
+
/**
|
|
4292
|
+
* The time the team was created at
|
|
4293
|
+
*/
|
|
4294
|
+
get createdAt() {
|
|
4295
|
+
const createdTimestamp = this.createdTimestamp;
|
|
4296
|
+
return createdTimestamp ? new Date(createdTimestamp) : null;
|
|
4297
|
+
}
|
|
4298
|
+
};
|
|
4299
|
+
|
|
4300
|
+
// src/teams/TeamMember.ts
|
|
4301
|
+
var TeamMember = class extends Structure {
|
|
4302
|
+
static {
|
|
4303
|
+
__name(this, "TeamMember");
|
|
4304
|
+
}
|
|
4305
|
+
/**
|
|
4306
|
+
* The template used for removing data from the raw data stored for each team member
|
|
4307
|
+
*/
|
|
4308
|
+
static DataTemplate = {};
|
|
4309
|
+
/**
|
|
4310
|
+
* @param data - The raw data received from the API for the team member
|
|
4311
|
+
*/
|
|
4312
|
+
constructor(data) {
|
|
4313
|
+
super(data);
|
|
4314
|
+
}
|
|
4315
|
+
/**
|
|
4316
|
+
* User's membership state on the team
|
|
4317
|
+
*
|
|
4318
|
+
* @see {@link https://discord.com/developers/docs/topics/teams#data-models-membership-state-enum}
|
|
4319
|
+
*/
|
|
4320
|
+
get membershipState() {
|
|
4321
|
+
return this[kData].membership_state;
|
|
4322
|
+
}
|
|
4323
|
+
/**
|
|
4324
|
+
* Id of the parent team of which they are a member
|
|
4325
|
+
*/
|
|
4326
|
+
get teamId() {
|
|
4327
|
+
return this[kData].team_id;
|
|
4328
|
+
}
|
|
4329
|
+
/**
|
|
4330
|
+
* Role of the team member
|
|
4331
|
+
*
|
|
4332
|
+
* @see {@link https://discord.com/developers/docs/topics/teams#team-member-roles-team-member-role-types}
|
|
4333
|
+
*/
|
|
4334
|
+
get role() {
|
|
4335
|
+
return this[kData].role;
|
|
4336
|
+
}
|
|
4008
4337
|
};
|
|
4009
4338
|
|
|
4010
4339
|
// src/users/AvatarDecorationData.ts
|
|
@@ -4037,7 +4366,7 @@ var AvatarDecorationData = class extends Structure {
|
|
|
4037
4366
|
};
|
|
4038
4367
|
|
|
4039
4368
|
// src/users/User.ts
|
|
4040
|
-
import { DiscordSnowflake as
|
|
4369
|
+
import { DiscordSnowflake as DiscordSnowflake10 } from "@sapphire/snowflake";
|
|
4041
4370
|
var User = class extends Structure {
|
|
4042
4371
|
static {
|
|
4043
4372
|
__name(this, "User");
|
|
@@ -4160,7 +4489,7 @@ var User = class extends Structure {
|
|
|
4160
4489
|
* The timestamp the user was created at
|
|
4161
4490
|
*/
|
|
4162
4491
|
get createdTimestamp() {
|
|
4163
|
-
return isIdSet(this.id) ?
|
|
4492
|
+
return isIdSet(this.id) ? DiscordSnowflake10.timestampFrom(this.id) : null;
|
|
4164
4493
|
}
|
|
4165
4494
|
/**
|
|
4166
4495
|
* The time the user was created at
|
|
@@ -4251,6 +4580,286 @@ var Connection = class extends Structure {
|
|
|
4251
4580
|
return this[kData].visibility;
|
|
4252
4581
|
}
|
|
4253
4582
|
};
|
|
4583
|
+
|
|
4584
|
+
// src/voice/VoiceState.ts
|
|
4585
|
+
var VoiceState = class extends Structure {
|
|
4586
|
+
static {
|
|
4587
|
+
__name(this, "VoiceState");
|
|
4588
|
+
}
|
|
4589
|
+
/**
|
|
4590
|
+
* The template used for removing data from the raw data stored for each voice state
|
|
4591
|
+
*/
|
|
4592
|
+
static DataTemplate = {};
|
|
4593
|
+
/**
|
|
4594
|
+
* @param data - The raw data received from the API for the voice state
|
|
4595
|
+
*/
|
|
4596
|
+
constructor(data) {
|
|
4597
|
+
super(data);
|
|
4598
|
+
}
|
|
4599
|
+
/**
|
|
4600
|
+
* The guild id this voice state is for
|
|
4601
|
+
*/
|
|
4602
|
+
get guildId() {
|
|
4603
|
+
return this[kData].guild_id;
|
|
4604
|
+
}
|
|
4605
|
+
/**
|
|
4606
|
+
* The channel id this user is connected to
|
|
4607
|
+
*/
|
|
4608
|
+
get channelId() {
|
|
4609
|
+
return this[kData].channel_id;
|
|
4610
|
+
}
|
|
4611
|
+
/**
|
|
4612
|
+
* The user id this voice state is for
|
|
4613
|
+
*/
|
|
4614
|
+
get userId() {
|
|
4615
|
+
return this[kData].user_id;
|
|
4616
|
+
}
|
|
4617
|
+
/**
|
|
4618
|
+
* The session id for this voice state
|
|
4619
|
+
*/
|
|
4620
|
+
get sessionId() {
|
|
4621
|
+
return this[kData].session_id;
|
|
4622
|
+
}
|
|
4623
|
+
/**
|
|
4624
|
+
* Whether this user is deafened by the server
|
|
4625
|
+
*/
|
|
4626
|
+
get deaf() {
|
|
4627
|
+
return this[kData].deaf;
|
|
4628
|
+
}
|
|
4629
|
+
/**
|
|
4630
|
+
* Whether this user is muted by the server
|
|
4631
|
+
*/
|
|
4632
|
+
get mute() {
|
|
4633
|
+
return this[kData].mute;
|
|
4634
|
+
}
|
|
4635
|
+
/**
|
|
4636
|
+
* Whether this user is locally deafened
|
|
4637
|
+
*/
|
|
4638
|
+
get selfDeaf() {
|
|
4639
|
+
return this[kData].self_deaf;
|
|
4640
|
+
}
|
|
4641
|
+
/**
|
|
4642
|
+
* Whether this user is locally muted
|
|
4643
|
+
*/
|
|
4644
|
+
get selfMute() {
|
|
4645
|
+
return this[kData].self_mute;
|
|
4646
|
+
}
|
|
4647
|
+
/**
|
|
4648
|
+
* Whether this user is streaming using "Go Live"
|
|
4649
|
+
*/
|
|
4650
|
+
get selfStream() {
|
|
4651
|
+
return this[kData].self_stream;
|
|
4652
|
+
}
|
|
4653
|
+
/**
|
|
4654
|
+
* Whether this user's camera is enabled
|
|
4655
|
+
*/
|
|
4656
|
+
get selfVideo() {
|
|
4657
|
+
return this[kData].self_video;
|
|
4658
|
+
}
|
|
4659
|
+
/**
|
|
4660
|
+
* Whether this user's permission to speak is denied
|
|
4661
|
+
*/
|
|
4662
|
+
get suppress() {
|
|
4663
|
+
return this[kData].suppress;
|
|
4664
|
+
}
|
|
4665
|
+
/**
|
|
4666
|
+
* The time at which the user requested to speak
|
|
4667
|
+
*/
|
|
4668
|
+
get requestToSpeakTimestamp() {
|
|
4669
|
+
return this[kData].request_to_speak_timestamp;
|
|
4670
|
+
}
|
|
4671
|
+
};
|
|
4672
|
+
|
|
4673
|
+
// src/voice/VoiceRegion.ts
|
|
4674
|
+
var VoiceRegion = class extends Structure {
|
|
4675
|
+
static {
|
|
4676
|
+
__name(this, "VoiceRegion");
|
|
4677
|
+
}
|
|
4678
|
+
/**
|
|
4679
|
+
* The template used for removing data from the raw data stored for each voice region
|
|
4680
|
+
*/
|
|
4681
|
+
static DataTemplate = {};
|
|
4682
|
+
/**
|
|
4683
|
+
* @param data - The raw data received from the API for the voice region
|
|
4684
|
+
*/
|
|
4685
|
+
constructor(data) {
|
|
4686
|
+
super(data);
|
|
4687
|
+
}
|
|
4688
|
+
/**
|
|
4689
|
+
* Unique id for the region
|
|
4690
|
+
*/
|
|
4691
|
+
get id() {
|
|
4692
|
+
return this[kData].id;
|
|
4693
|
+
}
|
|
4694
|
+
/**
|
|
4695
|
+
* Name of the region
|
|
4696
|
+
*/
|
|
4697
|
+
get name() {
|
|
4698
|
+
return this[kData].name;
|
|
4699
|
+
}
|
|
4700
|
+
/**
|
|
4701
|
+
* `true` for a single server that is closest to the current user's client
|
|
4702
|
+
*/
|
|
4703
|
+
get optimal() {
|
|
4704
|
+
return this[kData].optimal;
|
|
4705
|
+
}
|
|
4706
|
+
/**
|
|
4707
|
+
* Whether this is a deprecated voice region (avoid switching to these)
|
|
4708
|
+
*/
|
|
4709
|
+
get deprecated() {
|
|
4710
|
+
return this[kData].deprecated;
|
|
4711
|
+
}
|
|
4712
|
+
/**
|
|
4713
|
+
* Whether this is a custom voice region (used for events/etc)
|
|
4714
|
+
*/
|
|
4715
|
+
get custom() {
|
|
4716
|
+
return this[kData].custom;
|
|
4717
|
+
}
|
|
4718
|
+
};
|
|
4719
|
+
|
|
4720
|
+
// src/subscriptions/Subscription.ts
|
|
4721
|
+
import { DiscordSnowflake as DiscordSnowflake11 } from "@sapphire/snowflake";
|
|
4722
|
+
var Subscription = class extends Structure {
|
|
4723
|
+
static {
|
|
4724
|
+
__name(this, "Subscription");
|
|
4725
|
+
}
|
|
4726
|
+
/**
|
|
4727
|
+
* The template used for removing data from the raw data stored for each subscription
|
|
4728
|
+
*/
|
|
4729
|
+
static DataTemplate = {
|
|
4730
|
+
set current_period_start(_) {
|
|
4731
|
+
},
|
|
4732
|
+
set current_period_end(_) {
|
|
4733
|
+
},
|
|
4734
|
+
set canceled_at(_) {
|
|
4735
|
+
}
|
|
4736
|
+
};
|
|
4737
|
+
[kCurrentPeriodStartTimestamp] = null;
|
|
4738
|
+
[kCurrentPeriodEndTimestamp] = null;
|
|
4739
|
+
[kCanceledTimestamp] = null;
|
|
4740
|
+
/**
|
|
4741
|
+
* @param data - The raw data received from the API for the subscription
|
|
4742
|
+
*/
|
|
4743
|
+
constructor(data) {
|
|
4744
|
+
super(data);
|
|
4745
|
+
this.optimizeData(data);
|
|
4746
|
+
}
|
|
4747
|
+
/**
|
|
4748
|
+
* {@inheritDoc Structure.optimizeData}
|
|
4749
|
+
*/
|
|
4750
|
+
optimizeData(data) {
|
|
4751
|
+
const currentPeriodStartTimestamp = data.current_period_start;
|
|
4752
|
+
const currentPeriodEndTimestamp = data.current_period_end;
|
|
4753
|
+
const canceledTimestamp = data.canceled_at;
|
|
4754
|
+
if (currentPeriodStartTimestamp) {
|
|
4755
|
+
this[kCurrentPeriodStartTimestamp] = Date.parse(currentPeriodStartTimestamp);
|
|
4756
|
+
}
|
|
4757
|
+
if (currentPeriodEndTimestamp) {
|
|
4758
|
+
this[kCurrentPeriodEndTimestamp] = Date.parse(currentPeriodEndTimestamp);
|
|
4759
|
+
}
|
|
4760
|
+
if (canceledTimestamp) {
|
|
4761
|
+
this[kCanceledTimestamp] = Date.parse(canceledTimestamp);
|
|
4762
|
+
}
|
|
4763
|
+
}
|
|
4764
|
+
/**
|
|
4765
|
+
* The subscription's id
|
|
4766
|
+
*
|
|
4767
|
+
* @remarks The start of a subscription is determined by its id. When the subscription renews, its current period is updated.
|
|
4768
|
+
*/
|
|
4769
|
+
get id() {
|
|
4770
|
+
return this[kData].id;
|
|
4771
|
+
}
|
|
4772
|
+
/**
|
|
4773
|
+
* Id of the user who is subscribed
|
|
4774
|
+
*/
|
|
4775
|
+
get userId() {
|
|
4776
|
+
return this[kData].user_id;
|
|
4777
|
+
}
|
|
4778
|
+
/**
|
|
4779
|
+
* List of SKUs subscribed to
|
|
4780
|
+
*/
|
|
4781
|
+
get skuIds() {
|
|
4782
|
+
return this[kData].sku_ids;
|
|
4783
|
+
}
|
|
4784
|
+
/**
|
|
4785
|
+
* List of entitlements granted for this subscription
|
|
4786
|
+
*/
|
|
4787
|
+
get entitlementIds() {
|
|
4788
|
+
return this[kData].entitlement_ids;
|
|
4789
|
+
}
|
|
4790
|
+
/**
|
|
4791
|
+
* List of SKUs that this user will be subscribed to at renewal
|
|
4792
|
+
*/
|
|
4793
|
+
get renewalSkuIds() {
|
|
4794
|
+
return this[kData].renewal_sku_ids;
|
|
4795
|
+
}
|
|
4796
|
+
/**
|
|
4797
|
+
* Timestamp of start of the current subscription period
|
|
4798
|
+
*/
|
|
4799
|
+
get currentPeriodStartTimestamp() {
|
|
4800
|
+
return this[kCurrentPeriodStartTimestamp];
|
|
4801
|
+
}
|
|
4802
|
+
/**
|
|
4803
|
+
* The time at which the current subscription period will start
|
|
4804
|
+
*/
|
|
4805
|
+
get currentPeriodStartAt() {
|
|
4806
|
+
const startTimestamp = this.currentPeriodStartTimestamp;
|
|
4807
|
+
return startTimestamp ? new Date(startTimestamp) : null;
|
|
4808
|
+
}
|
|
4809
|
+
/**
|
|
4810
|
+
* Timestamp of end of the current subscription period
|
|
4811
|
+
*/
|
|
4812
|
+
get currentPeriodEndTimestamp() {
|
|
4813
|
+
return this[kCurrentPeriodEndTimestamp];
|
|
4814
|
+
}
|
|
4815
|
+
/**
|
|
4816
|
+
* The time at which the current subscription period will end
|
|
4817
|
+
*/
|
|
4818
|
+
get currentPeriodEndsAt() {
|
|
4819
|
+
const endTimestamp = this.currentPeriodEndTimestamp;
|
|
4820
|
+
return endTimestamp ? new Date(endTimestamp) : null;
|
|
4821
|
+
}
|
|
4822
|
+
/**
|
|
4823
|
+
* The {@link SubscriptionStatus} of the current subscription
|
|
4824
|
+
*/
|
|
4825
|
+
get status() {
|
|
4826
|
+
return this[kData].status;
|
|
4827
|
+
}
|
|
4828
|
+
/**
|
|
4829
|
+
* Timestamp when the subscription was canceled
|
|
4830
|
+
*/
|
|
4831
|
+
get canceledTimestamp() {
|
|
4832
|
+
return this[kCanceledTimestamp];
|
|
4833
|
+
}
|
|
4834
|
+
/**
|
|
4835
|
+
* The time when the subscription was canceled
|
|
4836
|
+
*
|
|
4837
|
+
* @remarks This is populated when the {@link Subscription#status} transitions to {@link SubscriptionStatus.Ending}.
|
|
4838
|
+
*/
|
|
4839
|
+
get canceledAt() {
|
|
4840
|
+
const canceledTimestamp = this.canceledTimestamp;
|
|
4841
|
+
return canceledTimestamp ? new Date(canceledTimestamp) : null;
|
|
4842
|
+
}
|
|
4843
|
+
/**
|
|
4844
|
+
* ISO3166-1 alpha-2 country code of the payment source used to purchase the subscription. Missing unless queried with a private OAuth scope.
|
|
4845
|
+
*/
|
|
4846
|
+
get country() {
|
|
4847
|
+
return this[kData].country;
|
|
4848
|
+
}
|
|
4849
|
+
/**
|
|
4850
|
+
* The timestamp the subscription was created at
|
|
4851
|
+
*/
|
|
4852
|
+
get createdTimestamp() {
|
|
4853
|
+
return isIdSet(this.id) ? DiscordSnowflake11.timestampFrom(this.id) : null;
|
|
4854
|
+
}
|
|
4855
|
+
/**
|
|
4856
|
+
* The time the subscription was created at
|
|
4857
|
+
*/
|
|
4858
|
+
get createdAt() {
|
|
4859
|
+
const createdTimestamp = this.createdTimestamp;
|
|
4860
|
+
return createdTimestamp ? new Date(createdTimestamp) : null;
|
|
4861
|
+
}
|
|
4862
|
+
};
|
|
4254
4863
|
export {
|
|
4255
4864
|
ActionRowComponent,
|
|
4256
4865
|
AnnouncementChannel,
|
|
@@ -4339,11 +4948,17 @@ export {
|
|
|
4339
4948
|
SelectMenuComponent,
|
|
4340
4949
|
SelectMenuDefaultValue,
|
|
4341
4950
|
SeparatorComponent,
|
|
4951
|
+
SoundboardSound,
|
|
4342
4952
|
StageChannel,
|
|
4953
|
+
StageInstance,
|
|
4343
4954
|
Sticker,
|
|
4955
|
+
StickerPack,
|
|
4344
4956
|
StringSelectMenuComponent,
|
|
4345
4957
|
StringSelectMenuOption,
|
|
4346
4958
|
Structure,
|
|
4959
|
+
Subscription,
|
|
4960
|
+
Team,
|
|
4961
|
+
TeamMember,
|
|
4347
4962
|
TextChannel,
|
|
4348
4963
|
TextChannelMixin,
|
|
4349
4964
|
TextDisplayComponent,
|
|
@@ -4357,6 +4972,8 @@ export {
|
|
|
4357
4972
|
UserSelectMenuComponent,
|
|
4358
4973
|
VoiceChannel,
|
|
4359
4974
|
VoiceChannelMixin,
|
|
4975
|
+
VoiceRegion,
|
|
4976
|
+
VoiceState,
|
|
4360
4977
|
dateToDiscordISOTimestamp,
|
|
4361
4978
|
extendTemplate
|
|
4362
4979
|
};
|