@zygout/eris 0.19.0 → 0.19.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/LICENSE +20 -20
- package/README.md +109 -80
- package/esm.mjs +72 -72
- package/index.d.ts +4407 -4397
- package/index.js +75 -75
- package/lib/Client.js +4708 -4683
- package/lib/Constants.d.ts +990 -988
- package/lib/Constants.js +1163 -1161
- package/lib/command/Command.js +552 -552
- package/lib/command/CommandClient.js +460 -460
- package/lib/errors/DiscordHTTPError.js +63 -63
- package/lib/errors/DiscordRESTError.js +77 -77
- package/lib/gateway/Shard.js +3029 -3029
- package/lib/gateway/ShardManager.js +164 -164
- package/lib/rest/Endpoints.js +172 -172
- package/lib/rest/RequestHandler.js +459 -459
- package/lib/structures/ApplicationCommand.js +125 -125
- package/lib/structures/AutoModerationRule.js +143 -143
- package/lib/structures/AutocompleteInteraction.js +80 -80
- package/lib/structures/Base.js +81 -81
- package/lib/structures/CategoryChannel.js +77 -77
- package/lib/structures/Channel.js +98 -98
- package/lib/structures/CommandInteraction.js +473 -473
- package/lib/structures/ComponentInteraction.js +538 -538
- package/lib/structures/DMChannel.js +278 -278
- package/lib/structures/Entitlement.js +77 -77
- package/lib/structures/ExtendedUser.js +46 -46
- package/lib/structures/ForumChannel.js +24 -24
- package/lib/structures/GroupChannel.js +106 -106
- package/lib/structures/Guild.js +1677 -1677
- package/lib/structures/GuildAuditLogEntry.js +190 -190
- package/lib/structures/GuildChannel.js +128 -128
- package/lib/structures/GuildIntegration.js +99 -99
- package/lib/structures/GuildPreview.js +97 -97
- package/lib/structures/GuildScheduledEvent.js +176 -176
- package/lib/structures/GuildTemplate.js +76 -76
- package/lib/structures/GuildTextableChannel.js +260 -260
- package/lib/structures/Interaction.js +133 -133
- package/lib/structures/Invite.js +143 -143
- package/lib/structures/Lobby.js +108 -108
- package/lib/structures/LobbyMember.js +59 -59
- package/lib/structures/MediaChannel.js +216 -216
- package/lib/structures/Member.js +371 -371
- package/lib/structures/Message.js +708 -708
- package/lib/structures/ModalSubmitInteraction.js +478 -478
- package/lib/structures/NewsChannel.js +34 -34
- package/lib/structures/NewsThreadChannel.js +12 -12
- package/lib/structures/Permission.js +80 -80
- package/lib/structures/PermissionOverwrite.js +32 -32
- package/lib/structures/PingInteraction.js +39 -39
- package/lib/structures/PrivateThreadChannel.js +25 -25
- package/lib/structures/PublicThreadChannel.js +26 -26
- package/lib/structures/Role.js +163 -163
- package/lib/structures/SKU.js +80 -80
- package/lib/structures/SoundboardSound.js +79 -79
- package/lib/structures/StageChannel.js +59 -59
- package/lib/structures/StageInstance.js +55 -55
- package/lib/structures/Subscription.js +69 -69
- package/lib/structures/TextChannel.js +202 -202
- package/lib/structures/ThreadChannel.js +143 -143
- package/lib/structures/ThreadMember.js +59 -59
- package/lib/structures/UnavailableGuild.js +26 -26
- package/lib/structures/UnknownInteraction.js +502 -502
- package/lib/structures/User.js +296 -296
- package/lib/structures/VoiceChannel.js +166 -166
- package/lib/structures/VoiceState.js +84 -84
- package/lib/util/BrowserWebSocket.js +76 -76
- package/lib/util/Bucket.js +89 -89
- package/lib/util/Collection.js +202 -202
- package/lib/util/MultipartData.js +70 -70
- package/lib/util/Opus.js +33 -33
- package/lib/util/SequentialBucket.js +83 -83
- package/lib/util/emitDeprecation.js +26 -26
- package/lib/voice/Piper.js +300 -300
- package/lib/voice/SharedStream.js +238 -238
- package/lib/voice/VoiceConnection.js +1440 -1440
- package/lib/voice/VoiceConnectionManager.js +151 -151
- package/lib/voice/VoiceDataStream.js +22 -22
- package/lib/voice/streams/BaseTransformer.js +40 -40
- package/lib/voice/streams/DCAOpusTransformer.js +78 -78
- package/lib/voice/streams/FFmpegDuplex.js +192 -192
- package/lib/voice/streams/FFmpegOggTransformer.js +35 -35
- package/lib/voice/streams/FFmpegPCMTransformer.js +26 -26
- package/lib/voice/streams/OggOpusTransformer.js +108 -108
- package/lib/voice/streams/PCMOpusTransformer.js +61 -61
- package/lib/voice/streams/VolumeTransformer.js +50 -50
- package/lib/voice/streams/WebmOpusTransformer.js +258 -258
- package/package.json +83 -82
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const VoiceChannel = require("./VoiceChannel");
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Represents a guild stage channel. See VoiceChannel for more properties and methods.
|
|
7
|
-
* @extends VoiceChannel
|
|
8
|
-
*/
|
|
9
|
-
class StageChannel extends VoiceChannel {
|
|
10
|
-
update(data) {
|
|
11
|
-
super.update(data);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Create a stage instance
|
|
16
|
-
* @arg {Object} options The stage instance options
|
|
17
|
-
* @arg {Number} [options.privacyLevel] The privacy level of the stage instance. 1 is public, 2 is guild only
|
|
18
|
-
* @arg {String} options.topic The stage instance topic
|
|
19
|
-
* @returns {Promise<StageInstance>}
|
|
20
|
-
*/
|
|
21
|
-
createInstance(options) {
|
|
22
|
-
return this._client.createStageInstance.call(this._client, this.id, options);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Delete the stage instance for this channel
|
|
27
|
-
* @returns {Promise}
|
|
28
|
-
*/
|
|
29
|
-
deleteInstance() {
|
|
30
|
-
return this._client.deleteStageInstance.call(this._client, this.id);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Update the stage instance for this channel
|
|
35
|
-
* @arg {Object} options The properties to edit
|
|
36
|
-
* @arg {Number} [options.privacyLevel] The privacy level of the stage instance. 1 is public, 2 is guild only
|
|
37
|
-
* @arg {String} [options.topic] The stage instance topic
|
|
38
|
-
* @returns {Promise<StageInstance>}
|
|
39
|
-
*/
|
|
40
|
-
editInstance(options) {
|
|
41
|
-
return this._client.editStageInstance.call(this._client, this.id, options);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Get the stage instance for this channel
|
|
46
|
-
* @returns {Promise<StageInstance>}
|
|
47
|
-
*/
|
|
48
|
-
getInstance() {
|
|
49
|
-
return this._client.getStageInstance.call(this._client, this.id);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
toJSON(props = []) {
|
|
53
|
-
return super.toJSON([
|
|
54
|
-
...props,
|
|
55
|
-
]);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
module.exports = StageChannel;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const VoiceChannel = require("./VoiceChannel");
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Represents a guild stage channel. See VoiceChannel for more properties and methods.
|
|
7
|
+
* @extends VoiceChannel
|
|
8
|
+
*/
|
|
9
|
+
class StageChannel extends VoiceChannel {
|
|
10
|
+
update(data) {
|
|
11
|
+
super.update(data);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Create a stage instance
|
|
16
|
+
* @arg {Object} options The stage instance options
|
|
17
|
+
* @arg {Number} [options.privacyLevel] The privacy level of the stage instance. 1 is public, 2 is guild only
|
|
18
|
+
* @arg {String} options.topic The stage instance topic
|
|
19
|
+
* @returns {Promise<StageInstance>}
|
|
20
|
+
*/
|
|
21
|
+
createInstance(options) {
|
|
22
|
+
return this._client.createStageInstance.call(this._client, this.id, options);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Delete the stage instance for this channel
|
|
27
|
+
* @returns {Promise}
|
|
28
|
+
*/
|
|
29
|
+
deleteInstance() {
|
|
30
|
+
return this._client.deleteStageInstance.call(this._client, this.id);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Update the stage instance for this channel
|
|
35
|
+
* @arg {Object} options The properties to edit
|
|
36
|
+
* @arg {Number} [options.privacyLevel] The privacy level of the stage instance. 1 is public, 2 is guild only
|
|
37
|
+
* @arg {String} [options.topic] The stage instance topic
|
|
38
|
+
* @returns {Promise<StageInstance>}
|
|
39
|
+
*/
|
|
40
|
+
editInstance(options) {
|
|
41
|
+
return this._client.editStageInstance.call(this._client, this.id, options);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Get the stage instance for this channel
|
|
46
|
+
* @returns {Promise<StageInstance>}
|
|
47
|
+
*/
|
|
48
|
+
getInstance() {
|
|
49
|
+
return this._client.getStageInstance.call(this._client, this.id);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
toJSON(props = []) {
|
|
53
|
+
return super.toJSON([
|
|
54
|
+
...props,
|
|
55
|
+
]);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
module.exports = StageChannel;
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const Base = require("./Base");
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Represents a stage instance
|
|
7
|
-
* @prop {StageChannel} channel The associated stage channel
|
|
8
|
-
* @prop {Boolean} discoverableDisabled Whether or not stage discovery is disabled
|
|
9
|
-
* @prop {Guild} guild The guild of the associated stage channel
|
|
10
|
-
* @prop {String} id The ID of the stage instance
|
|
11
|
-
* @prop {Number} privacyLevel The privacy level of the stage instance. 1 is public, 2 is guild only
|
|
12
|
-
* @prop {String} topic The stage instance topic
|
|
13
|
-
*/
|
|
14
|
-
class StageInstance extends Base {
|
|
15
|
-
constructor(data, client) {
|
|
16
|
-
super(data.id);
|
|
17
|
-
this._client = client;
|
|
18
|
-
this.channel = client.getChannel(data.channel_id) || { id: data.channel_id };
|
|
19
|
-
this.guild = client.guilds.get(data.guild_id) || { id: data.guild_id };
|
|
20
|
-
this.update(data);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
update(data) {
|
|
24
|
-
if (data.discoverable_disabled !== undefined) {
|
|
25
|
-
this.discoverableDisabled = data.discoverable_disabled;
|
|
26
|
-
}
|
|
27
|
-
if (data.privacy_level !== undefined) {
|
|
28
|
-
this.privacyLevel = data.privacy_level;
|
|
29
|
-
}
|
|
30
|
-
if (data.topic !== undefined) {
|
|
31
|
-
this.topic = data.topic;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Delete this stage instance
|
|
37
|
-
* @returns {Promise}
|
|
38
|
-
*/
|
|
39
|
-
delete() {
|
|
40
|
-
return this._client.deleteStageInstance.call(this._client, this.channel.id);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Update this stage instance
|
|
45
|
-
* @arg {Object} options The properties to edit
|
|
46
|
-
* @arg {Number} [options.privacyLevel] The privacy level of the stage instance. 1 is public, 2 is guild only
|
|
47
|
-
* @arg {String} [options.topic] The stage instance topic
|
|
48
|
-
* @returns {Promise<StageInstance>}
|
|
49
|
-
*/
|
|
50
|
-
edit(options) {
|
|
51
|
-
return this._client.editStageInstance.call(this._client, this.channel.id, options);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
module.exports = StageInstance;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const Base = require("./Base");
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Represents a stage instance
|
|
7
|
+
* @prop {StageChannel} channel The associated stage channel
|
|
8
|
+
* @prop {Boolean} discoverableDisabled Whether or not stage discovery is disabled
|
|
9
|
+
* @prop {Guild} guild The guild of the associated stage channel
|
|
10
|
+
* @prop {String} id The ID of the stage instance
|
|
11
|
+
* @prop {Number} privacyLevel The privacy level of the stage instance. 1 is public, 2 is guild only
|
|
12
|
+
* @prop {String} topic The stage instance topic
|
|
13
|
+
*/
|
|
14
|
+
class StageInstance extends Base {
|
|
15
|
+
constructor(data, client) {
|
|
16
|
+
super(data.id);
|
|
17
|
+
this._client = client;
|
|
18
|
+
this.channel = client.getChannel(data.channel_id) || { id: data.channel_id };
|
|
19
|
+
this.guild = client.guilds.get(data.guild_id) || { id: data.guild_id };
|
|
20
|
+
this.update(data);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
update(data) {
|
|
24
|
+
if (data.discoverable_disabled !== undefined) {
|
|
25
|
+
this.discoverableDisabled = data.discoverable_disabled;
|
|
26
|
+
}
|
|
27
|
+
if (data.privacy_level !== undefined) {
|
|
28
|
+
this.privacyLevel = data.privacy_level;
|
|
29
|
+
}
|
|
30
|
+
if (data.topic !== undefined) {
|
|
31
|
+
this.topic = data.topic;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Delete this stage instance
|
|
37
|
+
* @returns {Promise}
|
|
38
|
+
*/
|
|
39
|
+
delete() {
|
|
40
|
+
return this._client.deleteStageInstance.call(this._client, this.channel.id);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Update this stage instance
|
|
45
|
+
* @arg {Object} options The properties to edit
|
|
46
|
+
* @arg {Number} [options.privacyLevel] The privacy level of the stage instance. 1 is public, 2 is guild only
|
|
47
|
+
* @arg {String} [options.topic] The stage instance topic
|
|
48
|
+
* @returns {Promise<StageInstance>}
|
|
49
|
+
*/
|
|
50
|
+
edit(options) {
|
|
51
|
+
return this._client.editStageInstance.call(this._client, this.channel.id, options);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
module.exports = StageInstance;
|
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const Base = require("./Base");
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Represents a subscription to a premium application SKU
|
|
7
|
-
* @prop {Number?} canceledAt Timestamp of when the subscription was canceled
|
|
8
|
-
* @prop {String?} country The ISO3166-1 alpha-2 country code of the payment source used to purchase the subscription. Missing unless queried with a private OAuth scope
|
|
9
|
-
* @prop {Number} currentPeriodEnd Timestamp of the end of the current subscription period
|
|
10
|
-
* @prop {Number} currentPeriodStart Timestamp of the start of the current subscription period
|
|
11
|
-
* @prop {Array<String>} entitlementIDs The IDs of the entitlements granted for this subscription
|
|
12
|
-
* @prop {String} id The ID of the subscription
|
|
13
|
-
* @prop {Array<String>?} renewalSKUIDs The IDs of the SKUs that this user will be subscribed to at renewal
|
|
14
|
-
* @prop {Array<String>} skuIDs The IDs of the SKUs subscribed to
|
|
15
|
-
* @prop {Number} status The current status of the subscription. See [the official Discord API documentation entry](https://discord.com/developers/docs/resources/subscription#subscription-statuses) for a list of statuses
|
|
16
|
-
* @prop {String} userID The ID of the user who is subscribed
|
|
17
|
-
*/
|
|
18
|
-
class Subscription extends Base {
|
|
19
|
-
constructor(data, client) {
|
|
20
|
-
super(data.id);
|
|
21
|
-
this._client = client;
|
|
22
|
-
this.userID = data.user_id;
|
|
23
|
-
this.update(data);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
update(data) {
|
|
27
|
-
if (data.canceled_at !== undefined) {
|
|
28
|
-
this.canceledAt = data.canceled_at ? Date.parse(data.canceled_at) : null;
|
|
29
|
-
}
|
|
30
|
-
if (data.country !== undefined) {
|
|
31
|
-
this.country = data.country;
|
|
32
|
-
}
|
|
33
|
-
if (data.current_period_end !== undefined) {
|
|
34
|
-
this.currentPeriodEnd = Date.parse(data.current_period_end);
|
|
35
|
-
}
|
|
36
|
-
if (data.current_period_start !== undefined) {
|
|
37
|
-
this.currentPeriodStart = Date.parse(data.current_period_start);
|
|
38
|
-
}
|
|
39
|
-
if (data.entitlement_ids !== undefined) {
|
|
40
|
-
this.entitlementIDs = data.entitlement_ids;
|
|
41
|
-
}
|
|
42
|
-
if (data.renewal_sku_ids !== undefined) {
|
|
43
|
-
this.renewalSKUIDs = data.renewal_sku_ids;
|
|
44
|
-
}
|
|
45
|
-
if (data.sku_ids !== undefined) {
|
|
46
|
-
this.skuIDs = data.sku_ids;
|
|
47
|
-
}
|
|
48
|
-
if (data.status !== undefined) {
|
|
49
|
-
this.status = data.status;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
toJSON(props = []) {
|
|
54
|
-
return super.toJSON([
|
|
55
|
-
"canceledAt",
|
|
56
|
-
"country",
|
|
57
|
-
"currentPeriodEnd",
|
|
58
|
-
"currentPeriodStart",
|
|
59
|
-
"entitlementIDs",
|
|
60
|
-
"renewalSKUIDs",
|
|
61
|
-
"skuIDs",
|
|
62
|
-
"status",
|
|
63
|
-
"userID",
|
|
64
|
-
...props,
|
|
65
|
-
]);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
module.exports = Subscription;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const Base = require("./Base");
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Represents a subscription to a premium application SKU
|
|
7
|
+
* @prop {Number?} canceledAt Timestamp of when the subscription was canceled
|
|
8
|
+
* @prop {String?} country The ISO3166-1 alpha-2 country code of the payment source used to purchase the subscription. Missing unless queried with a private OAuth scope
|
|
9
|
+
* @prop {Number} currentPeriodEnd Timestamp of the end of the current subscription period
|
|
10
|
+
* @prop {Number} currentPeriodStart Timestamp of the start of the current subscription period
|
|
11
|
+
* @prop {Array<String>} entitlementIDs The IDs of the entitlements granted for this subscription
|
|
12
|
+
* @prop {String} id The ID of the subscription
|
|
13
|
+
* @prop {Array<String>?} renewalSKUIDs The IDs of the SKUs that this user will be subscribed to at renewal
|
|
14
|
+
* @prop {Array<String>} skuIDs The IDs of the SKUs subscribed to
|
|
15
|
+
* @prop {Number} status The current status of the subscription. See [the official Discord API documentation entry](https://discord.com/developers/docs/resources/subscription#subscription-statuses) for a list of statuses
|
|
16
|
+
* @prop {String} userID The ID of the user who is subscribed
|
|
17
|
+
*/
|
|
18
|
+
class Subscription extends Base {
|
|
19
|
+
constructor(data, client) {
|
|
20
|
+
super(data.id);
|
|
21
|
+
this._client = client;
|
|
22
|
+
this.userID = data.user_id;
|
|
23
|
+
this.update(data);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
update(data) {
|
|
27
|
+
if (data.canceled_at !== undefined) {
|
|
28
|
+
this.canceledAt = data.canceled_at ? Date.parse(data.canceled_at) : null;
|
|
29
|
+
}
|
|
30
|
+
if (data.country !== undefined) {
|
|
31
|
+
this.country = data.country;
|
|
32
|
+
}
|
|
33
|
+
if (data.current_period_end !== undefined) {
|
|
34
|
+
this.currentPeriodEnd = Date.parse(data.current_period_end);
|
|
35
|
+
}
|
|
36
|
+
if (data.current_period_start !== undefined) {
|
|
37
|
+
this.currentPeriodStart = Date.parse(data.current_period_start);
|
|
38
|
+
}
|
|
39
|
+
if (data.entitlement_ids !== undefined) {
|
|
40
|
+
this.entitlementIDs = data.entitlement_ids;
|
|
41
|
+
}
|
|
42
|
+
if (data.renewal_sku_ids !== undefined) {
|
|
43
|
+
this.renewalSKUIDs = data.renewal_sku_ids;
|
|
44
|
+
}
|
|
45
|
+
if (data.sku_ids !== undefined) {
|
|
46
|
+
this.skuIDs = data.sku_ids;
|
|
47
|
+
}
|
|
48
|
+
if (data.status !== undefined) {
|
|
49
|
+
this.status = data.status;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
toJSON(props = []) {
|
|
54
|
+
return super.toJSON([
|
|
55
|
+
"canceledAt",
|
|
56
|
+
"country",
|
|
57
|
+
"currentPeriodEnd",
|
|
58
|
+
"currentPeriodStart",
|
|
59
|
+
"entitlementIDs",
|
|
60
|
+
"renewalSKUIDs",
|
|
61
|
+
"skuIDs",
|
|
62
|
+
"status",
|
|
63
|
+
"userID",
|
|
64
|
+
...props,
|
|
65
|
+
]);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
module.exports = Subscription;
|