Eris
A NodeJS wrapper for interfacing with Discord.
Installing
You will need NodeJS 8+. 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 for more details.
npm install --no-optional eris
If you need voice support, remove the --no-optional
Ping Pong Example
const Eris = require("eris");
var bot = new Eris("BOT_TOKEN");
bot.on("ready", () => {
console.log("Ready!");
});
bot.on("messageCreate", (msg) => {
if(msg.content === "!ping") {
bot.createMessage(msg.channel.id, "Pong!");
} else if(msg.content === "!pong") {
bot.createMessage(msg.channel.id, "Ping!");
}
});
bot.connect();
More examples can be found in the examples folder.
Useful Links
The website includes more detailed information on getting started, as well as documentation for the different components.
The Discord API channel (#js_eris) is the best place to get support/contact me.
The GitHub repo has the most updated code.
The NPM package
License
Refer to the LICENSE file.