This repository has been archived by the owner on Mar 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 153
Home
izy521 edited this page Nov 13, 2015
·
26 revisions
A library for creating clients for Discord using Node.js.
There is no official API for Discord as of yet, the developers have been kind enough to allow us to reverse engineer their undocumented API for our libs. Things may break suddenly, simply post an issue (or notify me in a channel) and I'll get to it.
Required:
- Node.js 0.10.40 or greater
- Request module
- ws module
Optional:
- ffmpeg/avconv (and added to PATH)
- node-opus module (required for sending audio streams)
npm install discord.io
var DiscordClient = require('discord.io');
var bot = new DiscordClient({
email: "",
password: "",
autorun: true
});
bot.on('ready', function() {
console.log(bot.username + " - (" + bot.id + ")");
});
bot.on('message', function(user, userID, channelID, message, rawEvent) {
if (message === "ping") {
bot.sendMessage({
to: channelID,
message: "pong"
});
}
});