Skip to content
forked from Woor/discord.io

A small, single-file library for creating small Discord clients from Node.js or the browser

License

Notifications You must be signed in to change notification settings

Tominous/cord.io

 
 

Repository files navigation

discord.io

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

Discord NPM

With V5 gateway getting deprecated on Oct. 16, this is a first step at getting V6 to work.

Requirements

Required:

  • Node.js 0.10.x or greater
  • Web Browser if not using Node.js

Optional:

  • Audio
    • Node.js 0.12.x
    • ffmpeg/avconv (needs to be added to PATH)

Getting Started:

Installing

Latest npm install Tominous/cord.io#gateway_v6

Example

var Discord = require('discord.io');

var bot = new Discord.Client({
    token: "",
    autorun: true
});

bot.on('ready', function() {
    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"
        });
    }
});

About

A small, single-file library for creating small Discord clients from Node.js or the browser

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages

  • JavaScript 100.0%