mirror of
https://github.com/danbulant/discord.js
synced 2026-05-24 20:42:27 +00:00
No description
|
|
||
|---|---|---|
| docs | ||
| src | ||
| test | ||
| .eslintrc.json | ||
| .gitignore | ||
| .travis.yml | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
discord.js is a a powerful node.js module that allows you to interact with the Discord API.
Installation
Requires node 6.0.0 and above
npm install --save discord.js
# or, if you don't want voice support:
npm install --save --no-optional discord.js
By default, discord.js uses opusscript when playing audio over voice connections. If you're looking to play over multiple voice connections, it might be better to install node-opus. discord.js will automatically prefer node-opus over opusscript.
Example Usage
const Discord = require('discord.js');
const bot = new Discord.Client();
bot.on('ready', () => {
console.log('I am ready!');
});
bot.on('message', message => {
if (message.content === 'ping') {
message.reply('pong');
}
});
bot.login('your token');
Links
Contact
Before reporting an issue, please read the documentation. If you can't find help there, you can find help in the Discord API Server.

