Skip to content
This repository has been archived by the owner on Mar 25, 2020. It is now read-only.
izy521 edited this page Nov 17, 2015 · 26 revisions

discord.io

A library for creating clients for Discord using Node.js.

Warning:

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.

Requirements:

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)

Getting Started:

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"
        });
    }
});
Clone this wiki locally