eris

A NodeJS Discord library

Github星跟踪图

Eris NPM version

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");
// Replace BOT_TOKEN with your bot account's token

bot.on("ready", () => { // When the bot is ready
    console.log("Ready!"); // Log "Ready!"
});

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.

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.

主要指标

概览
名称与所有者abalabahaha/eris
主编程语言JavaScript
编程语言JavaScript (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2016-06-30 22:41:48
推送于2024-12-13 14:44:49
最后一次提交
发布数48
最新版本名称0.18.0 (发布于 )
第一版名称0.0.1 (发布于 )
用户参与
星数1.5k
关注者数36
派生数416
提交数1.4k
已启用问题?
问题数379
打开的问题数16
拉请求数683
打开的拉请求数19
关闭的拉请求数274
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?