discord.io

A small, single-file, fully featured Discordapp library for Node.js.

forthebadge

Join the Discord Discussion!

Discord

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:

Stable

npm install discord.io

Latest

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"
        });
    }
});

results matching ""

    No results matching ""