mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
2.5 KiB
2.5 KiB
discord.js is 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 client = new Discord.Client();
client.on('ready', () => {
console.log('I am ready!');
});
client.on('message', message => {
if (message.content === 'ping') {
message.reply('pong');
}
});
client.login('your token');
Links
Contact
Before reporting an issue, please read the documentation. If you can't find help there, you can ask in the official Discord.js Server.


