@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
package/lib/structures/Lobby.js
CHANGED
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const Base = require("./Base");
|
|
4
|
-
const Collection = require("../util/Collection");
|
|
5
|
-
const LobbyMember = require("./LobbyMember");
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Represents a lobby, a group of users of an application who can chat together, for example in a game through the Discord Social SDK
|
|
9
|
-
* @prop {String} applicationID The ID of the application that created the lobby
|
|
10
|
-
* @prop {String} id The ID of the lobby
|
|
11
|
-
* @prop {(TextChannel | NewsChannel | VoiceChannel | StageChannel | ForumChannel | MediaChannel | ThreadChannel)?} linkedChannel The guild channel linked to the lobby, if any
|
|
12
|
-
* @prop {Collection<LobbyMember>} members The members of the lobby
|
|
13
|
-
* @prop {Object<String, String>?} metadata The metadata of the lobby, as key/value pairs
|
|
14
|
-
*/
|
|
15
|
-
class Lobby extends Base {
|
|
16
|
-
constructor(data, client) {
|
|
17
|
-
super(data.id);
|
|
18
|
-
this._client = client;
|
|
19
|
-
this.applicationID = data.application_id;
|
|
20
|
-
this.linkedChannel = data.linked_channel ? client.getChannel(data.linked_channel.id) || Channel.from(data.linked_channel, client) : null;
|
|
21
|
-
this.members = new Collection(LobbyMember);
|
|
22
|
-
if (data.members) {
|
|
23
|
-
for (const member of data.members) {
|
|
24
|
-
this.members.add(new LobbyMember(member, client, this.id));
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
this.metadata = data.metadata !== undefined ? data.metadata : null;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Add a user to this lobby, or update them if they are already a member
|
|
32
|
-
* @arg {String} userID The ID of the user
|
|
33
|
-
* @arg {Object} [options] The properties of the member. See `Client#addLobbyMember` for the full list of options
|
|
34
|
-
* @returns {Promise<LobbyMember>}
|
|
35
|
-
*/
|
|
36
|
-
addMember(userID, options) {
|
|
37
|
-
return this._client.addLobbyMember.call(this._client, this.id, userID, options);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Add, update or remove up to 25 members of this lobby
|
|
42
|
-
* @arg {Array<Object>} members The members to add, update or remove. See `Client#bulkEditLobbyMembers` for the full list of options
|
|
43
|
-
* @returns {Promise<Array<LobbyMember>>} The added and updated members
|
|
44
|
-
*/
|
|
45
|
-
bulkEditMembers(members) {
|
|
46
|
-
return this._client.bulkEditLobbyMembers.call(this._client, this.id, members);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Create a single-use invite to the channel linked to this lobby for a member. The invite expires after one hour
|
|
51
|
-
* @arg {String} userID The ID of the member
|
|
52
|
-
* @returns {Promise<Object>} An object containing the invite `code`
|
|
53
|
-
*/
|
|
54
|
-
createChannelInvite(userID) {
|
|
55
|
-
return this._client.createLobbyChannelInvite.call(this._client, this.id, userID);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Delete this lobby
|
|
60
|
-
* @returns {Promise}
|
|
61
|
-
*/
|
|
62
|
-
delete() {
|
|
63
|
-
return this._client.deleteLobby.call(this._client, this.id);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Edit this lobby
|
|
68
|
-
* @arg {Object} options The properties to edit. See `Client#editLobby` for the full list of options
|
|
69
|
-
* @returns {Promise<Lobby>}
|
|
70
|
-
*/
|
|
71
|
-
edit(options) {
|
|
72
|
-
return this._client.editLobby.call(this._client, this.id, options);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Set the moderation metadata of a message of this lobby
|
|
77
|
-
* @arg {String} messageID The ID of the message
|
|
78
|
-
* @arg {Object<String, String>} metadata The moderation metadata, as key/value pairs. See `Client#editLobbyMessageModerationMetadata` for the limits
|
|
79
|
-
* @returns {Promise}
|
|
80
|
-
*/
|
|
81
|
-
editMessageModerationMetadata(messageID, metadata) {
|
|
82
|
-
return this._client.editLobbyMessageModerationMetadata.call(this._client, this.id, messageID, metadata);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Remove a member from this lobby
|
|
87
|
-
* @arg {String} userID The ID of the member
|
|
88
|
-
* @returns {Promise}
|
|
89
|
-
*/
|
|
90
|
-
removeMember(userID) {
|
|
91
|
-
return this._client.removeLobbyMember.call(this._client, this.id, userID);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
toJSON(props = []) {
|
|
95
|
-
return super.toJSON([
|
|
96
|
-
"applicationID",
|
|
97
|
-
"linkedChannel",
|
|
98
|
-
"members",
|
|
99
|
-
"metadata",
|
|
100
|
-
...props,
|
|
101
|
-
]);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
module.exports = Lobby;
|
|
106
|
-
|
|
107
|
-
// Circular import
|
|
108
|
-
const Channel = require("./Channel");
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const Base = require("./Base");
|
|
4
|
+
const Collection = require("../util/Collection");
|
|
5
|
+
const LobbyMember = require("./LobbyMember");
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Represents a lobby, a group of users of an application who can chat together, for example in a game through the Discord Social SDK
|
|
9
|
+
* @prop {String} applicationID The ID of the application that created the lobby
|
|
10
|
+
* @prop {String} id The ID of the lobby
|
|
11
|
+
* @prop {(TextChannel | NewsChannel | VoiceChannel | StageChannel | ForumChannel | MediaChannel | ThreadChannel)?} linkedChannel The guild channel linked to the lobby, if any
|
|
12
|
+
* @prop {Collection<LobbyMember>} members The members of the lobby
|
|
13
|
+
* @prop {Object<String, String>?} metadata The metadata of the lobby, as key/value pairs
|
|
14
|
+
*/
|
|
15
|
+
class Lobby extends Base {
|
|
16
|
+
constructor(data, client) {
|
|
17
|
+
super(data.id);
|
|
18
|
+
this._client = client;
|
|
19
|
+
this.applicationID = data.application_id;
|
|
20
|
+
this.linkedChannel = data.linked_channel ? client.getChannel(data.linked_channel.id) || Channel.from(data.linked_channel, client) : null;
|
|
21
|
+
this.members = new Collection(LobbyMember);
|
|
22
|
+
if (data.members) {
|
|
23
|
+
for (const member of data.members) {
|
|
24
|
+
this.members.add(new LobbyMember(member, client, this.id));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
this.metadata = data.metadata !== undefined ? data.metadata : null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Add a user to this lobby, or update them if they are already a member
|
|
32
|
+
* @arg {String} userID The ID of the user
|
|
33
|
+
* @arg {Object} [options] The properties of the member. See `Client#addLobbyMember` for the full list of options
|
|
34
|
+
* @returns {Promise<LobbyMember>}
|
|
35
|
+
*/
|
|
36
|
+
addMember(userID, options) {
|
|
37
|
+
return this._client.addLobbyMember.call(this._client, this.id, userID, options);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Add, update or remove up to 25 members of this lobby
|
|
42
|
+
* @arg {Array<Object>} members The members to add, update or remove. See `Client#bulkEditLobbyMembers` for the full list of options
|
|
43
|
+
* @returns {Promise<Array<LobbyMember>>} The added and updated members
|
|
44
|
+
*/
|
|
45
|
+
bulkEditMembers(members) {
|
|
46
|
+
return this._client.bulkEditLobbyMembers.call(this._client, this.id, members);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Create a single-use invite to the channel linked to this lobby for a member. The invite expires after one hour
|
|
51
|
+
* @arg {String} userID The ID of the member
|
|
52
|
+
* @returns {Promise<Object>} An object containing the invite `code`
|
|
53
|
+
*/
|
|
54
|
+
createChannelInvite(userID) {
|
|
55
|
+
return this._client.createLobbyChannelInvite.call(this._client, this.id, userID);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Delete this lobby
|
|
60
|
+
* @returns {Promise}
|
|
61
|
+
*/
|
|
62
|
+
delete() {
|
|
63
|
+
return this._client.deleteLobby.call(this._client, this.id);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Edit this lobby
|
|
68
|
+
* @arg {Object} options The properties to edit. See `Client#editLobby` for the full list of options
|
|
69
|
+
* @returns {Promise<Lobby>}
|
|
70
|
+
*/
|
|
71
|
+
edit(options) {
|
|
72
|
+
return this._client.editLobby.call(this._client, this.id, options);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Set the moderation metadata of a message of this lobby
|
|
77
|
+
* @arg {String} messageID The ID of the message
|
|
78
|
+
* @arg {Object<String, String>} metadata The moderation metadata, as key/value pairs. See `Client#editLobbyMessageModerationMetadata` for the limits
|
|
79
|
+
* @returns {Promise}
|
|
80
|
+
*/
|
|
81
|
+
editMessageModerationMetadata(messageID, metadata) {
|
|
82
|
+
return this._client.editLobbyMessageModerationMetadata.call(this._client, this.id, messageID, metadata);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Remove a member from this lobby
|
|
87
|
+
* @arg {String} userID The ID of the member
|
|
88
|
+
* @returns {Promise}
|
|
89
|
+
*/
|
|
90
|
+
removeMember(userID) {
|
|
91
|
+
return this._client.removeLobbyMember.call(this._client, this.id, userID);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
toJSON(props = []) {
|
|
95
|
+
return super.toJSON([
|
|
96
|
+
"applicationID",
|
|
97
|
+
"linkedChannel",
|
|
98
|
+
"members",
|
|
99
|
+
"metadata",
|
|
100
|
+
...props,
|
|
101
|
+
]);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
module.exports = Lobby;
|
|
106
|
+
|
|
107
|
+
// Circular import
|
|
108
|
+
const Channel = require("./Channel");
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const Base = require("./Base");
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Represents a lobby member
|
|
7
|
-
* @prop {String?} additionalName An additional display name of the member, such as an in-game character name
|
|
8
|
-
* @prop {Number} flags The lobby member flags of the member. See `Constants.LobbyMemberFlags`
|
|
9
|
-
* @prop {String} id The ID of the user
|
|
10
|
-
* @prop {String} lobbyID The ID of the lobby
|
|
11
|
-
* @prop {Object<String, String>?} metadata The metadata of the member, as key/value pairs
|
|
12
|
-
*/
|
|
13
|
-
class LobbyMember extends Base {
|
|
14
|
-
constructor(data, client, lobbyID) {
|
|
15
|
-
super(data.id);
|
|
16
|
-
this._client = client;
|
|
17
|
-
this.lobbyID = lobbyID;
|
|
18
|
-
this.additionalName = data.additional_name !== undefined ? data.additional_name : null;
|
|
19
|
-
this.flags = data.flags || 0;
|
|
20
|
-
this.metadata = data.metadata !== undefined ? data.metadata : null;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Create a single-use invite to the channel linked to the lobby for this member. The invite expires after one hour
|
|
25
|
-
* @returns {Promise<Object>} An object containing the invite `code`
|
|
26
|
-
*/
|
|
27
|
-
createChannelInvite() {
|
|
28
|
-
return this._client.createLobbyChannelInvite.call(this._client, this.lobbyID, this.id);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Edit this member
|
|
33
|
-
* @arg {Object} options The properties to edit. See `Client#addLobbyMember` for the full list of options
|
|
34
|
-
* @returns {Promise<LobbyMember>}
|
|
35
|
-
*/
|
|
36
|
-
edit(options) {
|
|
37
|
-
return this._client.addLobbyMember.call(this._client, this.lobbyID, this.id, options);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Remove this member from the lobby
|
|
42
|
-
* @returns {Promise}
|
|
43
|
-
*/
|
|
44
|
-
remove() {
|
|
45
|
-
return this._client.removeLobbyMember.call(this._client, this.lobbyID, this.id);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
toJSON(props = []) {
|
|
49
|
-
return super.toJSON([
|
|
50
|
-
"additionalName",
|
|
51
|
-
"flags",
|
|
52
|
-
"lobbyID",
|
|
53
|
-
"metadata",
|
|
54
|
-
...props,
|
|
55
|
-
]);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
module.exports = LobbyMember;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const Base = require("./Base");
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Represents a lobby member
|
|
7
|
+
* @prop {String?} additionalName An additional display name of the member, such as an in-game character name
|
|
8
|
+
* @prop {Number} flags The lobby member flags of the member. See `Constants.LobbyMemberFlags`
|
|
9
|
+
* @prop {String} id The ID of the user
|
|
10
|
+
* @prop {String} lobbyID The ID of the lobby
|
|
11
|
+
* @prop {Object<String, String>?} metadata The metadata of the member, as key/value pairs
|
|
12
|
+
*/
|
|
13
|
+
class LobbyMember extends Base {
|
|
14
|
+
constructor(data, client, lobbyID) {
|
|
15
|
+
super(data.id);
|
|
16
|
+
this._client = client;
|
|
17
|
+
this.lobbyID = lobbyID;
|
|
18
|
+
this.additionalName = data.additional_name !== undefined ? data.additional_name : null;
|
|
19
|
+
this.flags = data.flags || 0;
|
|
20
|
+
this.metadata = data.metadata !== undefined ? data.metadata : null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Create a single-use invite to the channel linked to the lobby for this member. The invite expires after one hour
|
|
25
|
+
* @returns {Promise<Object>} An object containing the invite `code`
|
|
26
|
+
*/
|
|
27
|
+
createChannelInvite() {
|
|
28
|
+
return this._client.createLobbyChannelInvite.call(this._client, this.lobbyID, this.id);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Edit this member
|
|
33
|
+
* @arg {Object} options The properties to edit. See `Client#addLobbyMember` for the full list of options
|
|
34
|
+
* @returns {Promise<LobbyMember>}
|
|
35
|
+
*/
|
|
36
|
+
edit(options) {
|
|
37
|
+
return this._client.addLobbyMember.call(this._client, this.lobbyID, this.id, options);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Remove this member from the lobby
|
|
42
|
+
* @returns {Promise}
|
|
43
|
+
*/
|
|
44
|
+
remove() {
|
|
45
|
+
return this._client.removeLobbyMember.call(this._client, this.lobbyID, this.id);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
toJSON(props = []) {
|
|
49
|
+
return super.toJSON([
|
|
50
|
+
"additionalName",
|
|
51
|
+
"flags",
|
|
52
|
+
"lobbyID",
|
|
53
|
+
"metadata",
|
|
54
|
+
...props,
|
|
55
|
+
]);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
module.exports = LobbyMember;
|