No description
Find a file
2015-08-12 16:05:35 +01:00
examples Fix query.js to properly deal with users with spaces in their name. 2015-08-12 14:03:21 +02:00
lib Most arrays are now using lists. 2015-08-12 16:05:35 +01:00
.gitignore minor small fixes 2015-08-11 17:07:31 +01:00
index.js Most arrays are now using lists. 2015-08-12 16:05:35 +01:00
LICENSE Initial commit 2015-08-10 14:36:26 +01:00
package.json 1.2.2 2015-08-12 11:49:00 +01:00
README.md readme update 2015-08-11 22:36:23 +01:00

discord.js

Discord.js is a node module that allows you to interface with the Discord API for creation of things such as bots or loggers.

The aim of this API is to make it really simple to start developing your bots. This API has server, channel and user tracking, as well as tools to make identification really simple.

For more information, click here.

Installation

npm install discord.js

Example usage

var Discord = require("discord.js");

var myBot = new Discord.Client();

myBot.login("discord email", "discord password", function(e) {

    if(e){
        console.log("Couldn't log in");
        return;
    }

    myBot.on("disconnected", function() {
        console.log("Disconnected!");
        process.exit(0);
    });

    myBot.on("ready", function(e) {
        console.log("Ready to go!");
    });

    myBot.on("message", function(message) {

        if(message.content === "Ping!"){

            myBot.sendMessage(message.channel, "Pong!");

        }

    }

}

TODO

  • Documentation
  • Better error handling
  • Being able to cache new servers and channels as well as ones that are deleted - this is currently only done when a bot is created