@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,98 +1,98 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const Base = require("./Base");
|
|
4
|
-
const { ChannelTypes } = require("../Constants");
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Represents a channel. You also probably want to look at CategoryChannel, GroupChannel, NewsChannel, DMChannel, TextChannel, and VoiceChannel.
|
|
8
|
-
* @prop {Number} createdAt Timestamp of the channel's creation
|
|
9
|
-
* @prop {String} id The ID of the channel
|
|
10
|
-
* @prop {String} mention A string that mentions the channel
|
|
11
|
-
* @prop {Number} type The type of the channel
|
|
12
|
-
*/
|
|
13
|
-
class Channel extends Base {
|
|
14
|
-
constructor(data, client) {
|
|
15
|
-
super(data.id);
|
|
16
|
-
this.type = data.type;
|
|
17
|
-
this._client = client;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
get mention() {
|
|
21
|
-
return `<#${this.id}>`;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
static from(data, client) {
|
|
25
|
-
switch (data.type) {
|
|
26
|
-
case ChannelTypes.GUILD_TEXT: {
|
|
27
|
-
return new TextChannel(data, client);
|
|
28
|
-
}
|
|
29
|
-
case ChannelTypes.DM: {
|
|
30
|
-
return new DMChannel(data, client);
|
|
31
|
-
}
|
|
32
|
-
case ChannelTypes.GUILD_VOICE: {
|
|
33
|
-
return new VoiceChannel(data, client);
|
|
34
|
-
}
|
|
35
|
-
case ChannelTypes.GROUP_DM: {
|
|
36
|
-
return new GroupChannel(data, client);
|
|
37
|
-
}
|
|
38
|
-
case ChannelTypes.GUILD_CATEGORY: {
|
|
39
|
-
return new CategoryChannel(data, client);
|
|
40
|
-
}
|
|
41
|
-
case ChannelTypes.GUILD_NEWS: {
|
|
42
|
-
return new NewsChannel(data, client);
|
|
43
|
-
}
|
|
44
|
-
case ChannelTypes.GUILD_NEWS_THREAD: {
|
|
45
|
-
return new NewsThreadChannel(data, client);
|
|
46
|
-
}
|
|
47
|
-
case ChannelTypes.GUILD_PUBLIC_THREAD: {
|
|
48
|
-
return new PublicThreadChannel(data, client);
|
|
49
|
-
}
|
|
50
|
-
case ChannelTypes.GUILD_PRIVATE_THREAD: {
|
|
51
|
-
return new PrivateThreadChannel(data, client);
|
|
52
|
-
}
|
|
53
|
-
case ChannelTypes.GUILD_STAGE_VOICE: {
|
|
54
|
-
return new StageChannel(data, client);
|
|
55
|
-
}
|
|
56
|
-
case ChannelTypes.GUILD_FORUM: {
|
|
57
|
-
return new ForumChannel(data, client);
|
|
58
|
-
}
|
|
59
|
-
case ChannelTypes.GUILD_MEDIA: {
|
|
60
|
-
return new MediaChannel(data, client);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
if (data.guild_id) {
|
|
64
|
-
if (data.last_message_id !== undefined) {
|
|
65
|
-
client.emit("warn", new Error(`Unknown guild text channel type: ${data.type}\n${JSON.stringify(data)}`));
|
|
66
|
-
return new TextChannel(data, client);
|
|
67
|
-
}
|
|
68
|
-
client.emit("warn", new Error(`Unknown guild channel type: ${data.type}\n${JSON.stringify(data)}`));
|
|
69
|
-
return new GuildChannel(data, client);
|
|
70
|
-
}
|
|
71
|
-
client.emit("warn", new Error(`Unknown channel type: ${data.type}\n${JSON.stringify(data)}`));
|
|
72
|
-
return new Channel(data, client);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
toJSON(props = []) {
|
|
76
|
-
return super.toJSON([
|
|
77
|
-
"type",
|
|
78
|
-
...props,
|
|
79
|
-
]);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
module.exports = Channel;
|
|
84
|
-
|
|
85
|
-
// Circular import
|
|
86
|
-
const CategoryChannel = require("./CategoryChannel");
|
|
87
|
-
const DMChannel = require("./DMChannel");
|
|
88
|
-
const GuildChannel = require("./GuildChannel");
|
|
89
|
-
const ForumChannel = require("./ForumChannel");
|
|
90
|
-
const GroupChannel = require("./GroupChannel");
|
|
91
|
-
const MediaChannel = require("./MediaChannel");
|
|
92
|
-
const NewsChannel = require("./NewsChannel");
|
|
93
|
-
const NewsThreadChannel = require("./NewsThreadChannel");
|
|
94
|
-
const PrivateThreadChannel = require("./PrivateThreadChannel");
|
|
95
|
-
const PublicThreadChannel = require("./PublicThreadChannel");
|
|
96
|
-
const StageChannel = require("./StageChannel");
|
|
97
|
-
const TextChannel = require("./TextChannel");
|
|
98
|
-
const VoiceChannel = require("./VoiceChannel");
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const Base = require("./Base");
|
|
4
|
+
const { ChannelTypes } = require("../Constants");
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Represents a channel. You also probably want to look at CategoryChannel, GroupChannel, NewsChannel, DMChannel, TextChannel, and VoiceChannel.
|
|
8
|
+
* @prop {Number} createdAt Timestamp of the channel's creation
|
|
9
|
+
* @prop {String} id The ID of the channel
|
|
10
|
+
* @prop {String} mention A string that mentions the channel
|
|
11
|
+
* @prop {Number} type The type of the channel
|
|
12
|
+
*/
|
|
13
|
+
class Channel extends Base {
|
|
14
|
+
constructor(data, client) {
|
|
15
|
+
super(data.id);
|
|
16
|
+
this.type = data.type;
|
|
17
|
+
this._client = client;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
get mention() {
|
|
21
|
+
return `<#${this.id}>`;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
static from(data, client) {
|
|
25
|
+
switch (data.type) {
|
|
26
|
+
case ChannelTypes.GUILD_TEXT: {
|
|
27
|
+
return new TextChannel(data, client);
|
|
28
|
+
}
|
|
29
|
+
case ChannelTypes.DM: {
|
|
30
|
+
return new DMChannel(data, client);
|
|
31
|
+
}
|
|
32
|
+
case ChannelTypes.GUILD_VOICE: {
|
|
33
|
+
return new VoiceChannel(data, client);
|
|
34
|
+
}
|
|
35
|
+
case ChannelTypes.GROUP_DM: {
|
|
36
|
+
return new GroupChannel(data, client);
|
|
37
|
+
}
|
|
38
|
+
case ChannelTypes.GUILD_CATEGORY: {
|
|
39
|
+
return new CategoryChannel(data, client);
|
|
40
|
+
}
|
|
41
|
+
case ChannelTypes.GUILD_NEWS: {
|
|
42
|
+
return new NewsChannel(data, client);
|
|
43
|
+
}
|
|
44
|
+
case ChannelTypes.GUILD_NEWS_THREAD: {
|
|
45
|
+
return new NewsThreadChannel(data, client);
|
|
46
|
+
}
|
|
47
|
+
case ChannelTypes.GUILD_PUBLIC_THREAD: {
|
|
48
|
+
return new PublicThreadChannel(data, client);
|
|
49
|
+
}
|
|
50
|
+
case ChannelTypes.GUILD_PRIVATE_THREAD: {
|
|
51
|
+
return new PrivateThreadChannel(data, client);
|
|
52
|
+
}
|
|
53
|
+
case ChannelTypes.GUILD_STAGE_VOICE: {
|
|
54
|
+
return new StageChannel(data, client);
|
|
55
|
+
}
|
|
56
|
+
case ChannelTypes.GUILD_FORUM: {
|
|
57
|
+
return new ForumChannel(data, client);
|
|
58
|
+
}
|
|
59
|
+
case ChannelTypes.GUILD_MEDIA: {
|
|
60
|
+
return new MediaChannel(data, client);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (data.guild_id) {
|
|
64
|
+
if (data.last_message_id !== undefined) {
|
|
65
|
+
client.emit("warn", new Error(`Unknown guild text channel type: ${data.type}\n${JSON.stringify(data)}`));
|
|
66
|
+
return new TextChannel(data, client);
|
|
67
|
+
}
|
|
68
|
+
client.emit("warn", new Error(`Unknown guild channel type: ${data.type}\n${JSON.stringify(data)}`));
|
|
69
|
+
return new GuildChannel(data, client);
|
|
70
|
+
}
|
|
71
|
+
client.emit("warn", new Error(`Unknown channel type: ${data.type}\n${JSON.stringify(data)}`));
|
|
72
|
+
return new Channel(data, client);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
toJSON(props = []) {
|
|
76
|
+
return super.toJSON([
|
|
77
|
+
"type",
|
|
78
|
+
...props,
|
|
79
|
+
]);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
module.exports = Channel;
|
|
84
|
+
|
|
85
|
+
// Circular import
|
|
86
|
+
const CategoryChannel = require("./CategoryChannel");
|
|
87
|
+
const DMChannel = require("./DMChannel");
|
|
88
|
+
const GuildChannel = require("./GuildChannel");
|
|
89
|
+
const ForumChannel = require("./ForumChannel");
|
|
90
|
+
const GroupChannel = require("./GroupChannel");
|
|
91
|
+
const MediaChannel = require("./MediaChannel");
|
|
92
|
+
const NewsChannel = require("./NewsChannel");
|
|
93
|
+
const NewsThreadChannel = require("./NewsThreadChannel");
|
|
94
|
+
const PrivateThreadChannel = require("./PrivateThreadChannel");
|
|
95
|
+
const PublicThreadChannel = require("./PublicThreadChannel");
|
|
96
|
+
const StageChannel = require("./StageChannel");
|
|
97
|
+
const TextChannel = require("./TextChannel");
|
|
98
|
+
const VoiceChannel = require("./VoiceChannel");
|