discord.io
A small, single-file, fully featured Discordapp library for Node.js.
Join the Discord Discussion!
Requirements:
Required:
- Node.js 0.10.x or greater
Optional:
- Audio:
- Node.js 0.12.x
- ffmpeg/avconv (needs to be added to PATH)
Getting Started:
Note: Token
This library requires a token. If you're using a user account, you can find yours in your browser/client's localStorage
. If you're using a bot, you can retrieve the token from: https://discordapp.com/developers/applications/me.
Installing:
npm install discord.io
npm install izy521/discord.io
Running:
var Discord = require('discord.io');
var bot = new Discord.Client({
autorun: true,
token: ""
});
bot.on('ready', function(event) {
console.log('Logged in as %s - %s\n', bot.username, bot.id);
});
bot.on('message', function(user, userID, channelID, message, event) {
if (message === "ping") {
bot.sendMessage({
to: channelID,
message: "pong"
});
}
});