Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abalabahaha/eris
A NodeJS Discord library
https://github.com/abalabahaha/eris
bot discord discord-api eris nodejs
Last synced: 2 days ago
JSON representation
A NodeJS Discord library
- Host: GitHub
- URL: https://github.com/abalabahaha/eris
- Owner: abalabahaha
- License: mit
- Created: 2016-06-30T22:41:48.000Z (over 8 years ago)
- Default Branch: dev
- Last Pushed: 2024-11-26T23:55:44.000Z (16 days ago)
- Last Synced: 2024-12-03T03:04:58.033Z (9 days ago)
- Topics: bot, discord, discord-api, eris, nodejs
- Language: JavaScript
- Homepage: https://abal.moe/Eris/
- Size: 4.57 MB
- Stars: 1,492
- Watchers: 37
- Forks: 417
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- discord-api-libs - eris - A NodeJS Discord library (Libraries / JavaScript)
- awesome-discord - Eris
- awesome-discord - Eris - JavaScript (💻 API Libraries)
README
Eris [![NPM version](https://img.shields.io/npm/v/eris.svg?style=flat-square&color=informational)](https://npmjs.com/package/eris)
====A Node.js wrapper for interfacing with Discord.
Installing
----------You will need NodeJS 10.4+. If you need voice support you will also need Python 2.7 and a C++ compiler. Refer to [the Getting Started section of the docs](https://abal.moe/Eris/docs) for more details.
```
npm install --no-optional eris
```If you need voice support, remove the `--no-optional`.
Ping Pong Example
-----------------```js
const Eris = require("eris");// Replace TOKEN with your bot account's token
const bot = new Eris("Bot TOKEN", {
intents: [
"guildMessages"
]
});bot.on("ready", () => { // When the bot is ready
console.log("Ready!"); // Log "Ready!"
});bot.on("error", (err) => {
console.error(err); // or your preferred logger
});bot.on("messageCreate", (msg) => { // When a message is created
if(msg.content === "!ping") { // If the message content is "!ping"
bot.createMessage(msg.channel.id, "Pong!");
// Send a message in the same channel with "Pong!"
} else if(msg.content === "!pong") { // Otherwise, if the message is "!pong"
bot.createMessage(msg.channel.id, "Ping!");
// Respond with "Ping!"
}
});bot.connect(); // Get the bot to connect to Discord
```More examples can be found in [the examples folder](https://github.com/abalabahaha/eris/tree/master/examples).
Useful Links
------------- [The website](https://abal.moe/Eris/) has more details and documentation.
- [The official Eris server](https://abal.moe/Eris/invite) is the best place to get support.
- [The GitHub repo](https://github.com/abalabahaha/eris) is where development primarily happens.
- [The NPM package webpage](https://npmjs.com/package/eris) is, well, the webpage for the NPM package.License
-------Refer to the [LICENSE](LICENSE) file.