ChrisTalman / discord.js

A JS interface for the Discord API.

Home Page:http://hydrabolt.github.io/discord.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

<<<<<<< HEAD

discord.js

Build Status Documentation Status

NPM

discord.js is a node module used as a way of interfacing with Discord. It is a very useful module for creating bots.

Installation

Requires node 0.12+

npm install --save discord.js


Example: ping-pong

=======


discord.js


Discord server NPM version NPM downloads Build status Dependencies Patreon

npm installnfo

About

discord.js is a powerful Node.js module that allows you to easily interact with the Discord API.

  • Object-oriented
  • Predictable abstractions
  • Performant
  • 100% coverage of the Discord API

Installation

Node.js 10.0.0 or newer is required.
Ignore any warnings about unmet peer dependencies, as they're all optional.

Without voice support: npm install discordjs/discord.js
With voice support (node-opus): npm install discordjs/discord.js node-opus
With voice support (opusscript): npm install discordjs/discord.js opusscript

Audio engines

The preferred audio engine is node-opus, as it performs significantly better than opusscript. When both are available, discord.js will automatically choose node-opus. Using opusscript is only recommended for development environments where node-opus is tough to get working. For production bots, using node-opus should be considered a necessity, especially if they're going to be running on multiple servers.

Optional packages

  • zlib-sync for faster WebSocket data inflation (npm install zlib-sync)
  • zucc for significantly faster WebSocket data inflation (npm install zucc)
  • erlpack for significantly faster WebSocket data (de)serialisation (npm install discordapp/erlpack)
  • One of the following packages can be installed for faster voice packet encryption and decryption:
  • uws for a much faster WebSocket connection (npm install @discordjs/uws)
  • bufferutil for a much faster WebSocket connection when not using uws (npm install bufferutil)

Example usage

upstream/master

var Discord = require("discord.js");

var mybot = new Discord.Client();

mybot.on("message", function(message){
	if(message.content === "ping")
		mybot.reply(message, "pong");
});

mybot.login("email", "password");

Contributing

Feel free to contribute! Just clone the repo and edit the files in the src folder, not the lib folder.

Whenever you come to making a pull request, make sure it's to the indev branch and that you have built the lib files by running grunt --dev


Related Projects

Here is a list of other Discord APIs:

Java:

Discord4J

JDiscord

JDA

Go:

Go-Discord

DiscordGo

.NET:

Discord.Net

DiscordSharp

NodeJS

discord.io (similar to discord.js but lower level)

discordie

PHP

DiscordPHP

Discord-PHP

Python

discord.py

Ruby

discordrb


Links

Documentation

GitHub

Wiki

Website

NPM


Contact

If you have an issue or want to know if a feature exists, read the documentation before contacting me about any issues! If it's badly/wrongly implemented, let me know!

If you would like to contact me, you can create an issue on the GitHub repo, e-mail me via the one available on my NPM profile.

<<<<<<< HEAD Alternatively, you could just send a DM to hydrabolt in Discord API.

Links

Extensions

Contributing

Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the documentation.
See the contribution guide if you'd like to submit a PR.

Help

If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to join our official Discord.js Server.

upstream/master

About

A JS interface for the Discord API.

http://hydrabolt.github.io/discord.js/

License:Apache License 2.0


Languages

Language:JavaScript 99.9%Language:Shell 0.1%Language:HTML 0.0%