A ES6 browser-compatible Discord API library.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
classes
examples
.gitignore
LICENSE
README.md
jscord.js

README.md

JSCord

A ES6 browser-compatible Discord API library.

Why JSCord?

JSCord is lightweight, fast and stable Discord API library for browsers, it has never been easier to make client-side applications! We aim to support every major browser (excl. IE & Edge) and maybe soon, Node.js aswell. The creative stuff you could do with this is limitless!

Requirements

ES6 compatible browser, that supports all the methods used in the lib. (Might polyfill it for ES5)

Installation

Want to use this in your HTML/PHP project? Use this cdn link or download the file, and request it wherever you want.

Please note that, this repository is for actual testing, hence the modularity. If you want to use it in production, PLEASE, use a minified version at the releases tab

<script src="https://cdn.cernodile.com/jscord.js" charset="utf-8"></script>

Using it

Example usage: (Pinging)

var bot = new JSCord('MjA4Th1sS0m4R4nd0mT0ken.CuZjdA.drea21_w0zsMj24A._1asl0');
bot.login();
bot.on('ready', () => {
  console.log("I'm ready!");
  // Do something
});
bot.on('message_create', (message) => {
  if (message.author.bot || message.author.id === bot.user.id) return; // Ignore bots and yourself.
  if (message.content === '!ping') { // Statement to trigger it
    bot.sendMessage(message.channel.id, 'Pong!'); // Send message
    // OR message.channel.sendMessage('Pong!');
  }
});