@zygout/eris 0.19.0 → 0.19.2
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 +71 -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/LICENSE
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2016-2021 abalabahaha
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
-
the Software without restriction, including without limitation the rights to
|
|
8
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
-
subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2016-2021 abalabahaha
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
+
subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,80 +1,71 @@
|
|
|
1
|
-
Eris [](https://npmjs.com/package/@zygout/eris)
|
|
2
|
-
====
|
|
3
|
-
|
|
4
|
-
A Node.js wrapper for interfacing with Discord.
|
|
5
|
-
|
|
6
|
-
This is a maintained fork of [Eris](https://github.com/abalabahaha/eris)
|
|
7
|
-
|
|
8
|
-
Installing
|
|
9
|
-
----------
|
|
10
|
-
|
|
11
|
-
You will need Node.js 10.4+.
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
npm install
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
bot.on("
|
|
45
|
-
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
bot.on("
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
bot.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
- [The Eris website](https://abal.moe/Eris/) documents Eris 0.18. What this fork adds is documented in the JSDoc comments of `lib/` and in `index.d.ts`.
|
|
73
|
-
- [The GitHub repo](https://github.com/ZyGout/eris) is where this fork is developed. Report bugs and ask questions in its issues.
|
|
74
|
-
- [The npm package webpage](https://npmjs.com/package/@zygout/eris) is the webpage for the npm package.
|
|
75
|
-
- [The original Eris repo](https://github.com/abalabahaha/eris) is where Eris was developed up to 0.18.0.
|
|
76
|
-
|
|
77
|
-
License
|
|
78
|
-
-------
|
|
79
|
-
|
|
80
|
-
Refer to the [LICENSE](LICENSE) file.
|
|
1
|
+
Eris [](https://npmjs.com/package/@zygout/eris)
|
|
2
|
+
====
|
|
3
|
+
|
|
4
|
+
A Node.js wrapper for interfacing with Discord.
|
|
5
|
+
|
|
6
|
+
This is a maintained fork of [Eris](https://github.com/abalabahaha/eris). Eris has had no release since 0.18.0 in September 2024, and its pull requests are no longer merged. This fork keeps it up to date with the Discord API, keeps its API and style, and publishes new versions to npm as [`@zygout/eris`](https://npmjs.com/package/@zygout/eris).
|
|
7
|
+
|
|
8
|
+
Installing
|
|
9
|
+
----------
|
|
10
|
+
|
|
11
|
+
You will need Node.js 10.4+.
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
npm install @zygout/eris
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Voice support uses the optional dependencies and [FFmpeg](https://ffmpeg.org). If you don't need voice support, add `--omit=optional`.
|
|
18
|
+
|
|
19
|
+
To keep `require("eris")` in an existing bot, install it under the `eris` name:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
npm install eris@npm:@zygout/eris
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Ping Pong Example
|
|
26
|
+
-----------------
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
const Eris = require("@zygout/eris");
|
|
30
|
+
|
|
31
|
+
// Replace TOKEN with your bot account's token
|
|
32
|
+
const bot = new Eris("Bot TOKEN", {
|
|
33
|
+
intents: [
|
|
34
|
+
"guilds",
|
|
35
|
+
"guildMessages",
|
|
36
|
+
"messageContent", // Enable "Message Content Intent" on your application's Bot page first
|
|
37
|
+
],
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
bot.on("ready", () => { // When the bot is ready
|
|
41
|
+
console.log("Ready!"); // Log "Ready!"
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
bot.on("error", (err) => {
|
|
45
|
+
console.error(err); // or your preferred logger
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
bot.on("messageCreate", (msg) => { // When a message is created
|
|
49
|
+
if (msg.content === "!ping") { // If the message content is "!ping"
|
|
50
|
+
bot.createMessage(msg.channel.id, "Pong!"); // Send a message in the same channel with "Pong!"
|
|
51
|
+
} else if (msg.content === "!pong") { // Otherwise, if the message is "!pong"
|
|
52
|
+
bot.createMessage(msg.channel.id, "Ping!"); // Respond with "Ping!"
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
bot.connect(); // Get the bot to connect to Discord
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
More examples can be found in [the examples folder](examples).
|
|
60
|
+
|
|
61
|
+
Useful Links
|
|
62
|
+
------------
|
|
63
|
+
|
|
64
|
+
- [The Eris docs](https://abal.moe/Eris/docs) have more details and documentation.
|
|
65
|
+
- [The GitHub repo](https://github.com/ZyGout/eris) is where development happens. Report bugs in its [issues](https://github.com/ZyGout/eris/issues).
|
|
66
|
+
- [The NPM package webpage](https://npmjs.com/package/@zygout/eris) is the webpage for the NPM package.
|
|
67
|
+
|
|
68
|
+
License
|
|
69
|
+
-------
|
|
70
|
+
|
|
71
|
+
Refer to the [LICENSE](LICENSE) file.
|
package/esm.mjs
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import Eris from "./index.js";
|
|
2
|
-
|
|
3
|
-
export default function (token, options) {
|
|
4
|
-
return new Eris.Client(token, options);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export const {
|
|
8
|
-
AutoModerationRule,
|
|
9
|
-
ApplicationCommand,
|
|
10
|
-
AutocompleteInteraction,
|
|
11
|
-
Base,
|
|
12
|
-
Bucket,
|
|
13
|
-
CategoryChannel,
|
|
14
|
-
Channel,
|
|
15
|
-
Client,
|
|
16
|
-
Collection,
|
|
17
|
-
Command,
|
|
18
|
-
CommandClient,
|
|
19
|
-
CommandInteraction,
|
|
20
|
-
ComponentInteraction,
|
|
21
|
-
Constants,
|
|
22
|
-
DiscordHTTPError,
|
|
23
|
-
DiscordRESTError,
|
|
24
|
-
DMChannel,
|
|
25
|
-
Entitlement,
|
|
26
|
-
ExtendedUser,
|
|
27
|
-
ForumChannel,
|
|
28
|
-
GroupChannel,
|
|
29
|
-
Guild,
|
|
30
|
-
GuildChannel,
|
|
31
|
-
GuildIntegration,
|
|
32
|
-
GuildPreview,
|
|
33
|
-
GuildScheduledEvent,
|
|
34
|
-
GuildTemplate,
|
|
35
|
-
Interaction,
|
|
36
|
-
Invite,
|
|
37
|
-
Lobby,
|
|
38
|
-
LobbyMember,
|
|
39
|
-
MediaChannel,
|
|
40
|
-
Member,
|
|
41
|
-
Message,
|
|
42
|
-
ModalSubmitInteraction,
|
|
43
|
-
NewsChannel,
|
|
44
|
-
NewsThreadChannel,
|
|
45
|
-
Permission,
|
|
46
|
-
PermissionOverwrite,
|
|
47
|
-
PingInteraction,
|
|
48
|
-
PrivateChannel,
|
|
49
|
-
PrivateThreadChannel,
|
|
50
|
-
PublicThreadChannel,
|
|
51
|
-
RequestHandler,
|
|
52
|
-
Role,
|
|
53
|
-
SequentialBucket,
|
|
54
|
-
Shard,
|
|
55
|
-
SharedStream,
|
|
56
|
-
SKU,
|
|
57
|
-
SoundboardSound,
|
|
58
|
-
StageChannel,
|
|
59
|
-
StageInstance,
|
|
60
|
-
Subscription,
|
|
61
|
-
TextChannel,
|
|
62
|
-
ThreadChannel,
|
|
63
|
-
ThreadMember,
|
|
64
|
-
UnavailableGuild,
|
|
65
|
-
UnknownInteraction,
|
|
66
|
-
User,
|
|
67
|
-
VERSION,
|
|
68
|
-
VoiceChannel,
|
|
69
|
-
VoiceConnection,
|
|
70
|
-
VoiceConnectionManager,
|
|
71
|
-
VoiceState,
|
|
72
|
-
} = Eris;
|
|
1
|
+
import Eris from "./index.js";
|
|
2
|
+
|
|
3
|
+
export default function (token, options) {
|
|
4
|
+
return new Eris.Client(token, options);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const {
|
|
8
|
+
AutoModerationRule,
|
|
9
|
+
ApplicationCommand,
|
|
10
|
+
AutocompleteInteraction,
|
|
11
|
+
Base,
|
|
12
|
+
Bucket,
|
|
13
|
+
CategoryChannel,
|
|
14
|
+
Channel,
|
|
15
|
+
Client,
|
|
16
|
+
Collection,
|
|
17
|
+
Command,
|
|
18
|
+
CommandClient,
|
|
19
|
+
CommandInteraction,
|
|
20
|
+
ComponentInteraction,
|
|
21
|
+
Constants,
|
|
22
|
+
DiscordHTTPError,
|
|
23
|
+
DiscordRESTError,
|
|
24
|
+
DMChannel,
|
|
25
|
+
Entitlement,
|
|
26
|
+
ExtendedUser,
|
|
27
|
+
ForumChannel,
|
|
28
|
+
GroupChannel,
|
|
29
|
+
Guild,
|
|
30
|
+
GuildChannel,
|
|
31
|
+
GuildIntegration,
|
|
32
|
+
GuildPreview,
|
|
33
|
+
GuildScheduledEvent,
|
|
34
|
+
GuildTemplate,
|
|
35
|
+
Interaction,
|
|
36
|
+
Invite,
|
|
37
|
+
Lobby,
|
|
38
|
+
LobbyMember,
|
|
39
|
+
MediaChannel,
|
|
40
|
+
Member,
|
|
41
|
+
Message,
|
|
42
|
+
ModalSubmitInteraction,
|
|
43
|
+
NewsChannel,
|
|
44
|
+
NewsThreadChannel,
|
|
45
|
+
Permission,
|
|
46
|
+
PermissionOverwrite,
|
|
47
|
+
PingInteraction,
|
|
48
|
+
PrivateChannel,
|
|
49
|
+
PrivateThreadChannel,
|
|
50
|
+
PublicThreadChannel,
|
|
51
|
+
RequestHandler,
|
|
52
|
+
Role,
|
|
53
|
+
SequentialBucket,
|
|
54
|
+
Shard,
|
|
55
|
+
SharedStream,
|
|
56
|
+
SKU,
|
|
57
|
+
SoundboardSound,
|
|
58
|
+
StageChannel,
|
|
59
|
+
StageInstance,
|
|
60
|
+
Subscription,
|
|
61
|
+
TextChannel,
|
|
62
|
+
ThreadChannel,
|
|
63
|
+
ThreadMember,
|
|
64
|
+
UnavailableGuild,
|
|
65
|
+
UnknownInteraction,
|
|
66
|
+
User,
|
|
67
|
+
VERSION,
|
|
68
|
+
VoiceChannel,
|
|
69
|
+
VoiceConnection,
|
|
70
|
+
VoiceConnectionManager,
|
|
71
|
+
VoiceState,
|
|
72
|
+
} = Eris;
|