mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
53f5c2cb5282a857dd1a8e78038d6d5d65b078b0
* Cache array and keyArray in Collection Cache array and keyArray in the Collection class to improve consecutive calls of collection.random() by around 400,000%, I think lel. The speed decrease (I assume) compared to the previous version when calling after it has changed is most likely negligible. * Fix for ESLint I think this fixes it.
discord.js is a powerful node.js module that allows you to interact with the Discord API.
Installation
Node.js 6.0.0 or newer is required.
With voice support: npm install --save discord.js --production
Without voice support: npm install --save discord.js --production --no-optional
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
- Website
- Discord.js Server
- Discord API Server
- Documentation
- Legacy Documentation
- GitHub
- NPM
- Examples
- Related Libraries
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.
Description
Languages
TypeScript
61.1%
JavaScript
28.5%
MDX
10.1%
CSS
0.2%


