Skip to content

Latest commit

 

History

History
32 lines (27 loc) · 742 Bytes

README.md

File metadata and controls

32 lines (27 loc) · 742 Bytes

discord.io

A low-level library for creating a Discord client from Node.js. Come join the discussion!

Installation

npm install discord.io

Example

var DiscordClient = require('discord.io');
var bot = new DiscordClient({
    autorun: true,
    email: "",
    password: "",
    //OR
    token: ""
});

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