@zygout/eris 0.19.1 → 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/README.md +23 -61
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,73 +5,40 @@ A Node.js wrapper for interfacing with Discord.
|
|
|
5
5
|
|
|
6
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
7
|
|
|
8
|
-
About this fork
|
|
9
|
-
---------------
|
|
10
|
-
|
|
11
|
-
- **Kept up to date.** What Discord adds or changes in its API (endpoints, gateway events, components, voice) is added here, and bugs are fixed as they are reported. Each version is published to npm and listed with its changes on [the releases page](https://github.com/ZyGout/eris/releases).
|
|
12
|
-
- **The Eris API.** Classes, methods, events and options keep their Eris names. New features follow the same style: structure classes with camelCase properties, `Collection`s, JSDoc and typings. Most bots move over by only changing the dependency.
|
|
13
|
-
- **Versions.** Versions follow [semver](https://semver.org), starting from 0.19.0. While the version starts with 0, a minor release (0.19 to 0.20) can contain breaking changes, listed in its release notes. A patch release (0.19.0 to 0.19.1) never does.
|
|
14
|
-
- **Contributing.** Report bugs and ask for features in [the issues](https://github.com/ZyGout/eris/issues). Pull requests target the `dev` branch: see [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
15
|
-
|
|
16
|
-
### Since Eris 0.18.0
|
|
17
|
-
|
|
18
|
-
- Voice works again: voice gateway v8, the encryption modes Discord now requires, and DAVE end-to-end encryption, which Discord requires for every call.
|
|
19
|
-
- Messages made of Components V2, and modals with labels, text displays, file uploads, radio groups and checkboxes.
|
|
20
|
-
- Monetization: entitlements, SKUs, subscriptions and premium buttons.
|
|
21
|
-
- Lobbies, user-installable apps (`contexts`, `integrationTypes`), entry point commands, activity instances, message search, guild tags, nameplates, gradient role colors, and the other fields Discord now sends.
|
|
22
|
-
- Fixes, such as command localizations and `defaultMemberPermissions` that never reached Discord, reaction buttons in DMs, and requests and logins that retried forever.
|
|
23
|
-
|
|
24
|
-
### Moving from Eris 0.18
|
|
25
|
-
|
|
26
|
-
Install the fork under the `eris` name (see [Installing](#installing)), then check these changes. Some come from work merged into Eris after 0.18.0 and never released:
|
|
27
|
-
|
|
28
|
-
- `createGuild`, `createGuildFromTemplate`, `deleteGuild`, `editGuildMFALevel`, `Guild#delete`, `Guild#editMFALevel` and `GuildTemplate#createGuild` are removed, since Discord no longer lets bots use them.
|
|
29
|
-
- The auto moderation methods (`createAutoModerationRule`, `editAutoModerationRule`, `getAutoModerationRule` and `getAutoModerationRules`) give `AutoModerationRule` objects with camelCase properties, such as `triggerType`, instead of the raw objects from Discord. The `autoModerationRule*` events give `AutoModerationRule` objects too, and `autoModerationRuleUpdate` now passes `(guild, rule, oldRule)` instead of `(guild, oldRule, newRule)`.
|
|
30
|
-
- `VoiceConnection#sendBuffer` and `sendNonce` are removed (`sendHeader` replaces them), and `VoiceConnection#modes` is an array.
|
|
31
|
-
- Voice no longer uses `tweetnacl`. It encrypts with Node's `crypto`, or with `sodium-native` or `@stablelib/xchacha20poly1305`.
|
|
32
|
-
- `Constants.GuildFeatures` no longer lists the features Discord retired, such as `COMMERCE` and `PRIVATE_THREADS`.
|
|
33
|
-
- In TypeScript, the rows of `ModalSubmitInteraction#data.components` can also be labels and text displays. Check a row's `type` before reading its `components`.
|
|
34
|
-
|
|
35
|
-
Some names were renamed but still work, marked as deprecated: `Constants.ComponentTypes.SELECT_MENU` (now `STRING_SELECT`, next to the new user, role, mentionable and channel selects), `Constants.ActivityTypes.GAME` (now `PLAYING`), and the TypeScript types `SelectMenuOptions`, `CreateAutoModerationRuleOptions` and `EditAutoModerationRuleOptions`.
|
|
36
|
-
|
|
37
8
|
Installing
|
|
38
9
|
----------
|
|
39
10
|
|
|
40
|
-
You will need Node.js 10.4+.
|
|
11
|
+
You will need Node.js 10.4+.
|
|
41
12
|
|
|
42
13
|
```
|
|
43
|
-
npm install
|
|
14
|
+
npm install @zygout/eris
|
|
44
15
|
```
|
|
45
16
|
|
|
46
|
-
|
|
17
|
+
Voice support uses the optional dependencies and [FFmpeg](https://ffmpeg.org). If you don't need voice support, add `--omit=optional`.
|
|
47
18
|
|
|
48
|
-
|
|
19
|
+
To keep `require("eris")` in an existing bot, install it under the `eris` name:
|
|
49
20
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
- `@stablelib/xchacha20poly1305`, for transport encryption when AES-256-GCM is not available in your Node.js build. `sodium-native` works too.
|
|
54
|
-
- `opusscript`, to encode audio to Opus. `@discordjs/opus` is faster and is used instead when it is installed.
|
|
55
|
-
- [FFmpeg](https://ffmpeg.org) on your `PATH`, to play files that are not already Opus in an Ogg, WebM or DCA container.
|
|
21
|
+
```
|
|
22
|
+
npm install eris@npm:@zygout/eris
|
|
23
|
+
```
|
|
56
24
|
|
|
57
25
|
Ping Pong Example
|
|
58
26
|
-----------------
|
|
59
27
|
|
|
60
28
|
```js
|
|
61
|
-
const Eris = require("eris");
|
|
29
|
+
const Eris = require("@zygout/eris");
|
|
62
30
|
|
|
63
31
|
// Replace TOKEN with your bot account's token
|
|
64
32
|
const bot = new Eris("Bot TOKEN", {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
]
|
|
33
|
+
intents: [
|
|
34
|
+
"guilds",
|
|
35
|
+
"guildMessages",
|
|
36
|
+
"messageContent", // Enable "Message Content Intent" on your application's Bot page first
|
|
37
|
+
],
|
|
71
38
|
});
|
|
72
39
|
|
|
73
40
|
bot.on("ready", () => { // When the bot is ready
|
|
74
|
-
|
|
41
|
+
console.log("Ready!"); // Log "Ready!"
|
|
75
42
|
});
|
|
76
43
|
|
|
77
44
|
bot.on("error", (err) => {
|
|
@@ -79,29 +46,24 @@ bot.on("error", (err) => {
|
|
|
79
46
|
});
|
|
80
47
|
|
|
81
48
|
bot.on("messageCreate", (msg) => { // When a message is created
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
// Respond with "Ping!"
|
|
88
|
-
}
|
|
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
|
+
}
|
|
89
54
|
});
|
|
90
55
|
|
|
91
56
|
bot.connect(); // Get the bot to connect to Discord
|
|
92
57
|
```
|
|
93
58
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
More examples can be found in [the examples folder](examples), including messages made of Components V2 and modals in [componentsV2.js](examples/componentsV2.js).
|
|
59
|
+
More examples can be found in [the examples folder](examples).
|
|
97
60
|
|
|
98
61
|
Useful Links
|
|
99
62
|
------------
|
|
100
63
|
|
|
101
|
-
- [The Eris
|
|
102
|
-
- [The GitHub repo](https://github.com/ZyGout/eris) is where
|
|
103
|
-
- [The
|
|
104
|
-
- [The original Eris repo](https://github.com/abalabahaha/eris) is where Eris was developed up to 0.18.0.
|
|
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.
|
|
105
67
|
|
|
106
68
|
License
|
|
107
69
|
-------
|